1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- The thread-safe system() call now blocks all standard I/O operations

until the function has returned. Which is harsh, but there is no
  elegant solution to the issue of keeping the same dos.library
  file handles from concurrent use which SystemTagList() might just
  end up using.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14898 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-24 15:31:16 +00:00
parent 5695784272
commit a6daababe7
4 changed files with 33 additions and 15 deletions

View File

@ -106,7 +106,7 @@
- Removed some more redundant data from stdlib_main.c.
- Added the first real C99 function: _Exit().
- Added the first "real" C99 function: _Exit() ;-)
- assertion failures early on during program initialization
should no longer spell big trouble on account of the stdio
@ -118,12 +118,23 @@
it *again*. Which probably means that the 68k library will
need further changes...
- Moved stdlib_main.o into the regular lib.c, at least for
- Moved stdlib_main.o into the regular libc.a, at least for
the 68k build. The PowerPC build may follow later, provided
I manage to get the specs file fixed.
I manage to get the specs file fixed. Actually, stdlib_main.o
is in the libc.a library already. Now about that specs file...
- Moved the check for the presence of an FPU into the
math_init.c code.
math_init.c code. I am far from certain whether this will
have the desired effect, though. Due to how the GNU ld linker
works, libraries are scanned once only. And the FPU check will
be pulled in only if something references the HUGE_VAL
constant.
- The thread-safe system() call now blocks all standard I/O operations
until the function has returned. Which is harsh, but there is no
elegant solution to the issue of keeping the same dos.library
file handles from concurrent use which SystemTagList() might just
end up using.
c.lib 1.189 (5.3.2005)

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fprintf.c,v 1.4 2005-02-27 18:09:10 obarthel Exp $
* $Id: stdio_fprintf.c,v 1.5 2005-03-24 15:31:16 obarthel Exp $
*
* :ts=4
*
@ -59,8 +59,6 @@ fprintf(FILE *stream,const char *format,...)
if(__check_abort_enabled)
__check_abort();
flockfile(stream);
#if defined(CHECK_FOR_NULL_POINTERS)
{
if(stream == NULL || format == NULL)
@ -77,8 +75,6 @@ fprintf(FILE *stream,const char *format,...)
out:
funlockfile(stream);
RETURN(result);
return(result);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fscanf.c,v 1.4 2005-02-27 18:09:10 obarthel Exp $
* $Id: stdio_fscanf.c,v 1.5 2005-03-24 15:31:16 obarthel Exp $
*
* :ts=4
*
@ -59,8 +59,6 @@ fscanf(FILE *stream, const char *format, ...)
if(__check_abort_enabled)
__check_abort();
flockfile(stream);
#if defined(CHECK_FOR_NULL_POINTERS)
{
if(stream == NULL || format == NULL)
@ -79,8 +77,6 @@ fscanf(FILE *stream, const char *format, ...)
out:
funlockfile(stream);
RETURN(result);
return(result);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_system.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* $Id: stdlib_system.c,v 1.6 2005-03-24 15:31:16 obarthel Exp $
*
* :ts=4
*
@ -35,6 +35,10 @@
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
#ifndef _STIO_HEADERS_H
#include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */
/****************************************************************************/
#ifndef _STDLIB_MEMORY_H
@ -172,7 +176,18 @@ system(const char * command)
SHOWSTRING(command);
PROFILE_OFF();
/* In thread-safe mode, system() operation can interfere with
regular file I/O if the same dos.library file handles are
involved. Because we really cannot predict which file handles
will be associated with the current Output() and Input()
streams, we play it safe and just block everything. */
__stdio_lock();
result = SystemTagList((STRPTR)command, (struct TagItem *)system_tags);
__stdio_unlock();
PROFILE_ON();
}