This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Linux: Add memfd_create system call wrapper


On 11/19/2017 05:49 AM, Florian Weimer wrote:

>>> +@code{memfd_create} does not correspond to a named object; the
>>> +@var{name} argument is used for informative purposes only.  The
>>
>> I see in mman-linux.h, "NAME is a name for debugging."  Can we say
>> "debugging purposes" here?  As-is, it sounds ignored, and doesn't really
>> hint at what type of information one could get from it or how.
> 
> Well, that is exactly what I want to convey: The name is unused and just
> shows up in /proc in a few places.  I want to make sure that there is no
> expectation that you get same underlying file if you specify the same name.

Why not say that explicitly?  Suggestion:

"However, the descriptor returned by @code{memfd_create} does not
correspond to a named object; the @var{name} argument is used for
debugging purposes only (e.g., will appear in @file{/proc}), and
separate invocations of @code{memfd_create} with the same @var{name}
will not return descriptors for the same region of memory."

> memfd_create.patch
...
> diff --git a/manual/llio.texi b/manual/llio.texi
> index 7dd4e0680d..9ecb891713 100644
> --- a/manual/llio.texi
> +++ b/manual/llio.texi
> @@ -1757,6 +1757,69 @@ the given @var{name} previously created by @code{shm_open}.
>  On failure @code{errno} is set.
>  @end deftypefn
>  
> +@deftypefun int memfd_create (const char *@var{name}, unsigned int @var{flags})
> +@standards{Linux, sys/mman.h}
> +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}}
> +The @code{memfd_create} function returns a file descriptor which can be
> +used to create memory mappings using the @code{mmap} function.  It is
> +similar to the @code{shm_open} function in the sense that these mappings
> +are not backed by actual files.  However, the descriptor returned by
> +@code{memfd_create} does not correspond to a named object; the
> +@var{name} argument is used for informative purposes only.  The
> +descriptor can be passed between processes (for example, over local
> +domain sockets), and mappings at the same offset refer to the same
> +memor.  The descriptor can also be used to create alias mappings within

lost a "y" here

Rical


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]