lkml.org 
[lkml]   [2013]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: named anonymous vmas
Btw, FreeBSD has an extension to shm_open to create unnamed but fd
passable segments. From their man page:

As a FreeBSD extension, the constant SHM_ANON may be used for the path
argument to shm_open(). In this case, an anonymous, unnamed shared
memory object is created. Since the object has no name, it cannot be
removed via a subsequent call to shm_unlink(). Instead, the shared
memory object will be garbage collected when the last reference to the
shared memory object is removed. The shared memory object may be shared
with other processes by sharing the file descriptor via fork(2) or
sendmsg(2). Attempting to open an anonymous shared memory object with
O_RDONLY will fail with EINVAL. All other flags are ignored.

To me this sounds like the best way to expose this functionality to the
user. Implementing it is another question as shm_open sits in libc,
we could either take it and shm_unlink to the kernel, or use O_TMPFILE
on tmpfs as the backend.


\
 
 \ /
  Last update: 2013-08-01 10:41    [W:0.092 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site