mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added stdio thread locking functions flockfile(), funlockfile(),
and ftrylockfile(). - Modified the internal FILE structure to allow for thread locking. Note that this again requires that the library is rebuilt! - Added or modified macros for getc_unlocked(), getchar_unlocked(), putc_unlocked() and putchar_unlocked(). - Added rand_r(). - Added flockfile()/funlockfile() wrappers around all stdio functions. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14841 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_setvbuf.c,v 1.5 2005-02-21 10:22:00 obarthel Exp $
|
||||
* $Id: stdio_setvbuf.c,v 1.6 2005-02-27 18:09:11 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -65,6 +65,11 @@ setvbuf(FILE *stream,char *buf,int bufmode,size_t size)
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
if(__check_abort_enabled)
|
||||
__check_abort();
|
||||
|
||||
flockfile(stream);
|
||||
|
||||
#if defined(CHECK_FOR_NULL_POINTERS)
|
||||
{
|
||||
if(stream == NULL)
|
||||
@ -77,9 +82,6 @@ setvbuf(FILE *stream,char *buf,int bufmode,size_t size)
|
||||
}
|
||||
#endif /* CHECK_FOR_NULL_POINTERS */
|
||||
|
||||
if(__check_abort_enabled)
|
||||
__check_abort();
|
||||
|
||||
if(bufmode < IOBF_BUFFER_MODE_FULL ||
|
||||
bufmode > IOBF_BUFFER_MODE_NONE)
|
||||
{
|
||||
@ -188,6 +190,8 @@ setvbuf(FILE *stream,char *buf,int bufmode,size_t size)
|
||||
|
||||
out:
|
||||
|
||||
funlockfile(stream);
|
||||
|
||||
if(new_buffer != NULL)
|
||||
free(new_buffer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user