mirror of
https://github.com/opnsense/src.git
synced 2026-02-26 03:13:02 -05:00
The motivation for this change is to allow wrappers around shm to be written that don't set CLOEXEC. kern_shm_open currently accepts O_CLOEXEC but sets it unconditionally. kern_shm_open is used by the shm_open(2) syscall, which is mandated by POSIX to set CLOEXEC, and CloudABI's sys_fd_create1(). Presumably O_CLOEXEC is intended in the latter caller, but it's unclear from the context. sys_shm_open() now unconditionally sets O_CLOEXEC to meet POSIX requirements, and a comment has been dropped in to kern_fd_open() to explain the situation and add a pointer to where O_CLOEXEC setting is maintained for shm_open(2) correctness. CloudABI's sys_fd_create1() also unconditionally sets O_CLOEXEC to match previous behavior. This also has the side-effect of making flags correctly reflect the O_CLOEXEC status on this fd for the rest of kern_shm_open(), but a glance-over leads me to believe that it didn't really matter. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21119 |
||
|---|---|---|
| .. | ||
| cloudabi_clock.c | ||
| cloudabi_errno.c | ||
| cloudabi_fd.c | ||
| cloudabi_file.c | ||
| cloudabi_futex.c | ||
| cloudabi_mem.c | ||
| cloudabi_proc.c | ||
| cloudabi_proto.h | ||
| cloudabi_random.c | ||
| cloudabi_sock.c | ||
| cloudabi_thread.c | ||
| cloudabi_util.h | ||
| cloudabi_vdso.c | ||
| cloudabi_vdso.lds | ||