diff options
Diffstat (limited to 'lib/libc/gen/strtofflags.3')
-rw-r--r-- | lib/libc/gen/strtofflags.3 | 27 |
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 . |