aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/strtofflags.3
diff options
context:
space:
mode:
authorJosef Karthauser <joe@FreeBSD.org>2000-06-17 11:09:24 +0000
committerJosef Karthauser <joe@FreeBSD.org>2000-06-17 11:09:24 +0000
commit8c7bdc130e70c930f58e483fb4922c02f3d24d86 (patch)
treeda1ea697e1f657619b9b2f33373e5804a89850c4 /lib/libc/gen/strtofflags.3
parent7684b08b561d54e88e094318e306261947ce6e45 (diff)
downloadsrc-8c7bdc130e70c930f58e483fb4922c02f3d24d86.tar.gz
src-8c7bdc130e70c930f58e483fb4922c02f3d24d86.zip
Modify strtofflags so that it returns a malloced string instead of a
pointer to a static buffer.
Notes
Notes: svn path=/head/; revision=61746
Diffstat (limited to 'lib/libc/gen/strtofflags.3')
-rw-r--r--lib/libc/gen/strtofflags.327
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/libc/gen/strtofflags.3 b/lib/libc/gen/strtofflags.3
index f287c172cf73..10f86c935917 100644
--- a/lib/libc/gen/strtofflags.3
+++ b/lib/libc/gen/strtofflags.3
@@ -38,7 +38,7 @@
.Sh NAME
.Nm fflagstostr ,
.Nm strtofflags
-.Nd modify file flag bits
+.Nd convert between file flag bits and their string names
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
@@ -54,6 +54,19 @@ function returns a comma separated string of the file flags represented by
.Fa flags .
If no flags are set a zero length string is returned.
.Pp
+If memory cannot be allocated for the return value,
+.Fn fflagstostr
+returns
+.Dv NULL .
+.Pp
+The value returned from
+.Fn fflagstostr
+is obtained from
+.Fn malloc
+and should be returned to the system with
+.Fn free
+when the program is done with it.
+.Pp
The
.Fn strtofflags
function takes a string of file flags, as described in
@@ -66,13 +79,21 @@ On success
returns 0, otherwise it returns non-zero and
.Fa stringp
is left pointing to the offending token.
+.Sh ERRORS
+The
+.Fn fflagstostr
+function
+may fail and set errno for any of the errors specified for the library
+routine
+.Xr malloc 3 .
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr chflags 2 ,
+.Xr malloc 3
.Sh HISTORY
The
-.Fn strtofflags
-and
.Fn fflagstostr
+and
+.Fn strtofflags
functions first appeared in
.Fx 4.0 .