History log of /libuv/src/unix/process.c (Results 1 – 25 of 132)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 90648ea3 16-Jul-2024 Olivier Valentin

hurd: add includes and macro prerequisites

- ptsname() needs _XOPEN_SOURCE >= 500
- setenv needs _POSIX_C_SOURCE >= 200112
- setgroups needs grp.h


# f50ae53c 14-Apr-2024 Brad King

unix: de-duplicate conditions for using kqueue (#4378)

Our platform-specific headers provide a dedicated indicator.


# 3f7191e5 05-Feb-2024 Brad King

win/spawn: optionally run executable paths with no file extension (#4292)

Add a process options flag to enable the optional behavior. Most users
are likely recommended to set this flag b

win/spawn: optionally run executable paths with no file extension (#4292)

Add a process options flag to enable the optional behavior. Most users
are likely recommended to set this flag by default, but it was deemed
potentially breaking to set it by default in libuv.

Co-authored-by: Kyle Edwards <kyle.edwards@kitware.com>

show more ...


# ca544ed6 23-Jun-2023 小明 <7737673+caobug@users.noreply.github.com>

unix: skip prohibited syscalls on tvOS and watchOS (#4043)


# 1b01b786 24-May-2023 Ben Noordhuis

unix,win: replace QUEUE with struct uv__queue (#4022)

Recent versions of gcc have started emitting warnings about the liberal
type casting inside the QUEUE macros. Although the warnings

unix,win: replace QUEUE with struct uv__queue (#4022)

Recent versions of gcc have started emitting warnings about the liberal
type casting inside the QUEUE macros. Although the warnings are false
positives, let's use them as the impetus to switch to a type-safer and
arguably cleaner approach.

Fixes: https://github.com/libuv/libuv/issues/4019

show more ...


# 3990fcad 12-May-2023 cui fliter

docs: fix some typos (#3984)


# 42cc412c 01-Feb-2023 Jameson Nash

darwin,process: feed kevent the signal to reap children (#3893)

Since we are emulating this event, but are not using the pending_queue,
we need to make sure it is accounted for properly.

darwin,process: feed kevent the signal to reap children (#3893)

Since we are emulating this event, but are not using the pending_queue,
we need to make sure it is accounted for properly. Also DRY some of the
reset_timeout code here.

This was observed to cause a hang in certain rare cases, particularly on
M1 machines.

Do a bit of code cleanup too, since we do not need to initialize the
internal signal handling pipe if it will not be used.

show more ...


# 5102b2c0 28-Nov-2022 Ben Noordhuis

unix: drop kfreebsd support (#3835)

Because kFreeBSD is dead. RIP.

Fixes: https://github.com/libuv/libuv/issues/3833


# 51dcac5d 25-May-2022 Wayne Zhang

zos: don't err when killing a zombie process (#3625)

On z/OS, EPERM is returned if the process being killed is a zombie.
However, this shouldn't be treated as an error, so return 0 inste

zos: don't err when killing a zombie process (#3625)

On z/OS, EPERM is returned if the process being killed is a zombie.
However, this shouldn't be treated as an error, so return 0 instead.

Co-authored-by: Muntasir Mallick <mmallick@ca.ibm.com>
Co-authored-by: Gaby Baghdadi <baghdadi@ca.ibm.com>

show more ...


# 7c9b3938 15-Apr-2022 Jameson Nash

macos: avoid posix_spawnp() cwd bug (#3597)

macOS 10.15 has a bug where configuring the working directory with
posix_spawn_file_actions_addchdir_np() makes posix_spawnp() fail with
E

macos: avoid posix_spawnp() cwd bug (#3597)

macOS 10.15 has a bug where configuring the working directory with
posix_spawn_file_actions_addchdir_np() makes posix_spawnp() fail with
ENOENT even though the executable is spawned successfully.

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>

show more ...


# 264f16dc 22-Mar-2022 Denny C. Dai

process,iOS: fix build breakage in process.c (#3563)

Remove the `TARGET_OS_IPHONE` ifdef to include posix spawn headers for
iOS build. Previously https://github.com/libuv/libuv/pull/3257

process,iOS: fix build breakage in process.c (#3563)

Remove the `TARGET_OS_IPHONE` ifdef to include posix spawn headers for
iOS build. Previously https://github.com/libuv/libuv/pull/3257
introduced posix spawn with \_\_APPLE\_\_ platform only, which resulted
in a number of spawn related definitions not found for iOS (such as
`uv__posix_spawn_fncs_tag`).

Co-authored-by: Jameson Nash <vtjnash@gmail.com>

show more ...


# bc9cd563 11-Mar-2022 Jameson Nash

process: reset the signal mask if the fork fails (#3537)

Fix a regression that sneaked into posix spawn changes.

Refs: https://github.com/libuv/libuv/pull/3257


# bae2992c 09-Mar-2022 Jameson Nash

process: fix hang after NOTE_EXIT (#3521)

Bug #3504 seems to affect more platforms than just OpenBSD. As this
seems to be a race condition in these kernels, we do not want to fail
be

process: fix hang after NOTE_EXIT (#3521)

Bug #3504 seems to affect more platforms than just OpenBSD. As this
seems to be a race condition in these kernels, we do not want to fail
because of it. Instead, we remove the WNOHANG flag from waitpid, and
track exactly which processes have exited. Should also be a slight speed
improvement for excessively large numbers of live children.

show more ...


# 3c569c00 09-Mar-2022 Ben Noordhuis

macos: don't use thread-unsafe strtok() (#3524)

Co-authored-by: Jameson Nash <vtjnash@gmail.com>


# 4296fec7 07-Mar-2022 Jameson Nash

process: simplify uv__write_int calls (#3519)


# 20a2b1c3 06-Mar-2022 Jameson Nash

unix: remove uv__cloexec_ioctl() (#3515)

Now that uv__cloexec_fcntl() is simplified
(https://github.com/libuv/libuv/pull/3492), there is no benefit to
maintaining duplicate code path

unix: remove uv__cloexec_ioctl() (#3515)

Now that uv__cloexec_fcntl() is simplified
(https://github.com/libuv/libuv/pull/3492), there is no benefit to
maintaining duplicate code paths for the same thing.

show more ...


# 6ac063d1 05-Mar-2022 Jameson Nash

process: only use F_DUPFD_CLOEXEC if it is defined (#3512)

We can save a syscall on most modern systems (required by POSIX 2008),
but not on all systems.

Also handle errors from

process: only use F_DUPFD_CLOEXEC if it is defined (#3512)

We can save a syscall on most modern systems (required by POSIX 2008),
but not on all systems.

Also handle errors from CLOEXEC. Even though fcntl does not really
define there to be any, it could theoretically be EBADF if the user
happened to pass a bad file descriptor to the same number fd (such that
no other code happened to already fail on that).

show more ...


# 60fbcad9 05-Mar-2022 Jameson Nash

process: remove OpenBSD from kevent list (#3506)

From user reports, it appears that OpenBSD has a broken kevent NOTE_EXIT
implementation. However, we can simply go back to the old, slowe

process: remove OpenBSD from kevent list (#3506)

From user reports, it appears that OpenBSD has a broken kevent NOTE_EXIT
implementation. However, we can simply go back to the old, slower
version therefore.

Fix: https://github.com/libuv/libuv/issues/3504

show more ...


# 83efa3dd 02-Mar-2022 Jameson Nash

Reland "macos: use posix_spawn instead of fork" (#3257)

Fixes: https://github.com/libuv/libuv/issues/3050
Refs: https://github.com/libuv/libuv/issues/3086
Refs: https://github.com/li

Reland "macos: use posix_spawn instead of fork" (#3257)

Fixes: https://github.com/libuv/libuv/issues/3050
Refs: https://github.com/libuv/libuv/issues/3086
Refs: https://github.com/libuv/libuv/pull/3064
Refs: https://github.com/libuv/libuv/pull/3107
Refs: https://github.com/libuv/libuv/pull/3064

This reverts commit 217fdf4265589889d00c7c0622fde2710971a020, then fixes
several issues with it:

* remove error fast-cleanup code that triggers a nodejs bug

Refs: https://github.com/libuv/libuv/pull/3107#issuecomment-782482608

* protect posix_spawn from EINTR

This is not a documented valid error, but seems to have been observed.

* ignore setuid/setgid syscall

This kernel function is not permitted unless the process is setuid root,
so disable this syscall. Falling back to fork/exec should be okay for
the rare cases that the user decides they need to do setuid(getuid()) or
setuid(geteuid()) for the child.

Refs: https://github.com/libuv/libuv/pull/3107#issuecomment-782482608

* improve posix_spawn path search

Ports the improvements in musl back to this function

* fix some additional problems and formatting issues

We previously might fail to start a watcher, in rare failure cases,
resulting in a zombie that we would fail to kill. Also avoid creating
the signal-pipe unless required (addresses a review comment from Apple)

* fix fd->fd mapping reuse

There was a chance that when duplicating the fd's into stdio_count+fd we
might be closing a currently opened fd with that value.

show more ...


# 953f901d 01-Feb-2022 Jameson Nash

process,bsd: handle kevent NOTE_EXIT failure (#3451)

The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
no

process,bsd: handle kevent NOTE_EXIT failure (#3451)

The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: https://github.com/libuv/libuv/pull/3441
Refs: https://github.com/libuv/libuv/pull/3257

show more ...


# d9e90857 31-Jan-2022 Jeremy Rose

process: monitor for exit with kqueue on BSDs (#3441)

This adds a workaround for an xnu kernel bug that sometimes results in
SIGCHLD not being delivered. The workaround is to use kevent

process: monitor for exit with kqueue on BSDs (#3441)

This adds a workaround for an xnu kernel bug that sometimes results in
SIGCHLD not being delivered. The workaround is to use kevent to listen
for EVFILT_PROC/NOTE_EXIT events instead of relying on SIGCHLD on *BSD.

Apple rdar: FB9529664
Refs: https://github.com/libuv/libuv/pull/3257

show more ...


# 04289fa3 29-Jul-2021 Jameson Nash

unix: protect fork in uv_spawn from signals

Years ago, we found that various kernels (linux, macOS) were known to
fail if they try to deliver a signal during this syscall, so we prevent

unix: protect fork in uv_spawn from signals

Years ago, we found that various kernels (linux, macOS) were known to
fail if they try to deliver a signal during this syscall, so we prevent
that from happening. They may have fixed those issues, but it is
generally just a bad time for signals to arrive (glibc blocks them here,
for example, including some more internal ones that it won't let us
touch here).

We try to be a bit conservative, and leave many signals unblocked which
could happen during normal execution and should terminate the process if
they do. There is a small race window after the child starts before we
clear the old handlers, if the user was to send an fake signal from
elsewhere, but that should be quite unlikely.

PR-URL: https://github.com/libuv/libuv/pull/3251
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

show more ...


# 6dbb1e2e 20-May-2021 Ricky Zhou

unix,process: add uv__write_errno helper function

No functional changes, but slightly more compact code.

PR-URL: https://github.com/libuv/libuv/pull/3059
Reviewed-By: Jameson Na

unix,process: add uv__write_errno helper function

No functional changes, but slightly more compact code.

PR-URL: https://github.com/libuv/libuv/pull/3059
Reviewed-By: Jameson Nash <vtjnash@gmail.com>

show more ...

Revision tags: v1.41.0, v1.40.0
# f6adf960 02-Sep-2020 Shuowang (Wayne) Zhang

zos: use execvpe() to set environ explictly

On z/OS, `execvp()` does not set the environment for child process from
`environ` when ran in ASCII mode. Instead, `execvpe()` provided by

zos: use execvpe() to set environ explictly

On z/OS, `execvp()` does not set the environment for child process from
`environ` when ran in ASCII mode. Instead, `execvpe()` provided by
ZOSLIB must be used to set the environment explicitly.

PR-URL: https://github.com/libuv/libuv/pull/3060
Reviewed-By: Richard Lau <rlau@redhat.com>

show more ...

# 217fdf42 12-Feb-2021 cjihrig

Revert "macos: use posix_spawn instead of fork"

This reverts commit 39968db6434f16f9fbd3c78f6c7392fd7ae9074e.

This commit caused a number of failures in the Node.js test suite
w

Revert "macos: use posix_spawn instead of fork"

This reverts commit 39968db6434f16f9fbd3c78f6c7392fd7ae9074e.

This commit caused a number of failures in the Node.js test suite
while attempting to release libuv 1.41.0.

Refs: https://github.com/libuv/libuv/issues/3086
Refs: https://github.com/libuv/libuv/pull/3064
PR-URL: https://github.com/libuv/libuv/pull/3107
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>

show more ...

123456