| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
The ability to clear a file descriptor's close-on-exec flag via
posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue
#411.
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file
descriptor is negative, not [EINVAL]. The bug was only in the manual page;
the code is correct.
MFC after: 1 week
|
| |
|
| |
|
|
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
| |
MFC after: 3 days
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
querylocale is not part of IEEE Std 1003.1-2008.
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and
O_NONBLOCK (on both sides) as part of the function.
If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p).
If the pointer is not valid, behaviour differs: pipe2() writes into the
array from the kernel like socketpair() does, while pipe() writes into the
array from an architecture-specific assembler wrapper.
Reviewed by: kan, kib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The accept4() function, compared to accept(), allows setting the new file
descriptor atomically close-on-exec and explicitly controlling the
non-blocking status on the new socket. (Note that the latter point means
that accept() is not equivalent to any form of accept4().)
The linuxulator's accept4 implementation leaves a race window where the new
file descriptor is not close-on-exec because it calls sys_accept(). This
implementation leaves no such race window (by using falloc() flags). The
linuxulator could be fixed and simplified by using the new code.
Like accept(), accept4() is async-signal-safe, a cancellation point and
permitted in capability mode.
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
| |
Reported by: bde
MFC after: 1 week
|
|
|
|
|
|
|
| |
getdtablesize() returns the limit on new file descriptors; this says nothing
about existing descriptors.
MFC after: 1 week
|
|
|
|
| |
And add '__restrict' where it appeared in the header prototypes
|
|
|
|
|
|
|
| |
NetBSD, OpenBSD, and Android's Bionic all number the clauses 1 through 3,
so follow suit to make comparison easier.
Acked-by: imp@
|
|
|
|
|
|
|
|
| |
- make the prototype of sl_find match NetBSD
Reviewed by: jilles
Approved by: cperciva (mentor)
MFC After: 3 days
|
|
|
|
|
|
| |
Reviewed by: jilles
Approved by: cperciva (mentor)
MFC After: 3 days
|
| |
|
|
|
|
|
|
|
|
|
| |
There are no getdtablesize() bounds on the file descriptor to be duplicated;
it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after
opening the file descriptor, it may be greater than or equal to
getdtablesize() but still valid.
MFC after: 1 week
|
|
|
|
|
|
| |
PR: 177025
Submitted by: Fernando <fernando.apesteguia@gmail.com>
Reviewed by: theraven
|
|
|
|
|
|
|
| |
Also fix cpu_getaffinity(2) document title.
PR: 176317
Submitted by: brucec
|
|
|
|
|
|
|
|
|
|
| |
The functions utx_active_add(), utx_active_remove(), utx_lastlogin_add() and
utx_log_add() set errno to 0 if they are successful. This not only violates
POSIX if pututxline() is successful, but may also overwrite a valid error
with 0 if, for example, utx_lastlogin_add() fails while utx_log_add()
succeeds.
Reviewed by: ed
|
|
|
|
| |
Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
|
| |
|
|
|
|
|
|
|
|
| |
signal.
- Fix the old ksem implementation for POSIX semaphores to not restart
sem_wait() or sem_timedwait() if interrupted by a signal.
MFC after: 1 week
|
|
|
|
|
|
| |
PR: kern/177704
Submitted by: martymac
MFC after: 1 week
|
| |
|
| |
|
|
|
|
|
|
|
| |
Remove unused code.
While there, do some cleanup of the code.
MFC after: 1 week
|
|
|
|
|
|
| |
messages (SO_BINTIME, SO_TIMEVAL).
Obtained from: phk
|
|
|
|
|
|
|
|
| |
source sysctl(KERN_ARND) and remove the fallback code.
Obtained from: OpenBSD
Reviewed by: secteam
MFC after: 1 month
|
|
|
|
|
|
|
|
|
| |
extattr_set_{fd,file,link} is logically a write(2)-like operation and
should return ssize_t, just like extattr_get_*. Also, the user-space
utility was using an int for the return value of extattr_get_* and
extattr_list_*, both of which return an ssize_t.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
Words in shell script are separated by spaces or tabs independent of the
value of IFS. The value of IFS is only relevant for the result of
substitutions. Therefore, there should be a space between 'wordexp' and the
words to be expanded, not an IFS character.
Paranoia might dictate that the shell ignore IFS from the environment (even
though our sh currently uses it), so do not depend on it in the new test
case.
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
| |
While almost nobody uses O_ASYNC, and rightly so, the inheritance of the
related properties across accept() is a portability issue like the
inheritance of O_NONBLOCK.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on signed integer overflow wrapping. Otherwise mktime(3) and timegm(3)
can hang, in case the timestamp passed in struct tm is not representable
in a time_t. Specifically, any timestamp after 2038-01-19 03:14:07, in
combination with a 32-bit time_t.
Note that it would be better to change the code to not rely on undefined
behaviour, but it is contributed code, and it is not entirely trivial to
fix the issue properly.
MFC after: 3 days
|
|
|
|
| |
Obtained from: jilles
|
|
|
|
|
|
|
| |
file flags.
Reviewed by: kib, jilles
Sponsored by: The FreeBSD Foundation
|
|
|
|
|
|
|
|
|
|
|
| |
u_long. Before this change it was of type int for syscalls, but prototypes
in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not
for lchflags(2)) stated that it was u_long. Now some related functions
use u_long type for flags (strtofflags(3), fflagstostr(3)).
- Make path argument of type 'const char *' for consistency.
Discussed on: arch
Sponsored by: The FreeBSD Foundation
|
|
|
|
|
| |
PR: kern/162374
Reviewed by: ed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows creating file descriptors with close-on-exec set in some
situations. SOCK_CLOEXEC and SOCK_NONBLOCK can be OR'ed in socket() and
socketpair()'s type parameter, and MSG_CMSG_CLOEXEC to recvmsg() makes file
descriptors (SCM_RIGHTS) atomically close-on-exec.
The numerical values for SOCK_CLOEXEC and SOCK_NONBLOCK are as in NetBSD.
MSG_CMSG_CLOEXEC is the first free bit for MSG_*.
The SOCK_* flags are not passed to MAC because this may cause incorrect
failures and can be done later via fcntl() anyway. On the other hand, audit
is expected to cope with the new flags.
For MSG_CMSG_CLOEXEC, unp_externalize() is extended to take a flags
argument.
Reviewed by: kib
|
|
|
|
|
|
| |
ENOMEM. Clarify this, taking text from SUS.
Reviewed by: kib
|
| |
|
|
|
|
| |
FreeBSD 5.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multibyte support[0] and the new functions strenvisx and strsenvisx.
Add MLINKS for vis(3) functions add by this and the initial import from
NetBSD[1].
PR: bin/166364, bin/175418
Submitted by: "J.R. Oldroyd" <fbsd@opal.com>[0]
stefanf[1]
Obtained from: NetBSD
MFC after: 2 weeks
|