HomeFreeBSD

Add accept4() system call.
rS250154Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Add accept4() system call.

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.

Details

Provenance
jillesAuthored on
Parents
rS250153: Partially saved extended state must be handled always, i.e. for both
Branches
Unknown
Tags
Unknown

Event Timeline