should no longer spell big trouble on account of the stdio
data structures possibly not being in a well-defined and
initialized state.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14893 87f5fb63-7c3d-0410-a384-fd976d0f7a62
separate files.
- Removed some more redundant data from stdlib_main.c.
- Added the first real C99 function: _Exit().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14892 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Dropped unused stub code which is now redundant because of
the constructor/destructor mechanism.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14891 87f5fb63-7c3d-0410-a384-fd976d0f7a62
to what it is supposed to do. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14888 87f5fb63-7c3d-0410-a384-fd976d0f7a62
destructor functions in any way at all. I reimplemented the
entire library constructor/destructor functionality to use the
same approach as libnix.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14887 87f5fb63-7c3d-0410-a384-fd976d0f7a62
of the original file descriptor.
- close() did not return 0 if the file descriptor in question
was really just an alias. Fixed.
- Added a feature which makes it possible to have several clients
use the standard I/O streams (stdin/stdout/stderr) and have these
referring to their process' Input()/Output()/ErrorOutput()
streams. This is intended to support the upcoming shared
library feature.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14885 87f5fb63-7c3d-0410-a384-fd976d0f7a62
that the constructors/destructors are called in the proper
order, too.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14884 87f5fb63-7c3d-0410-a384-fd976d0f7a62
setjmp(). This is now done within stdlib_main.c prior to
calling the destructor function invocation code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14883 87f5fb63-7c3d-0410-a384-fd976d0f7a62
constructor/destructor functions for initialization and cleanup
purposes.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14882 87f5fb63-7c3d-0410-a384-fd976d0f7a62
or initializes it.
- The stdlib constructor now performs the CPU/FPU compatibility test.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14879 87f5fb63-7c3d-0410-a384-fd976d0f7a62
Both the 68k and PowerPC platform now invoke them in the same order
and the 68k code uses the designated invocation priorities. The
PowerPC destructor function now sets up the exit() jmp_buf before
the destructor functions are called.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14874 87f5fb63-7c3d-0410-a384-fd976d0f7a62
invoke the library's constructor/destructor functions in a
very particular order. That way, you can use constructor/destructor
functions in your own code and not have them clash with the library's
own functions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14871 87f5fb63-7c3d-0410-a384-fd976d0f7a62
sections where they should have been in the first place.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14869 87f5fb63-7c3d-0410-a384-fd976d0f7a62
socket_data.c, dirent_data.c and stdio_data.c and into the
code that initializes them.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14868 87f5fb63-7c3d-0410-a384-fd976d0f7a62
tests and the error message display can run safely even
on plain 68000 machines. This won't work for the 32 bit small
data model, which implies 68020 code, but so there...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14866 87f5fb63-7c3d-0410-a384-fd976d0f7a62
initialization code for the stdin/stdout/stderr streams and
out of the program parameter setup.
- The current program name is now set up in the stdlib
initialization function.
- Simplified the machine test code; moved the FPU check into
the math initialization code.
- Added more safety checks to verify that file descriptor
file handles are valid.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14864 87f5fb63-7c3d-0410-a384-fd976d0f7a62
a MsgPort locally.
- The record locking semaphore code now builds a semaphore to add
before it tries to find the public one in memory. That way, the
code can spend less time in Forbid() state and, heaven forbid,
refrain from allocating memory while in that state.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14862 87f5fb63-7c3d-0410-a384-fd976d0f7a62
multiple concurrent callers to use the socket functions. Note
that this works only with the Roadshow TCP/IP stack, and the
results with other TCP/IP stacks are rather unpredictable.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14858 87f5fb63-7c3d-0410-a384-fd976d0f7a62
buffer tables so that all the memory allocations are in one
place and it's possible to specify exactly how many table
entries are required at a time.
- Creation and initialization of semaphores now uses the AmigaOS4
specific functions for this purpose, if available.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14857 87f5fb63-7c3d-0410-a384-fd976d0f7a62
into a dedicated module. This also has the advantage that it's
harder to break code by accidentally forgetting to call
InitSemaphore() after having allocated the memory for it.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14853 87f5fb63-7c3d-0410-a384-fd976d0f7a62
routine. We no longer allocate memory and then modify it, but
call a function for each quoted parameter which does whatever is
necessary.
- The shell command parameter parser now considers the non-breaking
space character (ISO code 160) to be a blank space character, too.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14851 87f5fb63-7c3d-0410-a384-fd976d0f7a62
contributed by Peter Bengtsson. Thank you very much!
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14848 87f5fb63-7c3d-0410-a384-fd976d0f7a62
absolute Amiga path names passed to it and will use them without
changing them.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14845 87f5fb63-7c3d-0410-a384-fd976d0f7a62
Both the library and the user code need to be rebuilt with the
preprocessor symbol __THREAD_SAFE defined to get thread-safe
code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14843 87f5fb63-7c3d-0410-a384-fd976d0f7a62
and dirent data operations. That should do it! While the library is
not reentrant (this is not ixemul.library) it should be thread-safe
now. Thread-safe in the sense of POSIX 1003.1c-1995.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14842 87f5fb63-7c3d-0410-a384-fd976d0f7a62
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
parameters (which is by default linked in with libunix.a),
regular expressions can no longer prompt dos.library requesters
to appear. However, to be on the safe side, if you are expecting
to pass regular expressions on the command line, do not use
the wildcard expansion code such as by overriding the library
symbols with dummy functions such as are used in the file
"stdlib_wildcard_expand.c".
- Added a new variable '__open_locale' which can be used to
restrict all library functions to use the "C" language locale
rather than the current system locale settings. In addition
to that, two new functions __locale_exit() and __locale_init()
can be used to close and (re-)open the system locale at a
later time.
- Local ("static") functions are now identified by the STATIC
qualifier. This was done in preparation for changes that will
deal with global and local data and the issue of thread safety.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14839 87f5fb63-7c3d-0410-a384-fd976d0f7a62
function pointers alone. The utility.library/CallHookPkt mechanism
is no longer required.
- Moved the entire lseek() code relevant for files into the hook
function.
- Simplified the close() function which now just calls into the
hook code to perform whatever is necessary. The hook code is
responsible for cleaning up after aliases, etc. This change in
turn made it possible to greatly simplify the hook code for
buffered files which now bypasses close/read/write/lseek and
directly invokes the hook code for unbuffered files.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14835 87f5fb63-7c3d-0410-a384-fd976d0f7a62
the file descriptor hook and into the respective functions,
such as dup2(), fchmod(), fchown(), fcntl(), fdatasync(), fstatfs(),
fsync(), ftruncate() and lseek(). Code which is not strictly
required will no longer find its way into your programs if you
link with the updated library.
NOTE: these changes require that the entire library is rebuilt!
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14833 87f5fb63-7c3d-0410-a384-fd976d0f7a62
translate patterns such as "foo/bar/../../baz" properly, and to
use strlen() less.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14831 87f5fb63-7c3d-0410-a384-fd976d0f7a62
<inttypes.h> header files contributed by Peter Bengtsson. Thank
you very much!
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14827 87f5fb63-7c3d-0410-a384-fd976d0f7a62
handler. The side-effects were too varied and irritating after all.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14826 87f5fb63-7c3d-0410-a384-fd976d0f7a62
code which initialized them.
- Reading/changing the errno variable is no longer done directly, but
involves accessor functions.
- References to the HUGE_VAL quantity now involve an accessor function, too.
- Changed the manner in which the __huge_val constant is initialized by
the __math_init() function.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14824 87f5fb63-7c3d-0410-a384-fd976d0f7a62
code. Also, the contents of the AnchorPath structure are no longer
modified between calls. MatchEnd() has to be sufficient.
- Moved redundant code out of the readdir()/opendir()/closedir()
functions which is not required unless the code is built for
Unix compatibility mode.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14823 87f5fb63-7c3d-0410-a384-fd976d0f7a62
code. Also, the contents of the AnchorPath structure are no longer
modified between calls. MatchEnd() has to be sufficient.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14822 87f5fb63-7c3d-0410-a384-fd976d0f7a62
modified unless the library is built with the "CHECK_FOR_NULL_POINTERS"
option.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14821 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Simplified the code in time_asctime_r.c which builds the time
string. It gracefully handles buffer sizes which are too short
by returning an empty string.
- Moved the tm->tm_wday initialization out of the hook function
in time_strftime.c since it was to be called only once anyway.
- Lost a few compiler warnings in unistd_time_delay.c and
time_gettimeofday.c.
- Folded duplicate code in time_mktime.c; also, errno is no longer
modified unless the library is built with the CHECK_FOR_NULL_POINTERS
option.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14818 87f5fb63-7c3d-0410-a384-fd976d0f7a62
so far as used by the the __convert_time() function and the conversion
code in strftime().
- Also changed the algorithm used by strftime() to produce the week numbers
(the '%U' and '%W' format specifiers). The new method is much simpler
than the old one.
- Made the code that converts a 'time_t' value into the 'struct DateStamp',
as used by strftime() and utime(), into its own function. This also
fixes a bug in the code strftime() would use which was completely
unaware of the local time zone settings.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14815 87f5fb63-7c3d-0410-a384-fd976d0f7a62
strftime() and asctime_r(). This one isn't sensitive to the effects of
adding/subtracting the local time zone.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14813 87f5fb63-7c3d-0410-a384-fd976d0f7a62
time, into the number of seconds since January 1st, 1970, relative to
UTC. This didn't really work up until now since the time value returned
was given as local time.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14810 87f5fb63-7c3d-0410-a384-fd976d0f7a62
function.
- The fall-back function for converting time into a string in strftime()
now calls itself for the "%x" and "%X" format specifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14809 87f5fb63-7c3d-0410-a384-fd976d0f7a62
from Workbench would open and stay open. This was not intended to
happen and is a side-effect of the new stdio initialization code which
checks if the stdio streams are in non-blocking mode. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14806 87f5fb63-7c3d-0410-a384-fd976d0f7a62