This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2/2] Document shm_open and shm_close
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 29 Nov 2013 19:06:37 +0100
- Subject: [PATCH 2/2] Document shm_open and shm_close
- Authentication-results: sourceware.org; auth=none
- References: <20131129004016 dot GA19990 at domone dot podge> <5297F6B6 dot 5010609 at redhat dot com> <20131129180250 dot GA24922 at domone dot podge>
> >
> > 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.
---
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
+shared memory object.
+
+A @var{name} argument specifies shared memory object to be opened.
+In @theglibc{} it must be a string smaller than @code{NAME_MAX} bytes starting with
+optional slash but without nonleading slashes.
+
+Semantics of @var{oflag} and @var{mode} arguments is same as in @code{open}.
+
+@code{shm_open} returns file descriptor on success and @math{-1} on error.
+@end deftypefn
+
+@deftypefun int shm_unlink (const char *@var{name})
+
+This function is inverse of @code{shm_open} and removes the object with given
+@var{name} previously created by @code{shm_open}.
+
+@code{shm_unlink} returns @math{0} on success and @math{-1} on error.
+@end deftypefn
+
@node Waiting for I/O
@section Waiting for Input or Output
@cindex waiting for input or output
--
1.8.4.rc3