Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdio Note that callers should use feof(3) or ferro...



details:   https://anonhg.NetBSD.org/src/rev/825d24e94119
branches:  trunk
changeset: 749486:825d24e94119
user:      roy <roy%NetBSD.org@localhost>
date:      Mon Nov 30 23:23:29 2009 +0000

description:
Note that callers should use feof(3) or ferror(3) to distinguish between
EOF or an error.

diffstat:

 lib/libc/stdio/getdelim.3 |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 52d8979d6c82 -r 825d24e94119 lib/libc/stdio/getdelim.3
--- a/lib/libc/stdio/getdelim.3 Mon Nov 30 22:51:46 2009 +0000
+++ b/lib/libc/stdio/getdelim.3 Mon Nov 30 23:23:29 2009 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: getdelim.3,v 1.4 2009/11/30 22:51:46 roy Exp $
+.\"     $NetBSD: getdelim.3,v 1.5 2009/11/30 23:23:29 roy Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -91,6 +91,13 @@
 If an error occurs, the functions return \-1 and the global variable
 .Va errno
 is set to indicate the error.
+.Pp
+The functions do not distinguish between end-of-file and error,
+and callers must use
+.Xr feof 3
+and
+.Xr ferror 3
+to determine which occurred.
 .Sh EXAMPLE
 The following code fragment reads lines from a file and writes them to
 standard output.



Home | Main Index | Thread Index | Old Index