diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-23 03:19:32 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-23 03:19:32 +0000 |
| commit | 71c1f8a3e7f3d681360874de732257b62a800798 (patch) | |
| tree | b817f80c37547f98c21282bcf6996c609ebe66fe /libc/stdio/_stdio.h | |
| parent | aa39b0b2f79973652cbe219eaf580dd02bfb6670 (diff) | |
| download | uClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.bz2 uClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.xz | |
Bring in remaining futex support for stdio.
Diffstat (limited to 'libc/stdio/_stdio.h')
| -rw-r--r-- | libc/stdio/_stdio.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 83d43352b..d4456b4a7 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -20,15 +20,19 @@ #include <wchar.h> #endif -libc_hidden_proto(stdin) -libc_hidden_proto(stdout) - -libc_hidden_proto(_stdio_openlist) - #ifdef __UCLIBC_HAS_THREADS__ #include <pthread.h> -libc_hidden_proto(_stdio_openlist_lock) +#ifdef __USE_STDIO_FUTEXES___ +#define __STDIO_THREADLOCK_OPENLIST \ + _IO_lock_lock(_stdio_openlist_lock) + +#define __STDIO_THREADUNLOCK_OPENLIST \ + _IO_lock_unlock(_stdio_openlist_lock) + +#define __STDIO_THREADTRYLOCK_OPENLIST \ + _IO_lock_trylock(_stdio_openlist_lock) +#else #define __STDIO_THREADLOCK_OPENLIST \ __pthread_mutex_lock(&_stdio_openlist_lock) @@ -37,6 +41,7 @@ libc_hidden_proto(_stdio_openlist_lock) #define __STDIO_THREADTRYLOCK_OPENLIST \ __pthread_mutex_trylock(&_stdio_openlist_lock) +#endif #else @@ -86,10 +91,10 @@ extern int __stdio_seek(FILE *stream, register __offmax_t *pos, int whence) attr (read((STREAMPTR)->__filedes,(BUF),(SIZE))) #define __WRITE(STREAMPTR,BUF,SIZE) \ (write((STREAMPTR)->__filedes,(BUF),(SIZE))) -#define __SEEK(STREAMPTR,PPOS,WHENCE) \ - (__stdio_seek((STREAMPTR),(PPOS),(WHENCE))) #define __CLOSE(STREAMPTR) \ (close((STREAMPTR)->__filedes)) +#define __SEEK(STREAMPTR,PPOS,WHENCE) \ + (__stdio_seek((STREAMPTR),(PPOS),(WHENCE))) #endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */ |
