• Home
  • Raw
  • Download

Lines Matching +full:qemu +full:- +full:user +full:- +full:static

39 # include <sys/linux-syscalls.h>
45 /* If this is ever expanded to non-Linux platforms, verify what calls are
57 # define dirfd(dirp) ((dirp)->dd_fd)
74 #define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0)
76 static struct PyModuleDef _posixsubprocessmodule;
78 /* Convert ASCII to a positive int, no libc call. no overflow. -1 on error. */
79 static int
84 num = num * 10 + (*name - '0'); in _pos_int_from_ascii()
88 return -1; /* Non digit found, not a number. */ in _pos_int_from_ascii()
94 /* When /dev/fd isn't mounted it is often a static directory populated
100 static int
110 return 0; /* / == /dev == /dev/fd means it is static. #fail */ in _is_fdescfs_mounted_on_dev_fd()
117 static int
121 long prev_fd = -1; in _sanity_check_python_fd_sequence()
140 static int
146 Py_ssize_t search_max = fd_sequence_len - 1; in _is_fd_in_sorted_fd_sequence()
157 search_max = middle - 1; in _is_fd_in_sorted_fd_sequence()
170 * Returns: -1 on error, 0 on success.
172 static int
181 if (fd == -1 && PyErr_Occurred()) { in convert_fds_to_keep_to_c()
182 return -1; in convert_fds_to_keep_to_c()
187 return -1; in convert_fds_to_keep_to_c()
195 /* This function must be async-signal-safe as it is called from child_exec()
198 static int
212 return -1; in make_inheritable()
221 static long
233 * safe. TODO - Someone should audit OpenBSD to make sure. */ in safe_get_max_fd()
239 if (local_max_fd == -1) in safe_get_max_fd()
249 * If end_fd == -1, it's guessed via safe_get_max_fd(), but it isn't
254 static int
261 if (end_fd == -1) { in _close_range_except()
271 if (closer(start_fd, keep_fd - 1) != 0) in _close_range_except()
272 return -1; in _close_range_except()
277 return -1; in _close_range_except()
294 char d_name[256]; /* Filename (null-terminated) */
297 static int
322 static void
328 if (fd_dir_fd == -1) { in _close_open_fds_safe()
330 _close_range_except(start_fd, -1, in _close_open_fds_safe()
345 for (offset = 0; offset < bytes; offset += entry->d_reclen) { in _close_open_fds_safe()
348 if ((fd = _pos_int_from_ascii(entry->d_name)) < 0) in _close_open_fds_safe()
365 static int
383 * http://womble.decadent.org.uk/readdir_r-advisory.html
385 static void
411 _close_range_except(start_fd, -1, fds_to_keep, fds_to_keep_len, in _close_open_fds_maybe_unsafe()
418 int fd_used_by_opendir = start_fd - 1; in _close_open_fds_maybe_unsafe()
423 if ((fd = _pos_int_from_ascii(dir_entry->d_name)) < 0) in _close_open_fds_maybe_unsafe()
434 _close_range_except(start_fd, -1, fds_to_keep, fds_to_keep_len, in _close_open_fds_maybe_unsafe()
446 * async-signal-safe.
455 static int
462 static void
480 static void
500 if (sigaction(sig, NULL, &sa) == -1) { in reset_signal_handlers()
523 * All of the code in this function must only use async-signal-safe functions,
533 * async-signal-safe functions vfork-unsafe. In particular, on Linux,
535 * they have to interact with the library-level thread list and send
536 * library-internal signals to implement per-process credentials semantics
540 * See bpo-35823 for further discussion and references.
543 * behavior since resource limits were per-thread attributes before
547 * If vfork-unsafe functionality is desired after vfork(), consider using
550 Py_NO_INLINE static void
579 if (p2cwrite != -1) in child_exec()
581 if (c2pread != -1) in child_exec()
583 if (errread != -1) in child_exec()
606 would be a no-op (issue #10806). */ in child_exec()
611 else if (p2cread != -1) in child_exec()
618 else if (c2pwrite != -1) in child_exec()
625 else if (errwrite != -1) in child_exec()
629 * _close_open_fds takes care when it is not already non-inheritable. */ in child_exec()
677 /* This is where the user has asked us to deadlock their program. */ in child_exec()
689 /* Py_DECREF(result); - We're about to exec so why bother? */ in child_exec()
694 /* TODO HP-UX could use pstat_getproc() if anyone cares about it. */ in child_exec()
728 *--cur = Py_hexdigits[saved_errno % 16]; in child_exec()
731 _Py_write_noraise(errpipe_write, cur, hex_errno + sizeof(hex_errno) - cur); in child_exec()
751 * child_exec() should not be inlined to avoid spurious -Wclobber warnings from
752 * GCC (see bpo-35823).
754 Py_NO_INLINE static pid_t
785 if (pid == -1) { in do_fork_exec()
787 * allowed in a process by the kernel, vfork can return -1 in do_fork_exec()
808 * This call may not be async-signal-safe but neither is calling in do_fork_exec()
809 * back into Python. The user asked us to use hope as a strategy in do_fork_exec()
827 static PyObject *
840 pid_t pgid_to_set = -1; in subprocess_fork_exec()
847 pid_t pid = -1; in subprocess_fork_exec()
886 if (config->_isolated_interpreter) { in subprocess_fork_exec()
1049 /* NOTE: When old_sigmask is non-NULL, do_fork_exec() may use vfork(). */ in subprocess_fork_exec()
1062 * might send such a signal to be vfork-unsafe and do not call it in in subprocess_fork_exec()
1084 if (pid == -1) { in subprocess_fork_exec()
1095 * such as QEMU user-mode emulation, the parent won't be blocked, in subprocess_fork_exec()
1139 return pid == -1 ? NULL : PyLong_FromPid(pid); in subprocess_fork_exec()
1176 static PyMethodDef module_methods[] = {
1181 static PyModuleDef_Slot _posixsubprocess_slots[] = {
1185 static struct PyModuleDef _posixsubprocessmodule = {