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

23 Commits

Author SHA1 Message Date
Olaf Barthel
1efe5fde4d This commit was manufactured by cvs2svn to create tag 'V1_188'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/tags/V1_188@14829 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 10:52:33 +00:00
Olaf Barthel
a626336b7b - Tweaked the build makefiles to produce fewer meaningless warnings.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14828 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 10:52:32 +00:00
Olaf Barthel
07d09bb185 - Added the fsync() and fdatasync() functions and the <stdint.h> and
<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
2005-02-04 15:03:14 +00:00
Olaf Barthel
6ad88ff97f - The library no longer sends ACTION_DISK_INFO packets to the console
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
2005-02-04 08:49:10 +00:00
Olaf Barthel
2ddfeab0cf - Added some extra documentation on the WBStartup variable.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14825 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 17:33:54 +00:00
Olaf Barthel
91028c63bc - Lost the __not_a_number and __infinity variables, including the
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
2005-02-03 16:56:20 +00:00
Olaf Barthel
209884bd1f - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
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
2005-02-03 12:16:38 +00:00
Olaf Barthel
3548d3cf7e - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
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
2005-02-03 12:14:55 +00:00
Olaf Barthel
50b8b623cc - 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@14821 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 16:10:59 +00:00
Olaf Barthel
49bc1d6b13 - Updated the ".cvsignore" file.
- Moved the date/time conversion test code around in "test.c".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14820 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 10:23:26 +00:00
Olaf Barthel
fce21e21d6 - The functions in stdlib.h which require a compiler that supports the
"long long" data type are no longer prototyped if the library is built
  for SAS/C.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14819 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 09:48:06 +00:00
Olaf Barthel
f8b1e7516f - Folded duplicate code stdio_init_exit.c into a common function.
- 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
2005-01-30 09:37:59 +00:00
Olaf Barthel
8e2820e9b7 - Added the missing 'time_convert_time.c'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14816 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 18:22:19 +00:00
Olaf Barthel
ab22a23f27 - Changed the algorithm that calculates the number of days that have passed
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
2005-01-29 18:05:14 +00:00
Olaf Barthel
0ae8d68e64 - We also test the strftime() %U, %W and %j format specifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14814 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 17:48:07 +00:00
Olaf Barthel
0b1d21471d - Plugged in a different algorithm for calculating the day of the week in
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
2005-01-26 18:41:39 +00:00
Olaf Barthel
987316e638 - Added a missing file.
- Updated the .cvsignore file.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14812 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-26 09:24:38 +00:00
Olaf Barthel
e8d4187ea5 - The general test program now also exercises the time conversion functions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14811 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-25 11:21:58 +00:00
Olaf Barthel
003faf7a24 - mktime() is supposed to convert the time specification, given as local
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
2005-01-25 11:21:00 +00:00
Olaf Barthel
d1aaa84bcc - Moved the common DateStamp to time_t conversion code into a shared
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
2005-01-24 10:25:46 +00:00
Olaf Barthel
e1476c15b3 - Added instructions for switching over an existing Amiga 68k GCC installation
to use "clib2".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14808 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-20 12:47:31 +00:00
Olaf Barthel
17fea5626a - Added a check against DBL_EPSILON in log() and log10() in place of the
check against 0 that used to be in there.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14807 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-18 20:00:08 +00:00
Olaf Barthel
e4b70e946f - The default console output window opened when a program is launched
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
2005-01-15 08:17:10 +00:00
261 changed files with 2423 additions and 1288 deletions

View File

@@ -1,5 +1,5 @@
# #
# $Id: GNUmakefile.68k,v 1.20 2005-01-14 09:07:16 obarthel Exp $ # $Id: GNUmakefile.68k,v 1.26 2005-02-07 10:52:16 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -100,7 +100,7 @@ endif
WARNINGS = \ WARNINGS = \
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \ -Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow # -Wconversion -Wshadow
@@ -108,7 +108,7 @@ INCLUDES = -Iinclude -I. -Inetinclude
OPTIONS = -DNDEBUG -fno-builtin OPTIONS = -DNDEBUG -fno-builtin
#OPTIONS = -D__MEM_DEBUG -fno-builtin #OPTIONS = -D__MEM_DEBUG -fno-builtin
#OPTIONS = -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG -fno-builtin #OPTIONS = -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG -fno-builtin
#OPTIMIZE = -O -fomit-frame-pointer -fstrength-reduce -finline-functions OPTIMIZE = -O -fomit-frame-pointer -fstrength-reduce -finline-functions
#OPTIMIZE = -O2 -fomit-frame-pointer #OPTIMIZE = -O2 -fomit-frame-pointer
#DEBUG = -g2 #DEBUG = -g2
@@ -272,6 +272,7 @@ C_LIB = \
stdlib_dosbase.o \ stdlib_dosbase.o \
stdlib_exit.o \ stdlib_exit.o \
stdlib_free.o \ stdlib_free.o \
stdlib_get_errno.o \
stdlib_getdefstacksize.o \ stdlib_getdefstacksize.o \
stdlib_getenv.o \ stdlib_getenv.o \
stdlib_getsp.o \ stdlib_getsp.o \
@@ -298,6 +299,7 @@ C_LIB = \
stdlib_realloc.o \ stdlib_realloc.o \
stdlib_red_black.o \ stdlib_red_black.o \
stdlib_setenv.o \ stdlib_setenv.o \
stdlib_set_errno.o \
stdlib_setjmp.o \ stdlib_setjmp.o \
stdlib_set_process_window.o \ stdlib_set_process_window.o \
stdlib_shell_escape.o \ stdlib_shell_escape.o \
@@ -363,9 +365,12 @@ C_LIB = \
time_asctime_r.o \ time_asctime_r.o \
time_clock.o \ time_clock.o \
time_converttime.o \ time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \ time_ctime.o \
time_ctime_r.o \ time_ctime_r.o \
time_data.o \ time_data.o \
time_days_per_date.o \
time_gettimeofday.o \ time_gettimeofday.o \
time_gmtime.o \ time_gmtime.o \
time_gmtime_r.o \ time_gmtime_r.o \
@@ -375,6 +380,7 @@ C_LIB = \
time_numbertostring.o \ time_numbertostring.o \
time_strftime.o \ time_strftime.o \
time_time.o \ time_time.o \
time_weekday.o \
unistd_access.o \ unistd_access.o \
unistd_chdir.o \ unistd_chdir.o \
unistd_chdir_exit.o \ unistd_chdir_exit.o \
@@ -383,8 +389,10 @@ C_LIB = \
unistd_dup.o \ unistd_dup.o \
unistd_dup2.o \ unistd_dup2.o \
unistd_fchown.o \ unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \ unistd_fdopen.o \
unistd_fileno.o \ unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \ unistd_ftruncate.o \
unistd_getcwd.o \ unistd_getcwd.o \
unistd_getopt.o \ unistd_getopt.o \
@@ -471,6 +479,7 @@ MATH_LIB = \
math_floor.o \ math_floor.o \
math_fmod.o \ math_fmod.o \
math_frexp.o \ math_frexp.o \
math_huge_val.o \
math_hypot.o \ math_hypot.o \
math_init_exit.o \ math_init_exit.o \
math_isinf.o \ math_isinf.o \

View File

@@ -1,5 +1,5 @@
# #
# $Id: GNUmakefile.os4,v 1.20 2005-01-10 00:56:15 theantony Exp $ # $Id: GNUmakefile.os4,v 1.26 2005-02-07 10:52:16 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -105,8 +105,10 @@ endif
############################################################################## ##############################################################################
WARNINGS = \ WARNINGS = \
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \ -Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion -Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE) INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
@@ -275,6 +277,7 @@ C_LIB = \
stdlib_exit.o \ stdlib_exit.o \
stdlib_free.o \ stdlib_free.o \
stdlib_getdefstacksize.o \ stdlib_getdefstacksize.o \
stdlib_get_errno.o \
stdlib_getenv.o \ stdlib_getenv.o \
stdlib_getsp.o \ stdlib_getsp.o \
stdlib_init_exit.o \ stdlib_init_exit.o \
@@ -299,6 +302,7 @@ C_LIB = \
stdlib_rand.o \ stdlib_rand.o \
stdlib_realloc.o \ stdlib_realloc.o \
stdlib_red_black.o \ stdlib_red_black.o \
stdlib_set_errno.o \
stdlib_setenv.o \ stdlib_setenv.o \
stdlib_setjmp.o \ stdlib_setjmp.o \
stdlib_set_process_window.o \ stdlib_set_process_window.o \
@@ -365,9 +369,12 @@ C_LIB = \
time_asctime_r.o \ time_asctime_r.o \
time_clock.o \ time_clock.o \
time_converttime.o \ time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \ time_ctime.o \
time_ctime_r.o \ time_ctime_r.o \
time_data.o \ time_data.o \
time_days_per_date.o \
time_gettimeofday.o \ time_gettimeofday.o \
time_gmtime.o \ time_gmtime.o \
time_gmtime_r.o \ time_gmtime_r.o \
@@ -377,6 +384,7 @@ C_LIB = \
time_numbertostring.o \ time_numbertostring.o \
time_strftime.o \ time_strftime.o \
time_time.o \ time_time.o \
time_weekday.o \
unistd_access.o \ unistd_access.o \
unistd_chdir.o \ unistd_chdir.o \
unistd_chdir_exit.o \ unistd_chdir_exit.o \
@@ -385,8 +393,10 @@ C_LIB = \
unistd_dup.o \ unistd_dup.o \
unistd_dup2.o \ unistd_dup2.o \
unistd_fchown.o \ unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \ unistd_fdopen.o \
unistd_fileno.o \ unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \ unistd_ftruncate.o \
unistd_getcwd.o \ unistd_getcwd.o \
unistd_getopt.o \ unistd_getopt.o \
@@ -475,6 +485,7 @@ MATH_LIB = \
math_floor.o \ math_floor.o \
math_fmod.o \ math_fmod.o \
math_frexp.o \ math_frexp.o \
math_huge_val.o \
math_hypot.o \ math_hypot.o \
math_init_exit.o \ math_init_exit.o \
math_isnan.o \ math_isnan.o \

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "amiga.lib 1.186" #define VERS "amiga.lib 1.188"
#define VSTRING "amiga.lib 1.186 (14.1.2005)\r\n" #define VSTRING "amiga.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: amiga.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "c.lib 1.186" #define VERS "c.lib 1.188"
#define VSTRING "c.lib 1.186 (14.1.2005)\r\n" #define VSTRING "c.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: c.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: c.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,3 +1,86 @@
c.lib 1.188 (7.2.2005)
- Folded duplicate code in "stdio_init_exit.c" into a common function.
- 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.
- We now allocate the AnchorPath used in the unistd_wildcard_expand.c
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.
- Lost the __not_a_number and __infinity variables, including the
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. The new approach should be more portable.
- The library no longer sends ACTION_DISK_INFO packets to the console
handler. The side-effects were too varied and irritating after all.
- Added the fsync() and fdatasync() functions and the <stdint.h> and
<inttypes.h> header files contributed by Peter Bengtsson. Thank
you very much!
- Tweaked the build makefiles to produce fewer meaningless warnings.
c.lib 1.187 (29.1.2005)
- The default console output window opened when a program is launched
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.
- Moved the common DateStamp to time_t conversion code into a shared
function.
- The fall-back function for converting time into a string in strftime()
now calls itself for the "%c", "%x" and "%X" format specifiers.
- mktime() is supposed to convert the time specification, given as local
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.
- Plugged in a different algorithm for calculating the day of the week in
strftime() and asctime_r(). This one isn't sensitive to the effects of
adding/subtracting the local time zone.
- Changed the algorithm that calculates the number of days that have passed
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.
c.lib 1.186 (14.1.2005) c.lib 1.186 (14.1.2005)
- Redirecting stderr to a file no longer has the effect of showing error - Redirecting stderr to a file no longer has the effect of showing error

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "debug.lib 1.186" #define VERS "debug.lib 1.188"
#define VSTRING "debug.lib 1.186 (14.1.2005)\r\n" #define VSTRING "debug.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: debug.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_closedir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: dirent_closedir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -63,7 +63,7 @@ closedir(DIR * directory_pointer)
if(directory_pointer == NULL) if(directory_pointer == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -84,7 +84,7 @@ closedir(DIR * directory_pointer)
if(NOT directory_pointer_is_valid) if(NOT directory_pointer_is_valid)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
} }
@@ -94,8 +94,12 @@ closedir(DIR * directory_pointer)
Remove((struct Node *)dh); Remove((struct Node *)dh);
while((node = RemHead(&dh->dh_VolumeList)) != NULL) #if defined(UNIX_PATH_SEMANTICS)
free(node); {
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
free(node);
}
#endif /* UNIX_PATH_SEMANTICS */
PROFILE_OFF(); PROFILE_OFF();
UnLock(dh->dh_DirLock); UnLock(dh->dh_DirLock);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: dirent_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -42,6 +42,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#ifndef _MACROS_H #ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */ #endif /* _MACROS_H */
@@ -54,9 +60,10 @@ struct DirectoryHandle
BPTR dh_DirLock; BPTR dh_DirLock;
struct FileInfoBlock dh_FileInfo; struct FileInfoBlock dh_FileInfo;
struct dirent dh_DirectoryEntry; struct dirent dh_DirectoryEntry;
int dh_Position; int dh_Position;
struct Node * dh_VolumeNode; struct Node * dh_VolumeNode;
struct List dh_VolumeList; struct MinList dh_VolumeList;
BOOL dh_ScanVolumeList; BOOL dh_ScanVolumeList;
}; };

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_opendir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: dirent_opendir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -106,7 +106,7 @@ opendir(const char * path_name)
{ {
SHOWMSG("invalid parameter"); SHOWMSG("invalid parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -121,10 +121,10 @@ opendir(const char * path_name)
memset(dh,0,sizeof(*dh)); memset(dh,0,sizeof(*dh));
NewList(&dh->dh_VolumeList);
#if defined(UNIX_PATH_SEMANTICS) #if defined(UNIX_PATH_SEMANTICS)
{ {
NewList((struct List *)&dh->dh_VolumeList);
if(__unix_path_semantics) if(__unix_path_semantics)
{ {
if(__translate_unix_to_amiga_path_name(&path_name,&path_name_nti) != 0) if(__translate_unix_to_amiga_path_name(&path_name,&path_name_nti) != 0)
@@ -159,7 +159,7 @@ opendir(const char * path_name)
{ {
UnLockDosList(LDF_VOLUMES|LDF_READ); UnLockDosList(LDF_VOLUMES|LDF_READ);
errno = ENOMEM; __set_errno(ENOMEM);
goto out; goto out;
} }
@@ -172,7 +172,7 @@ opendir(const char * path_name)
/* Check if the name is already on the list. Mind you, /* Check if the name is already on the list. Mind you,
this is not the most sophisticated algorithm but then this is not the most sophisticated algorithm but then
the number of volumes should be small. */ the number of volumes should be small. */
if(find_by_name(&dh->dh_VolumeList,node->ln_Name) != NULL) if(find_by_name((struct List *)&dh->dh_VolumeList,node->ln_Name) != NULL)
{ {
free(node); free(node);
continue; continue;
@@ -180,16 +180,16 @@ opendir(const char * path_name)
D(("adding '%s'",node->ln_Name)); D(("adding '%s'",node->ln_Name));
AddTail(&dh->dh_VolumeList,node); AddTail((struct List *)&dh->dh_VolumeList,node);
} }
} }
UnLockDosList(LDF_VOLUMES|LDF_READ); UnLockDosList(LDF_VOLUMES|LDF_READ);
/* Bail out if we cannot present anything. */ /* Bail out if we cannot present anything. */
if(IsListEmpty(&dh->dh_VolumeList)) if(IsListEmpty((struct List *)&dh->dh_VolumeList))
{ {
errno = ENOMEM; __set_errno(ENOMEM);
goto out; goto out;
} }
} }
@@ -212,7 +212,7 @@ opendir(const char * path_name)
{ {
SHOWMSG("couldn't get a lock on it"); SHOWMSG("couldn't get a lock on it");
__translate_access_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out; goto out;
} }
@@ -226,7 +226,7 @@ opendir(const char * path_name)
{ {
SHOWMSG("couldn't examine it"); SHOWMSG("couldn't examine it");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }
@@ -234,7 +234,7 @@ opendir(const char * path_name)
{ {
SHOWMSG("this isn't a directory"); SHOWMSG("this isn't a directory");
errno = ENOTDIR; __set_errno(ENOTDIR);
goto out; goto out;
} }
} }
@@ -254,8 +254,12 @@ opendir(const char * path_name)
{ {
SHOWMSG("ouch. cleaning up"); SHOWMSG("ouch. cleaning up");
while((node = RemHead(&dh->dh_VolumeList)) != NULL) #if defined(UNIX_PATH_SEMANTICS)
free(node); {
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
free(node);
}
#endif /* UNIX_PATH_SEMANTICS */
PROFILE_OFF(); PROFILE_OFF();
UnLock(dh->dh_DirLock); UnLock(dh->dh_DirLock);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_readdir.c,v 1.5 2005-01-09 15:58:02 obarthel Exp $ * $Id: dirent_readdir.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -61,7 +61,7 @@ readdir(DIR * directory_pointer)
{ {
SHOWMSG("ouch. invalid parameter"); SHOWMSG("ouch. invalid parameter");
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -93,8 +93,8 @@ readdir(DIR * directory_pointer)
assert( (((ULONG)name) & 3) == 0 ); assert( (((ULONG)name) & 3) == 0 );
if(dh->dh_VolumeNode == NULL && NOT IsListEmpty(&dh->dh_VolumeList)) if(dh->dh_VolumeNode == NULL && NOT IsListEmpty((struct List *)&dh->dh_VolumeList))
dh->dh_VolumeNode = dh->dh_VolumeList.lh_Head; dh->dh_VolumeNode = (struct Node *)dh->dh_VolumeList.mlh_Head;
strcpy(name,"\1:"); /* BSTR for ":" */ strcpy(name,"\1:"); /* BSTR for ":" */
@@ -164,7 +164,7 @@ readdir(DIR * directory_pointer)
{ {
if(CANNOT Examine(parent_directory,fib)) if(CANNOT Examine(parent_directory,fib))
{ {
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }
} }
@@ -206,7 +206,7 @@ readdir(DIR * directory_pointer)
{ {
SHOWMSG("error scanning directory"); SHOWMSG("error scanning directory");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_rewinddir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: dirent_rewinddir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -76,7 +76,7 @@ rewinddir(DIR * directory_pointer)
if(CANNOT Examine(dh->dh_DirLock,&dh->dh_FileInfo)) if(CANNOT Examine(dh->dh_DirLock,&dh->dh_FileInfo))
{ {
SHOWMSG("ouch. that didn't work"); SHOWMSG("ouch. that didn't work");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
} }
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_close.c,v 1.6 2005-01-14 08:36:54 obarthel Exp $ * $Id: fcntl_close.c,v 1.8 2005-02-04 08:49:10 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -133,13 +133,12 @@ __close(int file_descriptor,int * error_ptr)
for aliases and their like since the original stream is still in use. */ for aliases and their like since the original stream is still in use. */
if(NOT is_alias) if(NOT is_alias)
{ {
if((FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING) && FLAG_IS_CLEAR(fd->fd_Flags,FDF_DEFAULT_NON_BLOCKING)) || if(FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING))
(FLAG_IS_CLEAR(fd->fd_Flags,FDF_NON_BLOCKING) && FLAG_IS_SET(fd->fd_Flags,FDF_DEFAULT_NON_BLOCKING)))
{ {
SHOWMSG("resetting non-blocking access mode"); SHOWMSG("resetting non-blocking access mode");
message.action = file_hook_action_set_blocking; message.action = file_hook_action_set_blocking;
message.arg = FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING); message.arg = TRUE;
assert( fd->fd_Hook != NULL ); assert( fd->fd_Hook != NULL );
@@ -178,10 +177,12 @@ int
close(int file_descriptor) close(int file_descriptor)
{ {
int result; int result;
int error;
ENTER(); ENTER();
result = __close(file_descriptor,&errno); result = __close(file_descriptor,&error);
__set_errno(error);
RETURN(result); RETURN(result);
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_creat.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_creat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -66,7 +66,7 @@ creat(const char * path_name, mode_t mode)
{ {
if(path_name == NULL) if(path_name == NULL)
{ {
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_fcntl.c,v 1.5 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_fcntl.c,v 1.6 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -71,7 +71,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -94,7 +94,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
SHOWMSG("invalid flock type"); SHOWMSG("invalid flock type");
va_end(arg); va_end(arg);
errno = EINVAL; __set_errno(EINVAL);
break; break;
} }
@@ -103,7 +103,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
SHOWMSG("invalid flock offset"); SHOWMSG("invalid flock offset");
va_end(arg); va_end(arg);
errno = EINVAL; __set_errno(EINVAL);
break; break;
} }
@@ -116,7 +116,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
CallHookPkt(fd->fd_Hook,fd,&message); CallHookPkt(fd->fd_Hook,fd,&message);
result = message.result; result = message.result;
errno = message.error; __set_errno(message.error);
va_end(arg); va_end(arg);
@@ -159,7 +159,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
result = message.result; result = message.result;
if(result < 0) if(result < 0)
{ {
errno = message.error; __set_errno(message.error);
va_end(arg); va_end(arg);
goto out; goto out;
@@ -184,7 +184,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
result = message.result; result = message.result;
if(result < 0) if(result < 0)
{ {
errno = message.error; __set_errno(message.error);
va_end(arg); va_end(arg);
goto out; goto out;
@@ -210,7 +210,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
if(fdbase < 0) if(fdbase < 0)
{ {
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }
@@ -257,14 +257,14 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
goto out; goto out;
} }
errno = EMFILE; __set_errno(EMFILE);
break; break;
default: default:
SHOWMSG("something else"); SHOWMSG("something else");
errno = ENOSYS; __set_errno(ENOSYS);
break; break;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_get_default_file.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -55,7 +55,7 @@ __get_default_file(int file_descriptor,long * file_ptr)
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -42,4 +42,10 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#endif /* _FCNTL_HEADERS_H */ #endif /* _FCNTL_HEADERS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_lseek.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_lseek.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -115,10 +115,12 @@ off_t
lseek(int file_descriptor, off_t offset, int mode) lseek(int file_descriptor, off_t offset, int mode)
{ {
off_t result; off_t result;
int error;
ENTER(); ENTER();
result = __lseek(file_descriptor,offset,mode,&errno); result = __lseek(file_descriptor,offset,mode,&error);
__set_errno(error);
RETURN(result); RETURN(result);
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_open.c,v 1.7 2005-01-09 16:07:27 obarthel Exp $ * $Id: fcntl_open.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -123,7 +123,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("path name is invalid"); SHOWMSG("path name is invalid");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -134,7 +134,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("access mode is invalid"); SHOWMSG("access mode is invalid");
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }
@@ -160,7 +160,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(path_name_nti.is_root) if(path_name_nti.is_root)
{ {
errno = EACCES; __set_errno(EACCES);
goto out; goto out;
} }
} }
@@ -187,7 +187,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("the file already exists"); SHOWMSG("the file already exists");
errno = EEXIST; __set_errno(EEXIST);
goto out; goto out;
} }
@@ -197,14 +197,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("there's something not a directory on the path"); SHOWMSG("there's something not a directory on the path");
errno = ENOTDIR; __set_errno(ENOTDIR);
goto out; goto out;
} }
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN) else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{ {
SHOWMSG("error accessing the object"); SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }
@@ -233,7 +233,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("could not examine the object"); SHOWMSG("could not examine the object");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }
@@ -242,7 +242,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("can't open a directory"); SHOWMSG("can't open a directory");
errno = EISDIR; __set_errno(EISDIR);
goto out; goto out;
} }
@@ -251,7 +251,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("this object is not write enabled"); SHOWMSG("this object is not write enabled");
errno = EACCES; __set_errno(EACCES);
goto out; goto out;
} }
@@ -274,14 +274,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{ {
SHOWMSG("there's something not a directory on the path"); SHOWMSG("there's something not a directory on the path");
errno = ENOTDIR; __set_errno(ENOTDIR);
goto out; goto out;
} }
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN) else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{ {
SHOWMSG("error accessing the object"); SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }
} }
@@ -305,7 +305,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
LONG io_err = IoErr(); LONG io_err = IoErr();
D(("the file '%s' didn't open in mode %ld",path_name,open_mode)); D(("the file '%s' didn't open in mode %ld",path_name,open_mode));
__translate_access_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_access_io_error_to_errno(io_err));
/* Check if ended up trying to open a directory as if /* Check if ended up trying to open a directory as if
it were a plain file. */ it were a plain file. */
@@ -317,7 +317,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(lock != ZERO) if(lock != ZERO)
{ {
if(Examine(lock,fib) && fib->fib_DirEntryType >= 0) if(Examine(lock,fib) && fib->fib_DirEntryType >= 0)
errno = EISDIR; __set_errno(EISDIR);
} }
PROFILE_ON(); PROFILE_ON();

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_read.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_read.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -136,10 +136,12 @@ ssize_t
read(int file_descriptor, void * buffer, size_t num_bytes) read(int file_descriptor, void * buffer, size_t num_bytes)
{ {
ssize_t result; ssize_t result;
int error;
ENTER(); ENTER();
result = __read(file_descriptor,buffer,num_bytes,&errno); result = __read(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result); RETURN(result);
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_write.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: fcntl_write.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -136,10 +136,12 @@ ssize_t
write(int file_descriptor, const void * buffer, size_t num_bytes) write(int file_descriptor, const void * buffer, size_t num_bytes)
{ {
ssize_t result; ssize_t result;
int error;
ENTER(); ENTER();
result = __write(file_descriptor,buffer,num_bytes,&errno); result = __write(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result); RETURN(result);
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dos.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $ * $Id: dos.h,v 1.7 2005-02-03 17:33:54 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -66,6 +66,26 @@ extern "C" {
* ISO 'C' standard context. It is redefined to WBenchMsg to make it * ISO 'C' standard context. It is redefined to WBenchMsg to make it
* compatible with the original Amiga program startup code which would * compatible with the original Amiga program startup code which would
* refer to the variable under that name. * refer to the variable under that name.
*
* It is recommended to access the Workbench startup message as part of your
* program's main() function, like this:
*
* int
* main(int argc,char ** argv)
* {
* struct WBStartup * wb_startup_message;
*
* if(argc == 0)
* wb_startup_message = (struct WBStartup *)argv;
* else
* wb_startup_message = NULL;
*
* ...
* }
*
* This approach has the advantage that your program does not rely upon a
* global variable initialized by the startup code, whose name you might
* not even know exactly.
*/ */
extern struct WBStartup * __WBenchMsg; extern struct WBStartup * __WBenchMsg;
#define WBenchMsg __WBenchMsg #define WBenchMsg __WBenchMsg
@@ -278,7 +298,7 @@ extern int __translate_relative_path_name(char const ** name_ptr,char *replace,s
extern void __restore_path_name(char const ** name_ptr,struct name_translation_info * nti); extern void __restore_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern int __translate_amiga_to_unix_path_name(char const ** name_ptr,struct name_translation_info * nti); extern int __translate_amiga_to_unix_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern int __translate_unix_to_amiga_path_name(char const ** name_ptr,struct name_translation_info * nti); extern int __translate_unix_to_amiga_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern void __translate_io_error_to_errno(LONG io_error,int * errno_ptr); extern int __translate_io_error_to_errno(LONG io_error);
/****************************************************************************/ /****************************************************************************/

296
library/include/inttypes.h Normal file
View File

@@ -0,0 +1,296 @@
/*
* $Id: inttypes.h,v 1.1 2005-02-04 15:03:13 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _INTTYPES_H
#define _INTTYPES_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
/* Integral types with specified size; contributed by Peter Bengtsson */
/****************************************************************************/
#ifndef _STDINT_H
#include <stdint.h>
#endif /* _STDINT_H */
/****************************************************************************/
/* printf() format specifications for different types. */
/* "Decimal" */
#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "d"
#define PRId64 "lld"
#define PRIdLEAST8 "d"
#define PRIdLEAST16 "d"
#define PRIdLEAST32 "d"
#define PRIdLEAST64 "lld"
#define PRIdFAST8 "d"
#define PRIdFAST16 "d"
#define PRIdFAST32 "d"
#define PRIdFAST64 "lld"
#define PRIdPTR "ld"
/* "Integer" */
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "i"
#define PRIi64 "lli"
#define PRIiLEAST8 "i"
#define PRIiLEAST16 "i"
#define PRIiLEAST32 "i"
#define PRIiLEAST64 "lli"
#define PRIiFAST8 "i"
#define PRIiFAST16 "i"
#define PRIiFAST32 "i"
#define PRIiFAST64 "lli"
#define PRIiPTR "li"
/* "Unsigned" */
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "u"
#define PRIu64 "llu"
#define PRIuLEAST8 "u"
#define PRIuLEAST16 "u"
#define PRIuLEAST32 "u"
#define PRIuLEAST64 "llu"
#define PRIuFAST8 "u"
#define PRIuFAST16 "u"
#define PRIuFAST32 "u"
#define PRIuFAST64 "llu"
#define PRIuPTR "lu"
/* "Hexadecimal - lowercase " */
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "x"
#define PRIx64 "llx"
#define PRIxLEAST8 "x"
#define PRIxLEAST16 "x"
#define PRIxLEAST32 "x"
#define PRIxLEAST64 "llx"
#define PRIxFAST8 "x"
#define PRIxFAST16 "x"
#define PRIxFAST32 "x"
#define PRIxFAST64 "llx"
#define PRIxPTR "lx"
/* "Hexadecimal - Uppercase" */
#define PRIX8 "X"
#define PRIX16 "X"
#define PRIX32 "X"
#define PRIX64 "llX"
#define PRIXLEAST8 "X"
#define PRIXLEAST16 "X"
#define PRIXLEAST32 "X"
#define PRIXLEAST64 "llX"
#define PRIXFAST8 "X"
#define PRIXFAST16 "X"
#define PRIXFAST32 "X"
#define PRIXFAST64 "llX"
#define PRIXPTR "lX"
/* "Octal" */
#define PRIo8 "o"
#define PRIo16 "o"
#define PRIo32 "o"
#define PRIo64 "llo"
#define PRIoLEAST8 "o"
#define PRIoLEAST16 "o"
#define PRIoLEAST32 "o"
#define PRIoLEAST64 "llo"
#define PRIoFAST8 "o"
#define PRIoFAST16 "o"
#define PRIoFAST32 "o"
#define PRIoFAST64 "llo"
#define PRIoPTR "lo"
/* intmax_t is 32 bits for SAS/C, 64-bits for GCC or if using a conforming C99 compiler. */
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define PRIdMAX "lld"
#define PRIiMAX "lli"
#define PRIuMAX "llu"
#define PRIxMAX "llx"
#define PRIXMAX "llX"
#define PRIoMAX "llo"
#else
#define PRIdMAX "ld"
#define PRIiMAX "li"
#define PRIuMAX "lu"
#define PRIxMAX "lx"
#define PRIXMAX "lX"
#define PRIoMAX "lo"
#endif
/* scanf() format specifiers. */
/* "Decimal" */
/* #define SCNd8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNd16 "hd"
#define SCNd32 "d"
#define SCNd64 "lld"
/* #define SCNdLEAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNdLEAST16 "hd"
#define SCNdLEAST32 "d"
#define SCNdLEAST64 "lld"
/* #define SCNdFAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNdFAST16 "d"
#define SCNdFAST32 "d"
#define SCNdFAST64 "lld"
#define SCNdPTR "d"
/* "Integer" */
/* #define SCNi8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNi16 "hi"
#define SCNi32 "i"
#define SCNi64 "lli"
/* #define SCNiLEAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNiLEAST16 "hi"
#define SCNiLEAST32 "i"
#define SCNiLEAST64 "lli"
/* #define SCNiFAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNiFAST16 "i"
#define SCNiFAST32 "i"
#define SCNiFAST64 "lli"
#define SCNiPTR "i"
/* "Unsigned" */
/* #define SCNu8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNu16 "hu"
#define SCNu32 "u"
#define SCNu64 "llu"
/* #define SCNuLEAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNuLEAST16 "hu"
#define SCNuLEAST32 "u"
#define SCNuLEAST64 "llu"
/* #define SCNuFAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNuFAST16 "u"
#define SCNuFAST32 "u"
#define SCNuFAST64 "llu"
#define SCNuPTR "u"
/* "Hexadecimal" */
/* #define SCNx8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNx16 "hx"
#define SCNx32 "x"
#define SCNx64 "llx"
/* #define SCNxLEAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNxLEAST16 "hx"
#define SCNxLEAST32 "x"
#define SCNxLEAST64 "llx"
/* #define SCNxFAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNxFAST16 "x"
#define SCNxFAST32 "x"
#define SCNxFAST64 "llx"
#define SCNxPTR "x"
/* "Octal" */
/* #define SCNo8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNo16 "ho"
#define SCNo32 "o"
#define SCNo64 "llo"
/* #define SCNoLEAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNoLEAST16 "ho"
#define SCNoLEAST32 "o"
#define SCNoLEAST64 "llo"
/* #define SCNoFAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNoFAST16 "o"
#define SCNoFAST32 "o"
#define SCNoFAST64 "llo"
#define SCNoPTR "o"
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define SCNdMAX "lld"
#define SCNiMAX "lli"
#define SCNuMAX "llu"
#define SCNxMAX "llx"
#define SCNoMAX "llo"
#else
#define SCNdMAX "ld"
#define SCNiMAX "li"
#define SCNuMAX "lu"
#define SCNxMAX "lx"
#define SCNoMAX "lo"
#endif
/* TODO: Add the rest of inttypes.h here + in the library. */
/*
* Missing stuff is among other things atoll(), strtoll(), ...
* Then there is the matter of wchar support - Zzzz.
*/
/****************************************************************************/
#endif /* _INTTYPES_H */

186
library/include/stdint.h Normal file
View File

@@ -0,0 +1,186 @@
/*
* $Id: stdint.h,v 1.1 2005-02-04 15:03:14 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _STDINT_H
#define _STDINT_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
/* C99 integer type definitions; contributed by Peter Bengtsson */
/****************************************************************************/
#ifndef _LIMITS_H
#include <limits.h>
#endif /* _LIMITS_H */
/****************************************************************************/
/* Common for all supported compilers. */
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed char int_least8_t;
typedef signed short int_least16_t;
typedef signed int int_least32_t;
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
/* This is mostly guesswork. */
typedef signed char int_fast8_t;
typedef signed int int_fast16_t;
typedef signed int int_fast32_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef signed long intptr_t;
typedef unsigned long uintptr_t;
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef signed long long int_least64_t;
typedef unsigned long long uint_least64_t;
typedef signed long long int_fast64_t;
typedef unsigned long long uint_fast64_t;
typedef signed long long intmax_t;
typedef unsigned long long uintmax_t;
#else /* No 64-bit types for SAS/C */
typedef signed long intmax_t;
typedef unsigned long uintmax_t;
#endif
#define INT8_MIN SCHAR_MIN
#define INT8_MAX SCHAR_MAX
#define UINT8_MAX UCHAR_MAX
#define INT16_MIN SHRT_MIN
#define INT16_MAX SHRT_MAX
#define UINT16_MAX USHRT_MAX
#define INT32_MIN INT_MIN
#define INT32_MAX INT_MAX
#define UINT32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT64_MIN LLONG_MIN
#define INT64_MAX LLONG_MAX
#define UINT64_MAX ULLONG_MAX
#endif
#define INT_LEAST8_MIN SCHAR_MIN
#define INT_LEAST8_MAX SCHAR_MAX
#define UINT_LEAST8_MAX UCHAR_MAX
#define INT_LEAST16_MIN SHRT_MIN
#define INT_LEAST16_MAX SHRT_MAX
#define UINT_LEAST16_MAX USHRT_MAX
#define INT_LEAST32_MIN INT_MIN
#define INT_LEAST32_MAX INT_MAX
#define UINT_LEAST32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT_LEAST64_MIN LLONG_MIN
#define INT_LEAST64_MAX LLONG_MAX
#define UINT_LEAST64_MAX ULLONG_MAX
#endif
#define INT_FAST8_MIN SCHAR_MIN
#define INT_FAST8_MAX SCHAR_MAX
#define UINT_FAST8_MAX UCHAR_MAX
#define INT_FAST16_MIN INT_MIN
#define INT_FAST16_MAX INT_MAX
#define UINT_FAST16_MAX UINT_MAX
#define INT_FAST32_MIN INT_MIN
#define INT_FAST32_MAX INT_MAX
#define UINT_FAST32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT_FAST64_MIN LLONG_MIN
#define INT_FAST64_MAX LLONG_MAX
#define UINT_FAST64_MAX ULLONG_MAX
#endif
#define INTPTR_MIN LONG_MIN
#define INTPTR_MAX LONG_MAX
#define UINTPTR_MAX ULONG_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INTMAX_MIN LLONG_MIN
#define INTMAX_MAX LLONG_MAX
#define UINTMAX_MAX ULLONG_MAX
#else
#define INTMAX_MIN LONG_MIN
#define INTMAX_MAX LONG_MAX
#define UINTMAX_MAX ULONG_MAX
#endif
#if !defined(__cpluspluis) || defined(__STDC_LIMIT_MACROS)
/* sigatomic_t is an int. */
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
/* Maximum value of size_t */
#define SIZE_MAX UINT_MAX
#endif /* not C++ or LIMIT_MACROS */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#define INT8_C(x) x
#define INT16_C(x) x
#define INT32_C(x) x
#define INT64_C(x) x ## LL
#define UINT8_C(x) x ## U
#define UINT16_C(x) x ## U
#define UINT32_C(x) x ## U
#define UINT64_C(x) x ## ULL
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INTMAX_C(x) x ## LL
#define UINTMAX_C(x) x ## ULL
#else
#define INTMAX_C(x) x ## L
#define UINTMAX_C(x) x ## UL
#endif
#endif /* not C++ or CONSTANT_MACROS */
/****************************************************************************/
#endif /* _STDINT_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $ * $Id: stdlib.h,v 1.6 2005-01-30 09:48:06 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -149,8 +149,12 @@ extern long atol(const char *str);
/****************************************************************************/ /****************************************************************************/
/* These two functions are unavailable under SAS/C for lack of a
"long long" data type. */
#if ! defined(__SASC)
extern long long strtoll(const char *str, char **ptr, int base); extern long long strtoll(const char *str, char **ptr, int base);
extern unsigned long long strtoull(const char *str, char **ptr, int base); extern unsigned long long strtoull(const char *str, char **ptr, int base);
#endif /* __SASC */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd.h,v 1.8 2005-01-02 09:07:21 obarthel Exp $ * $Id: unistd.h,v 1.9 2005-02-04 15:03:14 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -98,6 +98,8 @@ extern void usleep(unsigned long microseconds);
extern int getopt(int argc, char * argv[], char *opts); extern int getopt(int argc, char * argv[], char *opts);
extern pid_t getpid(void); extern pid_t getpid(void);
extern char *realpath(const char *file_name, char *resolved_name); extern char *realpath(const char *file_name, char *resolved_name);
extern int fsync(int file_descriptor);
extern int fdatasync(int file_descriptor);
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: locale_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: locale_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -53,9 +53,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_LOCALE_UTILITY_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_locale_utility.h" #include "stdlib_headers.h"
#endif /* _STDLIB_LOCALE_UTILITY_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: locale_setlocale.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: locale_setlocale.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -56,7 +56,7 @@ setlocale(int category, const char *locale)
{ {
SHOWMSG("invalid category"); SHOWMSG("invalid category");
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }
@@ -75,7 +75,7 @@ setlocale(int category, const char *locale)
{ {
SHOWMSG("locale name is too long"); SHOWMSG("locale name is too long");
errno = ENAMETOOLONG; __set_errno(ENAMETOOLONG);
goto out; goto out;
} }
@@ -103,7 +103,7 @@ setlocale(int category, const char *locale)
{ {
SHOWMSG("couldn't open the locale"); SHOWMSG("couldn't open the locale");
errno = ENOENT; __set_errno(ENOENT);
goto out; goto out;
} }
} }

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "m.lib 1.186" #define VERS "m.lib 1.188"
#define VSTRING "m.lib 1.186 (14.1.2005)\r\n" #define VSTRING "m.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: m.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: m.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "m881.lib 1.186" #define VERS "m881.lib 1.188"
#define VSTRING "m881.lib 1.186 (14.1.2005)\r\n" #define VSTRING "m881.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: m881.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: macros.h,v 1.5 2005-01-12 09:15:50 obarthel Exp $ * $Id: macros.h,v 1.8 2005-01-30 09:37:59 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -60,14 +60,6 @@
/****************************************************************************/ /****************************************************************************/
#define UNIX_TIME_OFFSET 252460800
/****************************************************************************/
#define MILLION (1000000)
/****************************************************************************/
#define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0])) #define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0]))
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_acos.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_acos.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -227,7 +227,7 @@ acos(double x)
else else
{ {
result = 0; result = 0;
errno = EDOM; __set_errno(EDOM);
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_asin.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_asin.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -238,7 +238,7 @@ asin(double x)
else else
{ {
result = 0; result = 0;
errno = EDOM; __set_errno(EDOM);
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_atan2.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_atan2.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -108,7 +108,7 @@ __atan2(double y,double x)
else else
{ {
result = 0; result = 0;
errno = EDOM; __set_errno(EDOM);
} }
} }
} }
@@ -187,7 +187,7 @@ __atan2(double y,double x)
else else
{ {
result = 0; result = 0;
errno = EDOM; __set_errno(EDOM);
} }
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_ceil.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_ceil.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -150,7 +150,6 @@ __ceil(double x)
#if defined(PPC_FLOATING_POINT_SUPPORT) #if defined(PPC_FLOATING_POINT_SUPPORT)
static const double huge = 1.0e300; static const double huge = 1.0e300;
INLINE static const double INLINE static const double
@@ -233,6 +232,7 @@ __ceil(double x)
} }
#endif /* PPC_FLOATING_POINT_SUPPORT */ #endif /* PPC_FLOATING_POINT_SUPPORT */
/****************************************************************************/ /****************************************************************************/
double double

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_cos.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_cos.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -172,6 +172,7 @@ __cos(double x)
} }
} }
} }
#endif /* PPC_FLOATING_POINT_SUPPORT */ #endif /* PPC_FLOATING_POINT_SUPPORT */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_data.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_data.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,5 +48,3 @@ struct Library * MathIeeeDoubTransBase;
/****************************************************************************/ /****************************************************************************/
double __huge_val; double __huge_val;
double __not_a_number;
double __infinity;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_fmod.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_fmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -285,7 +285,7 @@ fmod(double x,double y)
else else
{ {
result = x; result = x;
errno = EDOM; __set_errno(EDOM);
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_frexp.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_frexp.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -189,8 +189,9 @@ frexp(double x,int *nptr)
{ {
if(nptr == NULL) if(nptr == NULL)
{ {
result = HUGE_VAL; __set_errno(EFAULT);
errno = EFAULT;
result = __get_huge_val();
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_headers.h,v 1.5 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_headers.h,v 1.6 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -192,8 +192,14 @@ extern double __scalbn(double x, int n);
/****************************************************************************/ /****************************************************************************/
extern double __not_a_number; #ifndef _STDLIB_HEADERS_H
extern double __infinity; #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
/* math_huge_val.c */
double __get_huge_val(void);
/****************************************************************************/ /****************************************************************************/

44
library/math_huge_val.c Normal file
View File

@@ -0,0 +1,44 @@
/*
* $Id: math_huge_val.c,v 1.1 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MATH_HEADERS_H
#include "math_headers.h"
#endif /* _MATH_HEADERS_H */
/****************************************************************************/
double
__get_huge_val(void)
{
return(__huge_val);
}

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_init_exit.c,v 1.6 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_init_exit.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -127,82 +127,28 @@ __math_init(void)
the largest representable floating point value. */ the largest representable floating point value. */
if(sizeof(__huge_val) == 4) /* single precision */ if(sizeof(__huge_val) == 4) /* single precision */
{ {
static const unsigned long largest_fp_value[1] = union ieee_single * x = (union ieee_single *)&__huge_val;
{
/* Exponent = +126, Mantissa = 8,388,607 */
0x7f7fffff
};
static const unsigned long not_a_number[1] = /* Exponent = +126, Mantissa = 8,388,607 */
{ x->raw[0] = 0x7f7fffff;
/* Exponent = 255 and fraction != 0.0 */
0x7fffffff
};
static const unsigned long infinity[1] =
{
/* Exponent = 255 and fraction = 0.0 */
0x7f800000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
} }
else if (sizeof(__huge_val) == 8) /* double precision */ else if (sizeof(__huge_val) == 8) /* double precision */
{ {
static const unsigned long largest_fp_value[2] = union ieee_double * x = (union ieee_double *)&__huge_val;
{
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
0x7fefffff,0xffffffff
};
static const unsigned long not_a_number[2] = /* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
{ x->raw[0] = 0x7fefffff;
/* Exponent = 2047 and fraction != 0.0 */ x->raw[1] = 0xffffffff;
0x7fffffff,0xffffffff
};
static const unsigned long infinity[2] =
{
/* Exponent = 2047 and fraction = 0.0 */
0x7ff00000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
} }
#if defined(USE_LONG_DOUBLE) #if defined(USE_LONG_DOUBLE)
else if (sizeof(__huge_val) == 12) /* extended precision */ else if (sizeof(__huge_val) == 12) /* extended precision */
{ {
static const unsigned long largest_fp_value[3] = union ieee_long_double * x = (union ieee_long_double *)&__huge_val;
{
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
0x7ffe0000,0xffffffff,0xffffffff
};
static const unsigned long not_a_number[3] = /* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
{ x->raw[0] = 0x7ffe0000;
/* Exponent = 32767 and fraction != 0.0 */ x->raw[1] = 0xffffffff;
0x7fff0000,0xffffffff,0xffffffff x->raw[2] = 0xffffffff;
};
static const unsigned long infinity[3] =
{
/* Exponent = 32767 and fraction = 0.0 */
0x7fff0000,0x00000000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
} }
#endif /* USE_LONG_DOUBLE */ #endif /* USE_LONG_DOUBLE */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_log.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_log.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -244,19 +244,16 @@ log(double x)
{ {
double result; double result;
/* ZZZ when do we consider 'x' to be invalid? If it's close if(x > DBL_EPSILON)
* enough to zero or negative. How large is epsilon, and how
* do we return minus infinity?
*/
if(x > 0.0)
{ {
result = __log(x); result = __log(x);
} }
else else
{ {
/* ZZZ this should be minus infinity */ __set_errno(ERANGE);
result = -HUGE_VAL;
errno = ERANGE; /* This should really be minus infinity. */
result = (-__get_huge_val());
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_log10.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_log10.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -186,19 +186,16 @@ log10(double x)
{ {
double result; double result;
/* ZZZ when do we consider 'x' to be invalid? If it's close if(x > DBL_EPSILON)
* enough to zero or negative. How large is epsilon, and how
* do we return minus infinity?
*/
if(x > 0.0)
{ {
result = __log10(x); result = __log10(x);
} }
else else
{ {
/* ZZZ this should be minus infinity */ __set_errno(ERANGE);
result = -HUGE_VAL;
errno = ERANGE; /* This should really be minus infinity. */
result = (-__get_huge_val());
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_logb.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_logb.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -103,7 +103,7 @@ logb(double x)
if(x == 0.0) if(x == 0.0)
{ {
result = -HUGE_VAL; result = -__get_huge_val();
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_modf.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_modf.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -150,8 +150,9 @@ modf(double x,double *nptr)
{ {
if(nptr == NULL) if(nptr == NULL)
{ {
errno = EFAULT; __set_errno(EFAULT);
result = HUGE_VAL;
result = __get_huge_val();
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_pow.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_pow.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -424,8 +424,9 @@ pow(double x,double y)
if(x == 0.0 && y < 0.0) if(x == 0.0 && y < 0.0)
{ {
result = HUGE_VAL; __set_errno(EDOM);
errno = EDOM;
result = __get_huge_val();
goto out; goto out;
} }
@@ -436,8 +437,9 @@ pow(double x,double y)
abs_y = fabs(y); abs_y = fabs(y);
if(floor(abs_y) != abs_y) if(floor(abs_y) != abs_y)
{ {
result = HUGE_VAL; __set_errno(EDOM);
errno = EDOM;
result = __get_huge_val();
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_sqrt.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $ * $Id: math_sqrt.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -252,7 +252,7 @@ sqrt(double x)
else else
{ {
result = 0; result = 0;
errno = EDOM; __set_errno(EDOM);
} }
return(result); return(result);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: mount_fstatfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: mount_fstatfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
{ {
SHOWMSG("invalid buffer parameter"); SHOWMSG("invalid buffer parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -86,7 +86,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -102,7 +102,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
result = message.result; result = message.result;
if(result != 0) if(result != 0)
{ {
errno = message.error; __set_errno(message.error);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: mount_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: mount_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -42,6 +42,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#include <sys/mount.h> #include <sys/mount.h>
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: mount_statfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: mount_statfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -74,7 +74,7 @@ statfs(const char *path, struct statfs *buf)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -123,7 +123,7 @@ statfs(const char *path, struct statfs *buf)
{ {
SHOWMSG("that didn't work"); SHOWMSG("that didn't work");
__translate_access_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out; goto out;
} }
@@ -135,7 +135,7 @@ statfs(const char *path, struct statfs *buf)
{ {
SHOWMSG("didn't get the info"); SHOWMSG("didn't get the info");
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "net.lib 1.186" #define VERS "net.lib 1.188"
#define VSTRING "net.lib 1.186 (14.1.2005)\r\n" #define VSTRING "net.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: net.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: net.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_kill.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_kill.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -64,7 +64,7 @@ kill(pid_t pid, int signal_number)
{ {
SHOWMSG("didn't find the process"); SHOWMSG("didn't find the process");
errno = ESRCH; __set_errno(ESRCH);
goto out; goto out;
} }
@@ -95,7 +95,7 @@ kill(pid_t pid, int signal_number)
{ {
SHOWMSG("didn't find the process"); SHOWMSG("didn't find the process");
errno = ESRCH; __set_errno(ESRCH);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_raise.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_raise.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -52,7 +52,7 @@ raise(int sig)
{ {
SHOWMSG("unknown signal number"); SHOWMSG("unknown signal number");
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_sigaddset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_sigaddset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -60,7 +60,7 @@ sigaddset(sigset_t * set,int sig)
{ {
if(set == NULL) if(set == NULL)
{ {
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_sigemptyset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_sigemptyset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -60,7 +60,7 @@ sigemptyset(sigset_t * set)
{ {
if(set == NULL) if(set == NULL)
{ {
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_signal.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_signal.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -51,7 +51,7 @@ void (*signal(int sig, void (* handler)(int)))(int)
{ {
SHOWMSG("unsupported signal"); SHOWMSG("unsupported signal");
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_sigprocmask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: signal_sigprocmask.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -56,7 +56,7 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{ {
SHOWMSG("invalid operating mode"); SHOWMSG("invalid operating mode");
errno = EINVAL; __set_errno(EINVAL);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
# _#
# $Id: smakefile,v 1.15 2004-12-26 10:28:56 obarthel Exp $ # $Id: smakefile,v 1.20 2005-02-04 15:03:10 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -190,6 +190,7 @@ MATH_OBJ = \
math_floor.o \ math_floor.o \
math_fmod.o \ math_fmod.o \
math_frexp.o \ math_frexp.o \
math_huge_val.o \
math_hypot.o \ math_hypot.o \
math_init_exit.o \ math_init_exit.o \
math_isinf.o \ math_isinf.o \
@@ -375,6 +376,8 @@ STDLIB_OBJ = \
stdlib_destructor.o \ stdlib_destructor.o \
stdlib_detach.o \ stdlib_detach.o \
stdlib_dosbase.o \ stdlib_dosbase.o \
stdlib_get_errno.o \
stdlib_set_errno.o \
stdlib_sysbase.o \ stdlib_sysbase.o \
stdlib_termination_message.o \ stdlib_termination_message.o \
stdlib_threshold.o \ stdlib_threshold.o \
@@ -471,9 +474,12 @@ TIME_OBJ = \
time_asctime_r.o \ time_asctime_r.o \
time_clock.o \ time_clock.o \
time_converttime.o \ time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \ time_ctime.o \
time_ctime_r.o \ time_ctime_r.o \
time_data.o \ time_data.o \
time_days_per_date.o \
time_difftime.o \ time_difftime.o \
time_gettimeofday.o \ time_gettimeofday.o \
time_gmtime.o \ time_gmtime.o \
@@ -483,7 +489,8 @@ TIME_OBJ = \
time_mktime.o \ time_mktime.o \
time_numbertostring.o \ time_numbertostring.o \
time_strftime.o \ time_strftime.o \
time_time.o time_time.o \
time_weekday.o
UNISTD_OBJ = \ UNISTD_OBJ = \
unistd_access.o \ unistd_access.o \
@@ -494,8 +501,10 @@ UNISTD_OBJ = \
unistd_dup.o \ unistd_dup.o \
unistd_dup2.o \ unistd_dup2.o \
unistd_fchown.o \ unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \ unistd_fdopen.o \
unistd_fileno.o \ unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \ unistd_ftruncate.o \
unistd_getcwd.o \ unistd_getcwd.o \
unistd_getopt.o \ unistd_getopt.o \

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_accept.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: socket_accept.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -71,7 +71,7 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_bind.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: socket_bind.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ bind(int sockfd,struct sockaddr *name,int namelen)
{ {
SHOWMSG("invalid name parameter"); SHOWMSG("invalid name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_connect.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_connect.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ connect(int sockfd,struct sockaddr *name,int namelen)
{ {
SHOWMSG("invalid name parameter"); SHOWMSG("invalid name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_get_descriptor.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_get_descriptor.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -50,13 +50,13 @@ __get_socket_descriptor(int socket_descriptor)
fd = __get_file_descriptor(socket_descriptor); fd = __get_file_descriptor(socket_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET)) if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET))
{ {
errno = ENOTSOCK; __set_errno(ENOTSOCK);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_gethostbyaddr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_gethostbyaddr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -67,7 +67,7 @@ gethostbyaddr(const char *addr, int len, int type)
{ {
SHOWMSG("invalid addr parameter"); SHOWMSG("invalid addr parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_gethostbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_gethostbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -65,7 +65,7 @@ gethostbyname(const char *name)
{ {
SHOWMSG("invalid name parameter"); SHOWMSG("invalid name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_gethostname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_gethostname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -66,7 +66,7 @@ gethostname(const char *hostname,int size)
{ {
SHOWMSG("invalid host name parameter"); SHOWMSG("invalid host name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getnetbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getnetbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -65,7 +65,7 @@ getnetbyname(const char *name)
{ {
SHOWMSG("invalid name parameter"); SHOWMSG("invalid name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getpeername.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getpeername.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ getpeername(int sockfd,struct sockaddr *name,int *namelen)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getprotobyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getprotobyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -63,7 +63,7 @@ getprotobyname(const char *name)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getservbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getservbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -63,7 +63,7 @@ getservbyname(const char *name, const char *proto)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getservbyport.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getservbyport.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -63,7 +63,7 @@ getservbyport(int port, const char *proto)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getsockname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getsockname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ getsockname(int sockfd,struct sockaddr *name,int *namelen)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_getsockopt.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_getsockopt.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ getsockopt(int sockfd,int level,int optname,void *optval,int *optlen)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_headers.h,v 1.4 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,6 +48,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
extern struct Library * NOCOMMON __SocketBase; extern struct Library * NOCOMMON __SocketBase;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_hook_entry.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_hook_entry.c,v 1.6 2005-02-04 15:03:10 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -73,7 +73,7 @@ __socket_hook_entry(
PROFILE_OFF(); PROFILE_OFF();
result = __recv((LONG)fd->fd_DefaultFile,message->data,message->size,0); result = __recv((LONG)fd->fd_DefaultFile,message->data,message->size,0);
error = errno; error = __get_errno();
PROFILE_ON(); PROFILE_ON();
@@ -92,7 +92,7 @@ __socket_hook_entry(
PROFILE_OFF(); PROFILE_OFF();
result = __send((LONG)fd->fd_DefaultFile,message->data,message->size,0); result = __send((LONG)fd->fd_DefaultFile,message->data,message->size,0);
error = errno; error = __get_errno();
PROFILE_ON(); PROFILE_ON();
@@ -141,7 +141,7 @@ __socket_hook_entry(
param = (int)(message->arg == 0); param = (int)(message->arg == 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,&param); result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,&param);
error = errno; error = __get_errno();
break; break;
@@ -152,7 +152,7 @@ __socket_hook_entry(
param = (int)(message->arg != 0); param = (int)(message->arg != 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,&param); result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,&param);
error = errno; error = __get_errno();
break; break;
@@ -174,6 +174,15 @@ __socket_hook_entry(
break; break;
case file_hook_action_flush:
SHOWMSG("file_hook_action_flush attempted on socket");
result = -1;
error = EINVAL;
break;
default: default:
SHOWVALUE(message->action); SHOWVALUE(message->action);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_inet_addr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_inet_addr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -65,7 +65,7 @@ inet_addr(const char *addr)
{ {
SHOWMSG("invalid parameter"); SHOWMSG("invalid parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_inet_aton.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_inet_aton.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -108,7 +108,7 @@ inet_aton(const char *cp, struct in_addr *addr)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
return(0); return(0);
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_inet_network.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_inet_network.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -63,7 +63,7 @@ inet_network(const char *cp)
{ {
SHOWMSG("invalid cp parameter"); SHOWMSG("invalid cp parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_recv.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_recv.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ recv(int sockfd,void *buff,size_t nbytes,int flags)
{ {
SHOWMSG("invalid buffer parameter"); SHOWMSG("invalid buffer parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_recvfrom.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_recvfrom.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -71,7 +71,7 @@ recvfrom(int sockfd,void *buff,int len,int flags,struct sockaddr *from,int *from
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_recvmsg.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_recvmsg.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ recvmsg(int sockfd,struct msghdr *msg,int flags)
{ {
SHOWMSG("invalid msg parameter"); SHOWMSG("invalid msg parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_select.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_select.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -726,7 +726,7 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
PROFILE_ON(); PROFILE_ON();
/* Stop if a break signal arrives. */ /* Stop if a break signal arrives. */
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C)) if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{ {
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C); SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__check_abort(); __check_abort();
@@ -837,7 +837,7 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
result = __WaitSelect(total_socket_fd,socket_read_fds,socket_write_fds,socket_except_fds,timeout,&break_mask); result = __WaitSelect(total_socket_fd,socket_read_fds,socket_write_fds,socket_except_fds,timeout,&break_mask);
PROFILE_ON(); PROFILE_ON();
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C)) if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{ {
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C); SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__check_abort(); __check_abort();

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_send.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_send.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ send(int sockfd,const void *buff,size_t nbytes,int flags)
{ {
SHOWMSG("invalid buffer parameter"); SHOWMSG("invalid buffer parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_sendmsg.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_sendmsg.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -68,7 +68,7 @@ sendmsg(int sockfd,struct msghdr *msg,int flags)
{ {
SHOWMSG("invalid msg parameter"); SHOWMSG("invalid msg parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_sendto.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_sendto.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -71,7 +71,7 @@ sendto(int sockfd,const void *buff,int len,int flags,struct sockaddr *to,int tol
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_setsockopt.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: socket_setsockopt.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ setsockopt(int sockfd,int level,int optname,const void *optval,int optlen)
{ {
SHOWMSG("invalid optval parameter"); SHOWMSG("invalid optval parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,6 +1,6 @@
#define VERSION 1 #define VERSION 1
#define REVISION 186 #define REVISION 188
#define DATE "14.1.2005" #define DATE "7.2.2005"
#define VERS "stack.lib 1.186" #define VERS "stack.lib 1.188"
#define VSTRING "stack.lib 1.186 (14.1.2005)\r\n" #define VSTRING "stack.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: stack.lib 1.186 (14.1.2005)" #define VERSTAG "\0$VER: stack.lib 1.188 (7.2.2005)"

View File

@@ -1 +1 @@
186 188

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_chmod.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_chmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ chmod(const char * path_name, mode_t mode)
{ {
SHOWMSG("invalid path parameter"); SHOWMSG("invalid path parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -88,7 +88,7 @@ chmod(const char * path_name, mode_t mode)
if(path_name_nti.is_root) if(path_name_nti.is_root)
{ {
errno = EACCES; __set_errno(EACCES);
goto out; goto out;
} }
} }
@@ -142,7 +142,7 @@ chmod(const char * path_name, mode_t mode)
if(status == DOSFALSE) if(status == DOSFALSE)
{ {
__translate_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_io_error_to_errno(IoErr()));
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_convertfileinfo.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_convertfileinfo.c,v 1.6 2005-01-30 09:37:59 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -39,6 +39,10 @@
#include "locale_headers.h" #include "locale_headers.h"
#endif /* _LOCALE_HEADERS_H */ #endif /* _LOCALE_HEADERS_H */
#ifndef _TIME_HEADERS_H
#include "time_headers.h"
#endif /* _TIME_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
void void
@@ -109,9 +113,7 @@ __convert_file_info_to_stat(
if(FLAG_IS_SET(flags,FIBF_OTR_EXECUTE)) if(FLAG_IS_SET(flags,FIBF_OTR_EXECUTE))
SET_FLAG(mode,S_IXOTH); SET_FLAG(mode,S_IXOTH);
mtime = UNIX_TIME_OFFSET + fib->fib_Date.ds_Days * 24*60*60 + fib->fib_Date.ds_Minute * 60 + (fib->fib_Date.ds_Tick / TICKS_PER_SECOND); mtime = __convert_datestamp_to_time(&fib->fib_Date);
if(__default_locale != NULL)
mtime += 60 * __default_locale->loc_GMTOffset;
if(fib->fib_DirEntryType < 0) if(fib->fib_DirEntryType < 0)
{ {
@@ -127,8 +129,8 @@ __convert_file_info_to_stat(
st->st_dev = (dev_t)file_system; st->st_dev = (dev_t)file_system;
st->st_mode = mode; st->st_mode = mode;
st->st_mtime = mtime; st->st_mtime = mtime;
st->st_atime = st->st_mtime; st->st_atime = mtime;
st->st_ctime = st->st_mtime; st->st_ctime = mtime;
st->st_uid = fib->fib_OwnerUID; st->st_uid = fib->fib_OwnerUID;
st->st_gid = fib->fib_OwnerGID; st->st_gid = fib->fib_OwnerGID;
st->st_blksize = 512; st->st_blksize = 512;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_fchmod.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_fchmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -67,7 +67,7 @@ fchmod(int file_descriptor, mode_t mode)
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -118,8 +118,9 @@ fchmod(int file_descriptor, mode_t mode)
CallHookPkt(fd->fd_Hook,fd,&message); CallHookPkt(fd->fd_Hook,fd,&message);
result = message.result; result = message.result;
errno = message.error;
__set_errno(message.error);
out: out:

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_fstat.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_fstat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ fstat(int file_descriptor, struct stat * buffer)
{ {
SHOWMSG("invalid buffer parameter"); SHOWMSG("invalid buffer parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -86,7 +86,7 @@ fstat(int file_descriptor, struct stat * buffer)
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
errno = EBADF; __set_errno(EBADF);
goto out; goto out;
} }
@@ -103,7 +103,7 @@ fstat(int file_descriptor, struct stat * buffer)
result = message.result; result = message.result;
if(result != 0) if(result != 0)
{ {
errno = message.error; __set_errno(message.error);
goto out; goto out;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_headers.h,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -42,6 +42,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
extern mode_t NOCOMMON __current_umask; extern mode_t NOCOMMON __current_umask;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_lstat.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_lstat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -65,7 +65,7 @@ lstat(const char * path_name, struct stat * buffer)
{ {
SHOWMSG("invalid parameters"); SHOWMSG("invalid parameters");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_mkdir.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $ * $Id: stat_mkdir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -70,7 +70,7 @@ mkdir(const char * path_name, mode_t mode)
{ {
SHOWMSG("invalid path name parameter"); SHOWMSG("invalid path name parameter");
errno = EFAULT; __set_errno(EFAULT);
goto out; goto out;
} }
} }
@@ -88,7 +88,7 @@ mkdir(const char * path_name, mode_t mode)
if(path_name_nti.is_root) if(path_name_nti.is_root)
{ {
errno = EACCES; __set_errno(EACCES);
goto out; goto out;
} }
} }
@@ -105,7 +105,7 @@ mkdir(const char * path_name, mode_t mode)
{ {
SHOWMSG("that didn't work"); SHOWMSG("that didn't work");
__translate_access_io_error_to_errno(IoErr(),&errno); __set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out; goto out;
} }

Some files were not shown because too many files have changed in this diff Show More