From 3db40db7d83ca924a935680b1c210dd11f1f660d Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 3 Sep 2002 19:40:36 +0000 Subject: 2002-09-03 Jeff Johnston * 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 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 . --- newlib/libc/stdio/findfp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'newlib/libc/stdio/findfp.c') diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index a42a69206..4f1387ccb 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "local.h" static void @@ -45,6 +46,9 @@ std (ptr, flags, file, data) ptr->_seek = __sseek; ptr->_close = __sclose; ptr->_data = data; +#ifndef __SINGLE_THREAD__ + __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&ptr->_lock); +#endif #ifdef __SCLE if (__stextmode(ptr->_file)) -- cgit v1.2.3