summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>1998-11-20 14:44:14 +0000
committerkleink <kleink@NetBSD.org>1998-11-20 14:44:14 +0000
commit71f322346862db3daa8b79edd7e5bb84fa6161a1 (patch)
tree19003cdd534b85c3213406e13f772ad821584261 /lib/libc/stdio
parent048353ddfd01962e0935306c4ebb79958aeec62d (diff)
Deploy stdio stream locking.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/feof.c12
-rw-r--r--lib/libc/stdio/ferror.c12
-rw-r--r--lib/libc/stdio/fileno.c12
3 files changed, 27 insertions, 9 deletions
diff --git a/lib/libc/stdio/feof.c b/lib/libc/stdio/feof.c
index 61205db2ad3..dcc14cc684c 100644
--- a/lib/libc/stdio/feof.c
+++ b/lib/libc/stdio/feof.c
@@ -1,4 +1,4 @@
-/* $NetBSD: feof.c,v 1.6 1997/07/13 20:14:51 christos Exp $ */
+/* $NetBSD: feof.c,v 1.7 1998/11/20 14:44:14 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -41,11 +41,12 @@
#if 0
static char sccsid[] = "@(#)feof.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: feof.c,v 1.6 1997/07/13 20:14:51 christos Exp $");
+__RCSID("$NetBSD: feof.c,v 1.7 1998/11/20 14:44:14 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+#include "reentrant.h"
/*
* A subroutine version of the macro feof.
@@ -56,5 +57,10 @@ int
feof(fp)
FILE *fp;
{
- return (__sfeof(fp));
+ int r;
+
+ FLOCKFILE(fp);
+ r = __sfeof(fp);
+ FUNLOCKFILE(fp);
+ return r;
}
diff --git a/lib/libc/stdio/ferror.c b/lib/libc/stdio/ferror.c
index 3cae74fb0a5..104efb4e174 100644
--- a/lib/libc/stdio/ferror.c
+++ b/lib/libc/stdio/ferror.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ferror.c,v 1.6 1997/07/13 20:14:52 christos Exp $ */
+/* $NetBSD: ferror.c,v 1.7 1998/11/20 14:44:14 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -41,11 +41,12 @@
#if 0
static char sccsid[] = "@(#)ferror.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: ferror.c,v 1.6 1997/07/13 20:14:52 christos Exp $");
+__RCSID("$NetBSD: ferror.c,v 1.7 1998/11/20 14:44:14 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+#include "reentrant.h"
/*
* A subroutine version of the macro ferror.
@@ -56,5 +57,10 @@ int
ferror(fp)
FILE *fp;
{
- return (__sferror(fp));
+ int r;
+
+ FLOCKFILE(fp);
+ r = __sferror(fp);
+ FUNLOCKFILE(fp);
+ return r;
}
diff --git a/lib/libc/stdio/fileno.c b/lib/libc/stdio/fileno.c
index 444784369b9..f6330e050cf 100644
--- a/lib/libc/stdio/fileno.c
+++ b/lib/libc/stdio/fileno.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fileno.c,v 1.6 1997/07/13 20:14:56 christos Exp $ */
+/* $NetBSD: fileno.c,v 1.7 1998/11/20 14:44:14 kleink Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -41,11 +41,12 @@
#if 0
static char sccsid[] = "@(#)fileno.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: fileno.c,v 1.6 1997/07/13 20:14:56 christos Exp $");
+__RCSID("$NetBSD: fileno.c,v 1.7 1998/11/20 14:44:14 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+#include "reentrant.h"
/*
* A subroutine version of the macro fileno.
@@ -56,5 +57,10 @@ int
fileno(fp)
FILE *fp;
{
- return (__sfileno(fp));
+ int r;
+
+ FLOCKFILE(fp);
+ r = __sfileno(fp);
+ FUNLOCKFILE(fp);
+ return r;
}