summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio64/fopen64.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-09-03 19:40:36 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-09-03 19:40:36 +0000
commit3db40db7d83ca924a935680b1c210dd11f1f660d (patch)
tree23107e83a2372c0eac6bc5831e818d07679240ff /newlib/libc/stdio64/fopen64.c
parent20fb0cc51373af49a4f89759ceb16c5933dfb989 (diff)
downloadcygnal-3db40db7d83ca924a935680b1c210dd11f1f660d.tar.gz
cygnal-3db40db7d83ca924a935680b1c210dd11f1f660d.tar.bz2
cygnal-3db40db7d83ca924a935680b1c210dd11f1f660d.zip
2002-09-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/_types.h (_flock_t): Added. * libc/include/sys/lock.h (__lock_try_acquire): New interface. (__lock_try_acquire_recursive): Ditto. * libc/include/sys/reent.h (__sFILE, __sFILE64): Add new _lock field. * libc/stdio/findfp.c (std)[!__SINGLE_THREAD__]: Initialize _lock field. * libc/stdio/fopen.c (_fopen_r)[!__SINGLE_THREAD__]: Ditto. * libc/stdio64/fopen64.c (_fopen64_r)[!__SINGLE_THREAD__]: Ditto. * libc/sys/linux/include/time.h (struct timespec): Moved from <sys/types.h> and added check for __need_timespec flag so type can be defined by itself. * libc/sys/linux/sys/_types.h (_flock_t): New type. * libc/sys/linux/sys/types.h (struct timespec): Moved to <time.h>.
Diffstat (limited to 'newlib/libc/stdio64/fopen64.c')
-rw-r--r--newlib/libc/stdio64/fopen64.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c
index 1eb89874e..d2ab74c35 100644
--- a/newlib/libc/stdio64/fopen64.c
+++ b/newlib/libc/stdio64/fopen64.c
@@ -70,6 +70,7 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#ifdef __CYGWIN__
#include <fcntl.h>
#endif
+#include <sys/lock.h>
#ifdef __LARGE64_FILES
@@ -113,6 +114,10 @@ _DEFUN (_fopen64_r, (ptr, file, mode),
fp->_flags |= __SL64;
+#ifndef __SINGLE_THREAD__
+ __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock);
+#endif
+
return fp;
}