summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/scandir.3
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-01-04 15:40:17 +0000
committerkib <kib@FreeBSD.org>2010-01-04 15:40:17 +0000
commitd061de008ac2d14466eefecb47b69b59e5e79408 (patch)
treeb365b59af8b0b68bad0041e490012bdb8c25eace /lib/libc/gen/scandir.3
parent16db58ba54bd23cade57dc720cf9bd57f5487f3e (diff)
downloadFreeBSD-src-d061de008ac2d14466eefecb47b69b59e5e79408.zip
FreeBSD-src-d061de008ac2d14466eefecb47b69b59e5e79408.tar.gz
Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks
Diffstat (limited to 'lib/libc/gen/scandir.3')
-rw-r--r--lib/libc/gen/scandir.37
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3
index 42ccac2..5e177b9 100644
--- a/lib/libc/gen/scandir.3
+++ b/lib/libc/gen/scandir.3
@@ -28,7 +28,7 @@
.\" @(#)scandir.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd January 3, 2010
.Dt SCANDIR 3
.Os
.Sh NAME
@@ -38,12 +38,11 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In sys/types.h
.In dirent.h
.Ft int
-.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpstruct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst void *, const void *\\*(rp"
+.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpconst struct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst struct dirent **, const struct dirent **\\*(rp"
.Ft int
-.Fn alphasort "const void *d1" "const void *d2"
+.Fn alphasort "const struct dirent **d1" "const struct dirent **d2"
.Sh DESCRIPTION
The
.Fn scandir
OpenPOWER on IntegriCloud