Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-09-03 23:40:36 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-09-03 23:40:36 +0400
commit3db40db7d83ca924a935680b1c210dd11f1f660d (patch)
tree23107e83a2372c0eac6bc5831e818d07679240ff /newlib/libc/include
parent20fb0cc51373af49a4f89759ceb16c5933dfb989 (diff)
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/include')
-rw-r--r--newlib/libc/include/sys/_types.h2
-rw-r--r--newlib/libc/include/sys/lock.h2
-rw-r--r--newlib/libc/include/sys/reent.h11
3 files changed, 14 insertions, 1 deletions
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 9f3b05b39..c47a6adac 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -43,4 +43,6 @@ typedef _mbstate_t mbstate_t;
# define WEOF (0xffffffffu)
#endif /* __CYGWIN__ */
+typedef int _flock_t;
+
#endif /* _SYS__TYPES_H */
diff --git a/newlib/libc/include/sys/lock.h b/newlib/libc/include/sys/lock.h
index efdd7316f..984bc5f80 100644
--- a/newlib/libc/include/sys/lock.h
+++ b/newlib/libc/include/sys/lock.h
@@ -14,6 +14,8 @@ typedef int _LOCK_RECURSIVE_T;
#define __lock_close_recursive(lock) {}
#define __lock_acquire(lock) {}
#define __lock_acquire_recursive(lock) {}
+#define __lock_try_acquire(lock) {}
+#define __lock_try_acquire_recursive(lock) {}
#define __lock_release(lock) {}
#define __lock_release_recursive(lock) {}
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index ebdf32a8e..09160a9fc 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -192,7 +192,11 @@ struct __sFILE {
int _offset; /* current lseek offset */
#ifndef _REENT_SMALL
- struct _reent *_data; /* Here for binary compatibility? Remove? */
+ struct _reent *_data; /* Here for binary compatibility? Remove? */
+#endif
+
+#ifndef __SINGLE_THREAD__
+ _flock_t _lock; /* for thread-safety locking */
#endif
};
@@ -232,8 +236,13 @@ struct __sFILE64 {
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
int _flags2; /* for future use */
+
_off64_t _offset; /* current lseek offset */
_fpos64_t _EXFUN((*_seek64),(_PTR _cookie, _fpos64_t _offset, int _whence));
+
+#ifndef __SINGLE_THREAD__
+ _flock_t _lock; /* for thread-safety locking */
+#endif
};
typedef struct __sFILE64 __FILE;
#else