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