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
the OS4 header files, but not of the older header file distributions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14804 87f5fb63-7c3d-0410-a384-fd976d0f7a62
have. This only worked for files which were closed anyway, but not
for the stdio streams. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14803 87f5fb63-7c3d-0410-a384-fd976d0f7a62
is now determined at initialization time. The I/O mode is restored before
the program exits. Previously, any changes to the I/O mode would persist.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14801 87f5fb63-7c3d-0410-a384-fd976d0f7a62
out whether read/write accesses are permitted. This decision is now
for the file system to make.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14799 87f5fb63-7c3d-0410-a384-fd976d0f7a62
version of the library.
- Switched over the last use of DeviceProc() to GetDeviceProc(), etc.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14798 87f5fb63-7c3d-0410-a384-fd976d0f7a62
tracks whether or not console output is possible. We now use the
global "__no_standard_io" instead.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14794 87f5fb63-7c3d-0410-a384-fd976d0f7a62
function. Now this could have been big trouble...
- Removed tests for FileHandle->fh_Type != NULL which used to precede
all IsInterative() tests. I verified that IsInteractive() will always
return FALSE for NIL: type file handles.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14793 87f5fb63-7c3d-0410-a384-fd976d0f7a62
compiler settings, which can either default to an unsigned or
signed definition.
- Changed the rules again for the use of stderr/stdout redirection when
printing error messages. It is always safe to redirect them now and
no requester will appear unless you specifically set the value of the
"__no_standard_io" variable to TRUE in your program.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14792 87f5fb63-7c3d-0410-a384-fd976d0f7a62
messages and assertion failure notifications as requesters. The exception
is in redirecting stderr to NIL: which will prompt the requester use.
- gettimeofday() now calls GetSysTime() rather than DateStamp() to obtain
the current system time. This resolves granularity issues since the
DateStamp() result was only accurate by 1/50 of a second.
- The "ptrdiff_t" definition in <stddef.h> now defaults to type 'int' rather
than 'long int'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14791 87f5fb63-7c3d-0410-a384-fd976d0f7a62
exception are "interactive" files such as console windows. For these
line buffered output is used.
- Whether or not a file is bound to an interactive device, such as a
console window, is now checked and remembered after a file descriptor
has been associated with it.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14788 87f5fb63-7c3d-0410-a384-fd976d0f7a62
at compile time. The default used to be 16 bytes, which is appropriate
for the 68040/68060 but not for the PowerPC, which uses 32 or 128
bytes per cache line.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14787 87f5fb63-7c3d-0410-a384-fd976d0f7a62
to the built-in function.
- Updated the stdio.h, stdlib.h, string.h and unistd.h header files
to declare function prototypes for the __MEM_DEBUG versions of the
library functions only if that preprocessor symbol is defined.
- If a SIGINT signal is caught and processed by the default signal
handler, the localized "*** BREAK" string will be printed rather
than the built-in one.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14786 87f5fb63-7c3d-0410-a384-fd976d0f7a62
management code in the default link library along with the
normal versions. Let's see how well this works out in the GCC
version. SAS/C does not seem to like it...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14785 87f5fb63-7c3d-0410-a384-fd976d0f7a62
malloc/free code itself and updated the alloca code to do its
own data management.
- Finally optimized the alloca() memory cleanup code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14784 87f5fb63-7c3d-0410-a384-fd976d0f7a62
hits if the program was not launched from Shell. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14783 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Fixed a typo in the hstrerror() function.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14782 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Added asctime_r(), ctime_r(), gmtime_r(), localtime_r() and strtok_r().
- Added stubs for the Rexx Variables Interface code that used to
be part of amiga.lib. While comparable functionality is available
in rexxsyslib.library V45, the new stubs might be helpful during
porting. Care must be taken since these functions don't work
exactly like the originals.
- Integrated strlcpy() and strlcat() which are intended to be safer
replacements for strncpy() and strncat().
- The program's task priority is now configurable through an external
variable '__priority'.
- The process name to be used when detaching can be configured through
the new '__process_name' variable.
- The minimum required operating system version can be configured
through the new '__minimum_os_lib_version' variable; a matching
error message can be provided through the new '__minimum_os_lib_error'
variable.
- The default console window specification can be overriden through
the new '__stdio_window_specification' variable.
- The socket initialization code did not set up a reference to the
'h_errno' variable correctly. This had the effect of making name
and address resolution errors trash the 'errno' variable instead
and leaving 'h_errno' always set to 0. Fixed.
- For sockets, ioctl() and fcntl() now interact on the FIONBIO/FIOASYNC
requests (ioctl) and the O_NOBLOCK/O_ASYNC flags (fcntl).
- popen() now accepts "rb" and "wb" as mode parameters. However, "r+",
"w+" and variants thereof are still unsupported due to the
unidirectional pipe support in the standard "PIPE:" device.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14777 87f5fb63-7c3d-0410-a384-fd976d0f7a62
"w+" and variants thereof are still unsupported due to the
unidirectional pipe support in the standard "PIPE:" device.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14776 87f5fb63-7c3d-0410-a384-fd976d0f7a62
requests (ioctl) and the O_NOBLOCK/O_ASYNC flags (fcntl).
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14775 87f5fb63-7c3d-0410-a384-fd976d0f7a62
be part of amiga.lib. While comparable functionality is available
in rexxsyslib.library V45, the new stubs might be helpful during
porting. Care must be taken since these functions don't work
exactly like the originals.
- Integrated strlcpy() and strlcat() which are intended to be safer
replacements for strncpy() and strncat().
- The program's task priority is now configurable through an external
variable '__priority'.
- The process name to be used when detaching can be configured through
the new '__process_name' variable.
- The minimum required operating system version can be configured
through the new '__minimum_os_lib_version' variable; a matching
error message can be provided through the new '__minimum_os_lib_error'
variable.
- The default console window specification can be overriden through
the new '__stdio_window_specification' variable.
- The socket initialization code did not set up a reference to the
'h_errno' variable correctly. This had the effect of making name
and address resolution errors trash the 'errno' variable instead
and leaving 'h_errno' always set to 0. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14771 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Cleaned up the OS4 build makefile, losing redundant libraries,
adding more startup object code and ultimatively making the whole
rebuild logic work again: if code changes and dependencies are
set up correctly, it will now get rebuilt. Previously, such
changes went unnoticed and you had to rebuild the entire library
from scratch.
- Added stubs for CreatePort(), DeletePort(), CreateTask(), DeleteTask()
and NewList() which have equivalents in exec.library V50 but for which
it might be useful if ported code didn't have to reference these
explicitly.
- mktemp() was broken in libunix.a with Unix path semantics enabled.
This was because the name template was translated and translated
back again, overwriting the translation buffer. This, funny enough,
broke Samba's printing feature. Fixed by translating the name only
before each test for "uniqueness" is made. The new code also handles
empty "" templates gracefully, which was a problem with both the
"standard" and the Unix path semantics flavour.
Why is it that I find bugs like this always after having just
released another library update?
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14769 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This was because the name template was translated and translated
back again, overwriting the translation buffer. This, funny enough,
broke Samba's printing feature. Fixed by translating the name only
before each test for "uniqueness" is made. The new code also handles
empty "" templates gracefully, which was a problem with both the
"standard" and the Unix path semantics flavour.
Why is it that I find bugs like this always after having just
released another library update?
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14768 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- Changed the error abort condition for the %s conversion of the
scanf() family. It now matches the abort conditions for all other
conversions and no longer ignores whether any other parameters were
converted before. This was a quirk in the older implementation.
- The scanf() family now accepts %E and %G in place of %f and %X in
place of %x.
- Simplified the common code that fopen(), freopen() and fdopen()
share and which has to figure out by looking at a file access
mode specification which parameters should be used.
- Dropped error detection in the scanf() family. The EOF has to be
good enough. Also, ungetc() failure still leads to error handling.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14765 87f5fb63-7c3d-0410-a384-fd976d0f7a62
scanf() family. It now matches the abort conditions for all other
conversions and no longer ignores whether any other parameters were
converted before. This was a quirk in the older implementation.
- The scanf() family now accepts %E and %G in place of %f and %X in
place of %x.
- Simplified the common code that fopen(), freopen() and fdopen()
share and which has to figure out by looking at a file access
mode specification which parameters should be used.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14762 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The scanf() family now always returns the number of assignments made
unless an error occured or an EOF was hit during conversion before the
first assignment could be made.
- strtok() did not terminate properly if the last token in the string
did not end with a separator character but with a '\0' byte. Fixed.
- The directory scanning functions opendir/closedir did not get the global
directory data tracking data structure initialized which later led to
Enforcer hits and maybe trashed memory. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14761 87f5fb63-7c3d-0410-a384-fd976d0f7a62
did not end with a separator character but with a '\0' byte. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14760 87f5fb63-7c3d-0410-a384-fd976d0f7a62
directory data tracking data structure initialized which later led to
Enforcer hits and maybe trashed memory. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14758 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The printf() family now produces no output at all for %e, %f and %g if the
floating point support code is disabled. Previously, a minimum field width
specification could take effect, printing a series of 0 or blank space
characters where no output should have been produced.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14756 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The scanf() family no longer assumes that a leading '0' indicates that the
following digits form an octal number if the conversion type has been
specified as already '%x' already.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14752 87f5fb63-7c3d-0410-a384-fd976d0f7a62
- The OS4 version had floating point math support code enabled in all
libraries and not just "libm.a". Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14750 87f5fb63-7c3d-0410-a384-fd976d0f7a62