Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162831385
D21119.id60306.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1005 B
Referenced Files
None
Subscribers
None
D21119.id60306.diff
View Options
Index: sys/kern/uipc_shm.c
===================================================================
--- sys/kern/uipc_shm.c
+++ sys/kern/uipc_shm.c
@@ -729,7 +729,14 @@
fdp = td->td_proc->p_fd;
cmode = (mode & ~fdp->fd_cmask) & ACCESSPERMS;
- error = falloc_caps(td, &fp, &fd, O_CLOEXEC, fcaps);
+ /*
+ * shm_open(2) created shm should always have O_CLOEXEC set, as mandated
+ * by POSIX. We allow it to be unset here so that an in-kernel
+ * interface may be written as a thin layer around shm, optionally not
+ * setting CLOEXEC. For shm_open(2), O_CLOEXEC is set unconditionally
+ * in sys_shm_open to keep this implementation compliant.
+ */
+ error = falloc_caps(td, &fp, &fd, flags & O_CLOEXEC, fcaps);
if (error)
return (error);
@@ -844,7 +851,8 @@
sys_shm_open(struct thread *td, struct shm_open_args *uap)
{
- return (kern_shm_open(td, uap->path, uap->flags, uap->mode, NULL));
+ return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC, uap->mode,
+ NULL));
}
int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 18, 9:12 AM (3 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35193808
Default Alt Text
D21119.id60306.diff (1005 B)
Attached To
Mode
D21119: kern_shm_open: push O_CLOEXEC into caller controller
Attached
Detach File
Event Timeline
Log In to Comment