aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-07-10 00:45:16 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-07-10 00:45:16 +0000
commit423a033ba7bf9b38a4843ae9609019cc108647cf (patch)
treeadb2c8adf4db1385da4e903411234d6480f840d0 /lib/libc/sys
parent3f07b9d9f87e28e577453e784ae369e18d35157b (diff)
downloadsrc-423a033ba7bf9b38a4843ae9609019cc108647cf.tar.gz
src-423a033ba7bf9b38a4843ae9609019cc108647cf.zip
memfd_create: turn on SHM_GROW_ON_WRITE
memfd_create fds will no longer require an ftruncate(2) to set the size; they'll grow (to the extent that it's possible) upon write(2)-like syscalls. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25502
Notes
Notes: svn path=/head/; revision=363066
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/shm_open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/sys/shm_open.c b/lib/libc/sys/shm_open.c
index 7eb546552c30..cf89505b3d56 100644
--- a/lib/libc/sys/shm_open.c
+++ b/lib/libc/sys/shm_open.c
@@ -84,7 +84,7 @@ memfd_create(const char *name, unsigned int flags)
/* We've already validated that we're sufficiently sized. */
snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name);
oflags = O_RDWR;
- shmflags = 0;
+ shmflags = SHM_GROW_ON_WRITE;
if ((flags & MFD_CLOEXEC) != 0)
oflags |= O_CLOEXEC;
if ((flags & MFD_ALLOW_SEALING) != 0)