freebsd-dev/sys/compat/cloudabi
Kyle Evans b5a7ac997f kern_shm_open: push O_CLOEXEC into caller control
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
2019-07-31 15:16:51 +00:00
..
cloudabi_clock.c Include <sys/systm.h> to obtain the memcpy() prototype. 2017-03-24 07:09:33 +00:00
cloudabi_errno.c Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cloudabi_fd.c kern_shm_open: push O_CLOEXEC into caller control 2019-07-31 15:16:51 +00:00
cloudabi_file.c Introduce funlinkat syscall that always us to check if we are removing 2019-04-06 09:34:26 +00:00
cloudabi_futex.c Allow timed waits with relative timeouts on locks and condvars. 2018-01-04 21:57:37 +00:00
cloudabi_mem.c Upgrade to the latest sources generated from the CloudABI specification. 2017-07-26 06:57:15 +00:00
cloudabi_proc.c Catch up with changes to structure member names. 2017-01-17 22:05:52 +00:00
cloudabi_proto.h
cloudabi_random.c Catch up with changes to structure member names. 2017-01-17 22:05:52 +00:00
cloudabi_sock.c Improve handling of control message truncation. 2018-08-07 16:36:48 +00:00
cloudabi_thread.c Import the new automatically generated system call table for CloudABI. 2016-08-19 17:49:35 +00:00
cloudabi_util.h Allow timed waits with relative timeouts on locks and condvars. 2018-01-04 21:57:37 +00:00
cloudabi_vdso.c Provide the CloudABI vDSO to its executables. 2016-08-10 21:02:41 +00:00
cloudabi_vdso.lds Move the linker script from cloudabi64/ to cloudabi/. 2016-08-21 15:14:06 +00:00