aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sys/Makefile.inc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-01-08 21:58:16 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-01-08 21:58:16 +0000
commit8e38aeff17c9cbe66a65d8ef8c66d9f100ddfd90 (patch)
tree49b07dc757aae71e0a64eb4939cde4037af60a24 /lib/libc/sys/Makefile.inc
parent3b2262e4880961209a00ca33d713cf6c8b0073f0 (diff)
downloadsrc-8e38aeff17c9cbe66a65d8ef8c66d9f100ddfd90.tar.gz
src-8e38aeff17c9cbe66a65d8ef8c66d9f100ddfd90.zip
Add a new file descriptor type for IPC shared memory objects and use it to
implement shm_open(2) and shm_unlink(2) in the kernel: - Each shared memory file descriptor is associated with a swap-backed vm object which provides the backing store. Each descriptor starts off with a size of zero, but the size can be altered via ftruncate(2). The shared memory file descriptors also support fstat(2). read(2), write(2), ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared memory file descriptors. - shm_open(2) and shm_unlink(2) are now implemented as system calls that manage shared memory file descriptors. The virtual namespace that maps pathnames to shared memory file descriptors is implemented as a hash table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash of the pathname. - As an extension, the constant 'SHM_ANON' may be specified in place of the path argument to shm_open(2). In this case, an unnamed shared memory file descriptor will be created similar to the IPC_PRIVATE key for shmget(2). Note that the shared memory object can still be shared among processes by sharing the file descriptor via fork(2) or sendmsg(2), but it is unnamed. This effectively serves to implement the getmemfd() idea bandied about the lists several times over the years. - The backing store for shared memory file descriptors are garbage collected when they are not referenced by any open file descriptors or the shm_open(2) virtual namespace. Submitted by: dillon, peter (previous versions) Submitted by: rwatson (I based this on his version) Reviewed by: alc (suggested converting getmemfd() to shm_open())
Notes
Notes: svn path=/head/; revision=175164
Diffstat (limited to 'lib/libc/sys/Makefile.inc')
-rw-r--r--lib/libc/sys/Makefile.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 75ffcfcc3da6..fe17d7d2d2c9 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -83,7 +83,7 @@ MAN+= _exit.2 abort2.2 accept.2 access.2 acct.2 adjtime.2 \
read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 sendfile.2 \
setgroups.2 setpgid.2 setregid.2 setresuid.2 setreuid.2 setsid.2 \
- setuid.2 shmat.2 shmctl.2 shmget.2 shutdown.2 \
+ setuid.2 shmat.2 shmctl.2 shmget.2 shm_open.2 shutdown.2 \
sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigqueue.2 \
sigreturn.2 sigstack.2 sigsuspend.2 sigwait.2 sigwaitinfo.2 \
socket.2 socketpair.2 stat.2 statfs.2 \
@@ -154,6 +154,7 @@ MLINKS+=setpgid.2 setpgrp.2
MLINKS+=setresuid.2 setresgid.2 setresuid.2 getresuid.2 setresuid.2 getresgid.2
MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2
MLINKS+=shmat.2 shmdt.2
+MLINKS+=shm_open.2 shm_unlink.2
MLINKS+=sigwaitinfo.2 sigtimedwait.2
MLINKS+=stat.2 fstat.2 stat.2 lstat.2
MLINKS+=statfs.2 fstatfs.2