although this is an intentionally undocumented interface (see PR/35278),
fix up the non existent documentation to reflect the reality.
This commit is contained in:
parent
d60552baa5
commit
2ec4c16ef8
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: pathname.9,v 1.2 2007/04/13 18:19:36 plunky Exp $
|
||||
.\" $NetBSD: pathname.9,v 1.3 2007/04/15 10:36:51 plunky Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2006 Elad Efrat <elad@NetBSD.org>
|
||||
.\" All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd January 16, 2007
|
||||
.Dd April 15, 2007
|
||||
.Dt PATHNAME 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -33,9 +33,10 @@
|
||||
.Nd pathname management interface
|
||||
.Sh SYNOPSIS
|
||||
.In sys/namei.h
|
||||
.Ft pathname_t
|
||||
.Fn pathname_get "const char *dirp" "enum uio_segflg seg"
|
||||
.Ft char *
|
||||
.In sys/uio.h
|
||||
.Ft int
|
||||
.Fn pathname_get "const char *dirp" "enum uio_seg segflg" "pathname_t *pnp"
|
||||
.Ft const char *
|
||||
.Fn pathname_path "pathname_t pn"
|
||||
.Ft void
|
||||
.Fn pathname_put "pathname_t pn"
|
||||
@ -45,25 +46,27 @@ The
|
||||
interface provides an easy way to manage memory buffers used to hold pathnames.
|
||||
It provides three functions:
|
||||
.Pp
|
||||
.Bl -tag
|
||||
.It Ft pathname_t Fn pathname_get "const char *dirp" "enum uio_segflg seg"
|
||||
Takes a pointer to a pathname buffer,
|
||||
.Bl -tag -width 6n
|
||||
.It Fn pathname_get "dirp" "segflg" "pnp"
|
||||
Takes a path string
|
||||
.Ar dirp ,
|
||||
and an argument indicating in what address space it is located at,
|
||||
.Ar seg ;
|
||||
.Dv UIO_SYSSPACE
|
||||
or
|
||||
.Dv UIO_USERSPACE
|
||||
for kernel-space and user-space, respectively.
|
||||
.It Ft char * Fn pathname_path "pathname_t pn"
|
||||
Takes a
|
||||
.Ft pathname_t
|
||||
argument as returned from a previous call to
|
||||
.Fn pathname_get ,
|
||||
.Ar pn ,
|
||||
and returns a pointer to the pathname buffer.
|
||||
and an argument
|
||||
.Ar segflg
|
||||
indicating if the pointer refers to kernel-space
|
||||
.Pq Dv UIO_SYSSPACE
|
||||
or user-space
|
||||
.Pq Dv UIO_USERSPACE .
|
||||
Upon success,
|
||||
.Fn pathname_get
|
||||
returns 0 and stores a pathname handle
|
||||
in the location pointed to by
|
||||
.Ar pnp .
|
||||
Otherwise an error code is returned to indicate the reason for failure.
|
||||
.It Fn pathname_path "pn"
|
||||
Returns a pointer to the path referenced by
|
||||
.Ar pn .
|
||||
This pointer is safe to use in the kernel.
|
||||
.It Ft void Fn pathname_put "pathname_t pn"
|
||||
.It Fn pathname_put "pn"
|
||||
Frees all memory associated with
|
||||
.Ar pn .
|
||||
.El
|
||||
@ -72,9 +75,9 @@ Frees all memory associated with
|
||||
.Sh AUTHORS
|
||||
.An Elad Efrat Aq elad@NetBSD.org
|
||||
.Sh CAVEATS
|
||||
If the buffer is located in kernel-space,
|
||||
If the path string is located in kernel-space,
|
||||
.Fn pathname_get
|
||||
will reuse it.
|
||||
will use it rather than making a copy.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
|
Loading…
Reference in New Issue
Block a user