xref: /minix3/lib/libc/gen/extattr_namespace_to_string.3 (revision f14fb602092e015ff630df58e17c2a9cd57d29b3)
1*f14fb602SLionel Sambuc.\"	$NetBSD: extattr_namespace_to_string.3,v 1.1 2011/12/16 12:46:00 wiz Exp $
2*f14fb602SLionel Sambuc.\"
3*f14fb602SLionel Sambuc.\" Copyright (c) 2001 Dima Dorfman <dd@FreeBSD.org>
4*f14fb602SLionel Sambuc.\" Copyright (c) 2011 Emmanuel Dreyfus <manu@NetBSD.org>
5*f14fb602SLionel Sambuc.\" All rights reserved.
6*f14fb602SLionel Sambuc.\"
7*f14fb602SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
8*f14fb602SLionel Sambuc.\" modification, are permitted provided that the following conditions
9*f14fb602SLionel Sambuc.\" are met:
10*f14fb602SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
11*f14fb602SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
12*f14fb602SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
13*f14fb602SLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
14*f14fb602SLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
15*f14fb602SLionel Sambuc.\"
16*f14fb602SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17*f14fb602SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*f14fb602SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*f14fb602SLionel Sambuc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20*f14fb602SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*f14fb602SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*f14fb602SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*f14fb602SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*f14fb602SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*f14fb602SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*f14fb602SLionel Sambuc.\" SUCH DAMAGE.
27*f14fb602SLionel Sambuc.\"
28*f14fb602SLionel Sambuc.\" FreeBSD: src/lib/libc/posix1e/extattr.3,v 1.5 2002/12/12 17:25:53 ru Exp
29*f14fb602SLionel Sambuc.\"
30*f14fb602SLionel Sambuc.Dd December 16, 2011
31*f14fb602SLionel Sambuc.Dt EXTATTR_NAMESPACE_TO_STRING 3
32*f14fb602SLionel Sambuc.Os
33*f14fb602SLionel Sambuc.Sh NAME
34*f14fb602SLionel Sambuc.Nm extattr_namespace_to_string ,
35*f14fb602SLionel Sambuc.Nm extattr_string_to_namespace
36*f14fb602SLionel Sambuc.Nd convert an extended attribute namespace identifier to a string and vice versa
37*f14fb602SLionel Sambuc.Sh LIBRARY
38*f14fb602SLionel Sambuc.Lb libc
39*f14fb602SLionel Sambuc.Sh SYNOPSIS
40*f14fb602SLionel Sambuc.In sys/extattr.h
41*f14fb602SLionel Sambuc.Ft int
42*f14fb602SLionel Sambuc.Fn extattr_namespace_to_string "int attrnamespace" "char **string"
43*f14fb602SLionel Sambuc.Ft int
44*f14fb602SLionel Sambuc.Fn extattr_string_to_namespace "const char *string" "int *attrnamespace"
45*f14fb602SLionel Sambuc.Sh DESCRIPTION
46*f14fb602SLionel SambucThe
47*f14fb602SLionel Sambuc.Fn extattr_namespace_to_string
48*f14fb602SLionel Sambucfunction converts a VFS extended attribute identifier to a human-readable
49*f14fb602SLionel Sambucstring.
50*f14fb602SLionel SambucThe
51*f14fb602SLionel Sambuc.Fn extattr_string_to_namespace
52*f14fb602SLionel Sambucconverts a human-readable string representing a namespace to a
53*f14fb602SLionel Sambucnamespace identifier.
54*f14fb602SLionel SambucAlthough a file system may implement arbitrary namespaces,
55*f14fb602SLionel Sambucthese functions only support the
56*f14fb602SLionel Sambuc.Dv EXTATTR_NAMESPACE_USER
57*f14fb602SLionel Sambuc.Pq Dq user
58*f14fb602SLionel Sambucand
59*f14fb602SLionel Sambuc.Dv EXTATTR_NAMESPACE_SYSTEM
60*f14fb602SLionel Sambuc.Pq Dq system
61*f14fb602SLionel Sambucnamespaces,
62*f14fb602SLionel Sambucwhich are defined in
63*f14fb602SLionel Sambuc.Xr extattr 9 .
64*f14fb602SLionel Sambuc.Pp
65*f14fb602SLionel SambucThese functions are meant to be used in error reporting and other
66*f14fb602SLionel Sambucinteractive tasks.
67*f14fb602SLionel SambucFor example,
68*f14fb602SLionel Sambucinstead of printing the integer identifying an extended attribute in
69*f14fb602SLionel Sambucan error message,
70*f14fb602SLionel Sambuca program might use
71*f14fb602SLionel Sambuc.Fn extattr_namespace_to_string
72*f14fb602SLionel Sambucto obtain a human-readable representation.
73*f14fb602SLionel SambucLikewise,
74*f14fb602SLionel Sambucinstead of requiring a user to enter the integer representing a namespace,
75*f14fb602SLionel Sambucan interactive program might ask for a name and use
76*f14fb602SLionel Sambuc.Fn extattr_string_to_namespace
77*f14fb602SLionel Sambucto get the desired identifier.
78*f14fb602SLionel Sambuc.Sh RETURN VALUES
79*f14fb602SLionel SambucIf any of the calls are unsuccessful, the value \-1 is returned
80*f14fb602SLionel Sambucand the global variable
81*f14fb602SLionel Sambuc.Va errno
82*f14fb602SLionel Sambucis set to indicate the error.
83*f14fb602SLionel Sambuc.Sh ERRORS
84*f14fb602SLionel Sambuc.Bl -tag -width Er
85*f14fb602SLionel Sambuc.It Bq Er EINVAL
86*f14fb602SLionel SambucThe requested namespace could not be identified.
87*f14fb602SLionel Sambuc.El
88*f14fb602SLionel Sambuc.Sh SEE ALSO
89*f14fb602SLionel Sambuc.Xr getextattr 1 ,
90*f14fb602SLionel Sambuc.Xr extattr_get_file 2 ,
91*f14fb602SLionel Sambuc.Xr extattr_copy_file 3 ,
92*f14fb602SLionel Sambuc.Xr extattr 9
93*f14fb602SLionel Sambuc.Sh HISTORY
94*f14fb602SLionel SambucExtended attribute support was developed as part of the
95*f14fb602SLionel Sambuc.Tn TrustedBSD
96*f14fb602SLionel SambucProject, and introduced in
97*f14fb602SLionel Sambuc.Fx 5.0
98*f14fb602SLionel Sambucand
99*f14fb602SLionel Sambuc.Nx 3.0 .
100*f14fb602SLionel SambucIt was developed to support security extensions requiring additional labels
101*f14fb602SLionel Sambucto be associated with each file or directory.
102