You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit's main purpose is to robustify ksh93's handling of
the close-on-exec bit. Much of this code is based on groundwork
laid out in ksh93v-, though many other changes were made beyond
that since the 93v- syscall intercepts were not backported.
- Avoid needlessly calling fcntl twice if F_DUPFD_CLOEXEC
is available.
- Added support for F_DUPFD_CLOEXEC to sh_fcntl.
- Incidentally fixed file descriptor leakage in histexceptf().
- Added support for close-on-exec to sh_pipe and sh_rpipe,
which is implemented via SOCK_CLOEXEC, pipe2(2) and (as a
fallback) plain fcntl F_SETFD.
- For process substitutions, rather than use another fcntl to
undo close-on-exec (like in 93v-), instead add a second argument
to sh_pipe and sh_rpipe that can be used to specify whether
close-on-exec is wanted.
- Added support for O_CLOEXEC to sh_open().
- Made it such that sh_iomovefd preserves the presence or absence
of the close-on-exec bit.
- The ksh93v- change to make sh_iomovefd return fds >9 broke one
of the regression tests, so that was changed to dup to 3 or
higher.
src/lib/libast/features/lib:
- When ksh is compiled on illumos with clang, the libast
_lib_select test will fail and subsequently many io.sh test
failures then occur. This is caused by the FD_ZERO macro calling
memset implicitly, which is invalid in C99. To fix this, a
string.h include directive has been added to the feature test.
0 commit comments