Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen Sort sections. Fix typo. Fix xref. Improve word...



details:   https://anonhg.NetBSD.org/src/rev/94b7f5e78623
branches:  trunk
changeset: 754928:94b7f5e78623
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun May 16 11:37:06 2010 +0000

description:
Sort sections. Fix typo. Fix xref. Improve wording in one case.

diffstat:

 lib/libc/gen/directory.3 |  47 ++++++++++++++++++++++++-----------------------
 1 files changed, 24 insertions(+), 23 deletions(-)

diffs (90 lines):

diff -r b013fc1c1ed5 -r 94b7f5e78623 lib/libc/gen/directory.3
--- a/lib/libc/gen/directory.3  Sun May 16 11:27:49 2010 +0000
+++ b/lib/libc/gen/directory.3  Sun May 16 11:37:06 2010 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: directory.3,v 1.31 2010/05/16 08:01:14 jruoho Exp $
+.\"    $NetBSD: directory.3,v 1.32 2010/05/16 11:37:06 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -89,7 +89,8 @@
 The directory stream is positioned at the first entry.
 Upon successful completion, a pointer to
 .Vt DIR
-type is returned. Otherwise,
+type is returned.
+Otherwise,
 .Fn opendir
 returns
 .Dv NULL .
@@ -254,16 +255,34 @@
 .Fn dirfd
 is to provide a mechanism by which a file descriptor
 can be obtained for the use of the
-.Xr fchdir 3
+.Xr fchdir 2
 function.
 .El
 .Pp
 .\"
-.\" XXX: The returned errors should be enumrated.
+.\" XXX: The returned errors should be enumerated.
 .\"
 All described functions that return a value may set
 .Vt errno
 to indicate the error.
+.Sh EXAMPLES
+Sample code which searches a directory for entry
+.Dq name
+is:
+.Bd -literal -offset indent
+len = strlen(name);
+dirp = opendir(".");
+if (dirp != NULL) {
+       while ((dp = readdir(dirp)) != NULL)
+               if (dp-\*[Gt]d_namlen == len \*[Am]\*[Am]
+                   !strcmp(dp-\*[Gt]d_name, name)) {
+                       (void)closedir(dirp);
+                       return (FOUND);
+               }
+       (void)closedir(dirp);
+}
+return (NOT_FOUND);
+.Ed
 .Sh COMPATIBILITY
 The described directory operations have traditionally been problematic
 in terms of portability.
@@ -345,24 +364,6 @@
 However, if both the parent and child processes use these functions,
 the result is undefined.
 .El
-.Sh EXAMPLES
-Sample code which searches a directory for entry
-.Dq name
-is:
-.Bd -literal -offset indent
-len = strlen(name);
-dirp = opendir(".");
-if (dirp != NULL) {
-       while ((dp = readdir(dirp)) != NULL)
-               if (dp-\*[Gt]d_namlen == len \*[Am]\*[Am]
-                   !strcmp(dp-\*[Gt]d_name, name)) {
-                       (void)closedir(dirp);
-                       return (FOUND);
-               }
-       (void)closedir(dirp);
-}
-return (NOT_FOUND);
-.Ed
 .Sh SEE ALSO
 .Xr close 2 ,
 .Xr lseek 2 ,
@@ -378,7 +379,7 @@
 .Fn closedir
 functions conform to
 .St -p1003.1-90 .
-Rest of the functions conform to
+The other functions conform to
 .St -p1003.1-2008 .
 .Sh HISTORY
 The



Home | Main Index | Thread Index | Old Index