summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fopen.3
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-10-18 14:33:37 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-10-18 14:33:37 +0000
commita01ca97d4f820ce27b9028f60239ad71108a9915 (patch)
treee3889900220fbc6baa58bbe8ceec6f8403a27e1e /lib/libc/stdio/fopen.3
parent9cf461f1e2346fc70db13df4309e108f65671819 (diff)
fdopen(3) takes two args, not one; spotted by fries@. Also, move the CAVEATS
section to the end like most man pages.
Diffstat (limited to 'lib/libc/stdio/fopen.3')
-rw-r--r--lib/libc/stdio/fopen.340
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/libc/stdio/fopen.3 b/lib/libc/stdio/fopen.3
index 8bfa9ae25fe..232419f4363 100644
--- a/lib/libc/stdio/fopen.3
+++ b/lib/libc/stdio/fopen.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fopen.3,v 1.9 2000/04/20 01:39:31 aaron Exp $
+.\" $OpenBSD: fopen.3,v 1.10 2000/10/18 14:33:36 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -221,6 +221,24 @@ for any of the errors specified for the routines
.Xr fclose 3
and
.Xr fflush 3 .
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr fclose 3 ,
+.Xr fseek 3 ,
+.Xr funopen 3
+.Sh STANDARDS
+The
+.Fn fopen
+and
+.Fn freopen
+functions
+conform to
+.St -ansiC .
+The
+.Fn fdopen
+function
+conforms to
+.St -p1003.1-88 .
.Sh CAVEATS
Proper code using
.Fn fdopen
@@ -234,7 +252,7 @@ the resulting FILE * in case of success.
FILE *file;
int fd;
- if ((file = fdopen(fd)) != NULL) {
+ if ((file = fdopen(fd, "r")) != NULL) {
/* perform operations on the FILE * */
fclose(file);
} else {
@@ -242,21 +260,3 @@ the resulting FILE * in case of success.
close(fd);
}
.Ed
-.Sh SEE ALSO
-.Xr open 2 ,
-.Xr fclose 3 ,
-.Xr fseek 3 ,
-.Xr funopen 3
-.Sh STANDARDS
-The
-.Fn fopen
-and
-.Fn freopen
-functions
-conform to
-.St -ansiC .
-The
-.Fn fdopen
-function
-conforms to
-.St -p1003.1-88 .