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 2/2] Document shm_open and shm_close


On 11/29/2013 01:06 PM, OndÅej BÃlka wrote:
>>>
>>> In summary:
>>>
>>> * Fix the test.
>>> * Document the implementation-defined choices we've just made.
>>>
>>> Post v2 please.
>>>
>>> Cheers,
>>> Carlos.
>>
> Here is a documentation stub. As mmap is in llio.texi I put it there.
> 
> 
> 	* manual/llio.texi (Memory-mapped I/O): Add shm_open and shm_close.

Great job here, thanks for writing this!

> ---
>  manual/llio.texi | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/manual/llio.texi b/manual/llio.texi
> index dd0eaa3..899d1f5 100644
> --- a/manual/llio.texi
> +++ b/manual/llio.texi
> @@ -1471,6 +1471,31 @@ There is no existing mapping in at least part of the given region.
>  @end table
>  @end deftypefun
>  
> +@comment sys/mman.h
> +@comment POSIX
> +@deftypefun int shm_open (const char *@var{name}, int @var{oflag}, mode_t @var{mode})
> +
> +This function returns a file descriptor that can be used to allocate shared
> +memory by mmap. Unrelated processes can use same @var{name} to create or open existing

s/by mmap/via mmap/g.

> +shared memory object.

s/object/objects/g

> +
> +A @var{name} argument specifies shared memory object to be opened.

s/specifies/specifies the/g

> +In @theglibc{} it must be a string smaller than @code{NAME_MAX} bytes starting with

s/with/with an/g

> +optional slash but without nonleading slashes.

Suggest:
+optional leading slash but containing no other slashes.

> +
> +Semantics of @var{oflag} and @var{mode} arguments is same as in @code{open}.

s/Semantics/The semantics/g

> +
> +@code{shm_open} returns file descriptor on success and @math{-1} on error.

s/file/a file/g
s/and @math/or @math/g

Suggest adding: On failure @code{errno} is set.

> +@end deftypefn
> +
> +@deftypefun int shm_unlink (const char *@var{name})
> +
> +This function is inverse of @code{shm_open} and removes the object with given

s/with/with the/g

> +@var{name} previously created by @code{shm_open}.
> +
> +@code{shm_unlink} returns @math{0} on success and @math{-1} on error.

Suggest adding: On failure @code{errno} is set.

> +@end deftypefn
> +
>  @node Waiting for I/O
>  @section Waiting for Input or Output
>  @cindex waiting for input or output
> 

OK with those changes.

Cheers,
Carlos.


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