longer part of "stdlib_main.c". This helps the C++ support, since the
__main symbol definition no longer clashes with the definition in
"libgcc.a".
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15076 87f5fb63-7c3d-0410-a384-fd976d0f7a62
counters for "maximum amount of memory used" and "maximum number of chunks
allocated" to the current figures for these values.
- Fixed the alloca() declaration in <stdlib.h> so that software which keys
off the fact whether or not the alloca preprocessor symbol is defined
will do the right thing.
- Added an optional call-back function which can be called if alloca()
is about to return NULL, which some software does not consider.
Rather than letting such software drop into an illegal memory access
or worse, that call-back function will be invoked instead, which can
print an error message and eventually call abort().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15073 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- You can now request that your program uses the clib2 alloca() function
rather than the built-in compiler alloca().
- alloca() is now part of libunix.a, too.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15072 87f5fb63-7c3d-0410-a384-fd976d0f7a62
request to allocate 0 bytes as an error, returning NULL. They all
return a pointer sized memory chunk (= four bytes) initialized to
NULL (= 0) instead.
- The alloca() implementation which allocates memory from the system
rather than the local stack frame is thread-safe now. It also
interacts with the realloc(), calloc(), free() and malloc() functions
in that the alloca() cleanup routine is called once alloca() has
done its job. If all the memory allocated through alloca() has been
released no further calls to the cleanup function will be made.
- In the thread-safe library, realloc() permitted two different overlapping
calls to succeed in trying to reallocate the same chunk of memory due to
a race condition. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15070 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The malloc() in libunix.a now allocates four bytes of memory instead
of just one for a request to allocate 0 bytes.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15069 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The standard malloc() now sets errno to EINVAL for zero length
allocations.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15066 87f5fb63-7c3d-0410-a384-fd976d0f7a62
behaviour of the library functions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15065 87f5fb63-7c3d-0410-a384-fd976d0f7a62
request to allocate 0 bytes as an error, returning NULL. They all
return a 1 byte memory chunk initialized to 0 instead.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15064 87f5fb63-7c3d-0410-a384-fd976d0f7a62
feclearexcept(), fegetenv(), fegetexceptflag(), fegetround(),
feholdexcept(), feraiseexcept(), fesetenv(), fesetexceptflag(),
fetestexcept(), fetestround() and feupdateenv().
- Replaced the old pow() implementation. However, powf() may need to
be changed to set a domain error.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15062 87f5fb63-7c3d-0410-a384-fd976d0f7a62
the case of negative socket IDs.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15061 87f5fb63-7c3d-0410-a384-fd976d0f7a62
CVS subdirectories in the "include" directory.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15058 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The cross compiler GNUmakefile.os4 variant now also logs all warnings
and errors to a compiler.log file.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15055 87f5fb63-7c3d-0410-a384-fd976d0f7a62
better. Note that this is not yet entirely succesful.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15054 87f5fb63-7c3d-0410-a384-fd976d0f7a62
bsdsocket.library API function to determine if what appears to be
a valid daemon startup message is sound.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15052 87f5fb63-7c3d-0410-a384-fd976d0f7a62
socket into a separate function which can be overridden by user code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15051 87f5fb63-7c3d-0410-a384-fd976d0f7a62
daemon startup message by default. You now have to enable this feature
by declaring a global variable called "__check_daemon_startup" which is
described in <dos.h>.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15050 87f5fb63-7c3d-0410-a384-fd976d0f7a62
"__bool_true_false_are_defined" rather than "__bool_true_and_false_are_defined".
Thanks go to Peter Bengtsson for finding and fixing it.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15049 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The thread-safe library now tries to enable bsdsocket.library base
sharing and attempts to make the TCP/IP stack call the local
__set_errno() and __set_h_errno(), so that any Process calling
the library functions will get a chance to see proper error
codes. Whether any of these features could be enabled can be tested
through two global variables __can_share_socket_library_base and
__thread_safe_errno_h_errno which are defined in <dos.h>. Note that
for both features to work you will need the Roadshow bsdsocket.library
version 4.275 or higher.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15048 87f5fb63-7c3d-0410-a384-fd976d0f7a62
file but were still unimplemented up until now.
- Replaced ldexp() and modf().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15045 87f5fb63-7c3d-0410-a384-fd976d0f7a62
fdlibm which uses macros for manipulating the high and low words of a
double, like the rest of fdlibm functions in clib2. The previous version
would give bogus results when compiled with -O3 in clib2 which lead to
"interesting" results (and lots of fun while searching for the problem)
in Ghostscript. Wish I managed to track this down yesterday for 1.196
release... <aantonijevic>
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15043 87f5fb63-7c3d-0410-a384-fd976d0f7a62
stdio data is still locked.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15037 87f5fb63-7c3d-0410-a384-fd976d0f7a62
for building code that references the networking API. It is now possible,
provided you build your code with an existing TCP/IP API header file
set (such as from the "Roadshow" SDK) without running into data type
or function prototype declaration conflicts. I have added local versions
of <arpa/inet.h>, <netinet/in.h>, <netdb.h>, <sys/filio.h>, <sys/ioccom.h>,
<sys/ioctl.h>, <sys/select.h> and <sys/socket.h> and updated <unistd.h>,
<pwd.h> and <grp.h> accordingly. Note that some of the function prototypes
will conflict with the bsdsocket.library/usergroup.library API, which is
why you can disable the declarations through the __NO_NET_API preprocessor
symbol: if defined, none of the function prototypes will be defined.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15036 87f5fb63-7c3d-0410-a384-fd976d0f7a62
nearbyint(), remquof(), remquo(), roundf(), round(), tgammaf(),
tgamma(), truncf(), trunc(). Sort of implemented fmaf() and fma(),
which really ought to be done in "SIMD" fashion.
This completes the "real" floating point math library (ignoring
for a moment that the floating point environment code is still
not implemented).
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15035 87f5fb63-7c3d-0410-a384-fd976d0f7a62
and then hooks up the socket with the clib2 data structures. This
makes it possible to have several Processes calling the accept()
stub at the same time.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15033 87f5fb63-7c3d-0410-a384-fd976d0f7a62
calling exit(), the IoErr() value set at this time will now be
preserved until the program really returns control to the shell.
This turned out to be easier to implement than I had originally
thought, thanks to the fact that the atexit() functions are all
invoked straight after the exit() call.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15032 87f5fb63-7c3d-0410-a384-fd976d0f7a62
strtoul() and strtoull() now count how many digits were converted.
If that number is zero, then the conversion is considered to have
failed: 0 is returned, errno is set to ERANGE and the 'ptr' parameter
reference is initialized with a pointer to the string to be converted.
This has two consequences:
1) A floating point number that has no digits in the significand
is no longer converted to zero. For example ".e10" can no longer
result in a successful conversion.
2) You can detect if a conversion is successful by comparing pointers
after the conversion function has returned:
char * str;
char * ptr;
long n;
n = strtol(str,&ptr,10);
if(n == 0 && str == ptr)
printf("conversion has failed");
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15030 87f5fb63-7c3d-0410-a384-fd976d0f7a62
TMP_MAX value was off by one.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15029 87f5fb63-7c3d-0410-a384-fd976d0f7a62
called _exit(). It should have called exit() instead.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15028 87f5fb63-7c3d-0410-a384-fd976d0f7a62