diff options
author | joe <joe@FreeBSD.org> | 2000-06-17 11:09:24 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2000-06-17 11:09:24 +0000 |
commit | 4946ded616808163421971bd6648d16bb43c1020 (patch) | |
tree | efd55bb42d8342e76d0520fb606d34e1c942b650 /lib/libc/gen/strtofflags.3 | |
parent | 72dbbe24eb4f86ab6c34fcc8f32b2bcabd1151e3 (diff) | |
download | FreeBSD-src-4946ded616808163421971bd6648d16bb43c1020.zip FreeBSD-src-4946ded616808163421971bd6648d16bb43c1020.tar.gz |
Modify strtofflags so that it returns a malloced string instead of a
pointer to a static buffer.
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 f287c17..10f86c9 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 . |