mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eca85e071b |
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.68k,v 1.26 2005-02-07 10:52:16 obarthel Exp $
|
||||
# $Id: GNUmakefile.68k,v 1.20 2005-01-14 09:07:16 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@@ -100,7 +100,7 @@ endif
|
||||
|
||||
WARNINGS = \
|
||||
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
|
||||
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
|
||||
-Wundef -Wbad-function-cast -Wmissing-declarations
|
||||
|
||||
# -Wconversion -Wshadow
|
||||
|
||||
@@ -108,7 +108,7 @@ INCLUDES = -Iinclude -I. -Inetinclude
|
||||
OPTIONS = -DNDEBUG -fno-builtin
|
||||
#OPTIONS = -D__MEM_DEBUG -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
|
||||
#DEBUG = -g2
|
||||
|
||||
@@ -272,7 +272,6 @@ C_LIB = \
|
||||
stdlib_dosbase.o \
|
||||
stdlib_exit.o \
|
||||
stdlib_free.o \
|
||||
stdlib_get_errno.o \
|
||||
stdlib_getdefstacksize.o \
|
||||
stdlib_getenv.o \
|
||||
stdlib_getsp.o \
|
||||
@@ -299,7 +298,6 @@ C_LIB = \
|
||||
stdlib_realloc.o \
|
||||
stdlib_red_black.o \
|
||||
stdlib_setenv.o \
|
||||
stdlib_set_errno.o \
|
||||
stdlib_setjmp.o \
|
||||
stdlib_set_process_window.o \
|
||||
stdlib_shell_escape.o \
|
||||
@@ -365,12 +363,9 @@ C_LIB = \
|
||||
time_asctime_r.o \
|
||||
time_clock.o \
|
||||
time_converttime.o \
|
||||
time_convert_datestamp.o \
|
||||
time_convert_time.o \
|
||||
time_ctime.o \
|
||||
time_ctime_r.o \
|
||||
time_data.o \
|
||||
time_days_per_date.o \
|
||||
time_gettimeofday.o \
|
||||
time_gmtime.o \
|
||||
time_gmtime_r.o \
|
||||
@@ -380,7 +375,6 @@ C_LIB = \
|
||||
time_numbertostring.o \
|
||||
time_strftime.o \
|
||||
time_time.o \
|
||||
time_weekday.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@@ -389,10 +383,8 @@ C_LIB = \
|
||||
unistd_dup.o \
|
||||
unistd_dup2.o \
|
||||
unistd_fchown.o \
|
||||
unistd_fdatasync.o \
|
||||
unistd_fdopen.o \
|
||||
unistd_fileno.o \
|
||||
unistd_fsync.o \
|
||||
unistd_ftruncate.o \
|
||||
unistd_getcwd.o \
|
||||
unistd_getopt.o \
|
||||
@@ -479,7 +471,6 @@ MATH_LIB = \
|
||||
math_floor.o \
|
||||
math_fmod.o \
|
||||
math_frexp.o \
|
||||
math_huge_val.o \
|
||||
math_hypot.o \
|
||||
math_init_exit.o \
|
||||
math_isinf.o \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.os4,v 1.26 2005-02-07 10:52:16 obarthel Exp $
|
||||
# $Id: GNUmakefile.os4,v 1.20 2005-01-10 00:56:15 theantony Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@@ -105,10 +105,8 @@ endif
|
||||
##############################################################################
|
||||
|
||||
WARNINGS = \
|
||||
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
|
||||
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
|
||||
|
||||
# -Wconversion -Wshadow
|
||||
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
|
||||
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
|
||||
|
||||
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
|
||||
OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
|
||||
@@ -277,7 +275,6 @@ C_LIB = \
|
||||
stdlib_exit.o \
|
||||
stdlib_free.o \
|
||||
stdlib_getdefstacksize.o \
|
||||
stdlib_get_errno.o \
|
||||
stdlib_getenv.o \
|
||||
stdlib_getsp.o \
|
||||
stdlib_init_exit.o \
|
||||
@@ -302,7 +299,6 @@ C_LIB = \
|
||||
stdlib_rand.o \
|
||||
stdlib_realloc.o \
|
||||
stdlib_red_black.o \
|
||||
stdlib_set_errno.o \
|
||||
stdlib_setenv.o \
|
||||
stdlib_setjmp.o \
|
||||
stdlib_set_process_window.o \
|
||||
@@ -369,12 +365,9 @@ C_LIB = \
|
||||
time_asctime_r.o \
|
||||
time_clock.o \
|
||||
time_converttime.o \
|
||||
time_convert_datestamp.o \
|
||||
time_convert_time.o \
|
||||
time_ctime.o \
|
||||
time_ctime_r.o \
|
||||
time_data.o \
|
||||
time_days_per_date.o \
|
||||
time_gettimeofday.o \
|
||||
time_gmtime.o \
|
||||
time_gmtime_r.o \
|
||||
@@ -384,7 +377,6 @@ C_LIB = \
|
||||
time_numbertostring.o \
|
||||
time_strftime.o \
|
||||
time_time.o \
|
||||
time_weekday.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@@ -393,10 +385,8 @@ C_LIB = \
|
||||
unistd_dup.o \
|
||||
unistd_dup2.o \
|
||||
unistd_fchown.o \
|
||||
unistd_fdatasync.o \
|
||||
unistd_fdopen.o \
|
||||
unistd_fileno.o \
|
||||
unistd_fsync.o \
|
||||
unistd_ftruncate.o \
|
||||
unistd_getcwd.o \
|
||||
unistd_getopt.o \
|
||||
@@ -485,7 +475,6 @@ MATH_LIB = \
|
||||
math_floor.o \
|
||||
math_fmod.o \
|
||||
math_frexp.o \
|
||||
math_huge_val.o \
|
||||
math_hypot.o \
|
||||
math_init_exit.o \
|
||||
math_isnan.o \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "amiga.lib 1.188"
|
||||
#define VSTRING "amiga.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "amiga.lib 1.186"
|
||||
#define VSTRING "amiga.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "c.lib 1.188"
|
||||
#define VSTRING "c.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "c.lib 1.186"
|
||||
#define VSTRING "c.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,86 +1,3 @@
|
||||
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)
|
||||
|
||||
- Redirecting stderr to a file no longer has the effect of showing error
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "debug.lib 1.188"
|
||||
#define VSTRING "debug.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "debug.lib 1.186"
|
||||
#define VSTRING "debug.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_closedir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: dirent_closedir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -63,7 +63,7 @@ closedir(DIR * directory_pointer)
|
||||
|
||||
if(directory_pointer == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ closedir(DIR * directory_pointer)
|
||||
|
||||
if(NOT directory_pointer_is_valid)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -94,12 +94,8 @@ closedir(DIR * directory_pointer)
|
||||
|
||||
Remove((struct Node *)dh);
|
||||
|
||||
#if defined(UNIX_PATH_SEMANTICS)
|
||||
{
|
||||
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
|
||||
while((node = RemHead(&dh->dh_VolumeList)) != NULL)
|
||||
free(node);
|
||||
}
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
PROFILE_OFF();
|
||||
UnLock(dh->dh_DirLock);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: dirent_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -42,12 +42,6 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
@@ -60,10 +54,9 @@ struct DirectoryHandle
|
||||
BPTR dh_DirLock;
|
||||
struct FileInfoBlock dh_FileInfo;
|
||||
struct dirent dh_DirectoryEntry;
|
||||
|
||||
int dh_Position;
|
||||
struct Node * dh_VolumeNode;
|
||||
struct MinList dh_VolumeList;
|
||||
struct List dh_VolumeList;
|
||||
BOOL dh_ScanVolumeList;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_opendir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: dirent_opendir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -106,7 +106,7 @@ opendir(const char * path_name)
|
||||
{
|
||||
SHOWMSG("invalid parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -121,10 +121,10 @@ opendir(const char * path_name)
|
||||
|
||||
memset(dh,0,sizeof(*dh));
|
||||
|
||||
NewList(&dh->dh_VolumeList);
|
||||
|
||||
#if defined(UNIX_PATH_SEMANTICS)
|
||||
{
|
||||
NewList((struct List *)&dh->dh_VolumeList);
|
||||
|
||||
if(__unix_path_semantics)
|
||||
{
|
||||
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);
|
||||
|
||||
__set_errno(ENOMEM);
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ opendir(const char * path_name)
|
||||
/* Check if the name is already on the list. Mind you,
|
||||
this is not the most sophisticated algorithm but then
|
||||
the number of volumes should be small. */
|
||||
if(find_by_name((struct List *)&dh->dh_VolumeList,node->ln_Name) != NULL)
|
||||
if(find_by_name(&dh->dh_VolumeList,node->ln_Name) != NULL)
|
||||
{
|
||||
free(node);
|
||||
continue;
|
||||
@@ -180,16 +180,16 @@ opendir(const char * path_name)
|
||||
|
||||
D(("adding '%s'",node->ln_Name));
|
||||
|
||||
AddTail((struct List *)&dh->dh_VolumeList,node);
|
||||
AddTail(&dh->dh_VolumeList,node);
|
||||
}
|
||||
}
|
||||
|
||||
UnLockDosList(LDF_VOLUMES|LDF_READ);
|
||||
|
||||
/* Bail out if we cannot present anything. */
|
||||
if(IsListEmpty((struct List *)&dh->dh_VolumeList))
|
||||
if(IsListEmpty(&dh->dh_VolumeList))
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ opendir(const char * path_name)
|
||||
{
|
||||
SHOWMSG("couldn't get a lock on it");
|
||||
|
||||
__set_errno(__translate_access_io_error_to_errno(IoErr()));
|
||||
__translate_access_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ opendir(const char * path_name)
|
||||
{
|
||||
SHOWMSG("couldn't examine it");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ opendir(const char * path_name)
|
||||
{
|
||||
SHOWMSG("this isn't a directory");
|
||||
|
||||
__set_errno(ENOTDIR);
|
||||
errno = ENOTDIR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -254,12 +254,8 @@ opendir(const char * path_name)
|
||||
{
|
||||
SHOWMSG("ouch. cleaning up");
|
||||
|
||||
#if defined(UNIX_PATH_SEMANTICS)
|
||||
{
|
||||
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
|
||||
while((node = RemHead(&dh->dh_VolumeList)) != NULL)
|
||||
free(node);
|
||||
}
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
PROFILE_OFF();
|
||||
UnLock(dh->dh_DirLock);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_readdir.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: dirent_readdir.c,v 1.5 2005-01-09 15:58:02 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -61,7 +61,7 @@ readdir(DIR * directory_pointer)
|
||||
{
|
||||
SHOWMSG("ouch. invalid parameter");
|
||||
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ readdir(DIR * directory_pointer)
|
||||
|
||||
assert( (((ULONG)name) & 3) == 0 );
|
||||
|
||||
if(dh->dh_VolumeNode == NULL && NOT IsListEmpty((struct List *)&dh->dh_VolumeList))
|
||||
dh->dh_VolumeNode = (struct Node *)dh->dh_VolumeList.mlh_Head;
|
||||
if(dh->dh_VolumeNode == NULL && NOT IsListEmpty(&dh->dh_VolumeList))
|
||||
dh->dh_VolumeNode = dh->dh_VolumeList.lh_Head;
|
||||
|
||||
strcpy(name,"\1:"); /* BSTR for ":" */
|
||||
|
||||
@@ -164,7 +164,7 @@ readdir(DIR * directory_pointer)
|
||||
{
|
||||
if(CANNOT Examine(parent_directory,fib))
|
||||
{
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ readdir(DIR * directory_pointer)
|
||||
{
|
||||
SHOWMSG("error scanning directory");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_rewinddir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: dirent_rewinddir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -76,7 +76,7 @@ rewinddir(DIR * directory_pointer)
|
||||
if(CANNOT Examine(dh->dh_DirLock,&dh->dh_FileInfo))
|
||||
{
|
||||
SHOWMSG("ouch. that didn't work");
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_close.c,v 1.8 2005-02-04 08:49:10 obarthel Exp $
|
||||
* $Id: fcntl_close.c,v 1.6 2005-01-14 08:36:54 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -133,12 +133,13 @@ __close(int file_descriptor,int * error_ptr)
|
||||
for aliases and their like since the original stream is still in use. */
|
||||
if(NOT is_alias)
|
||||
{
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING))
|
||||
if((FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING) && FLAG_IS_CLEAR(fd->fd_Flags,FDF_DEFAULT_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");
|
||||
|
||||
message.action = file_hook_action_set_blocking;
|
||||
message.arg = TRUE;
|
||||
message.arg = FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING);
|
||||
|
||||
assert( fd->fd_Hook != NULL );
|
||||
|
||||
@@ -177,12 +178,10 @@ int
|
||||
close(int file_descriptor)
|
||||
{
|
||||
int result;
|
||||
int error;
|
||||
|
||||
ENTER();
|
||||
|
||||
result = __close(file_descriptor,&error);
|
||||
__set_errno(error);
|
||||
result = __close(file_descriptor,&errno);
|
||||
|
||||
RETURN(result);
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_creat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_creat.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -66,7 +66,7 @@ creat(const char * path_name, mode_t mode)
|
||||
{
|
||||
if(path_name == NULL)
|
||||
{
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_fcntl.c,v 1.6 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_fcntl.c,v 1.5 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -71,7 +71,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
SHOWMSG("invalid flock type");
|
||||
va_end(arg);
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
SHOWMSG("invalid flock offset");
|
||||
va_end(arg);
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
CallHookPkt(fd->fd_Hook,fd,&message);
|
||||
|
||||
result = message.result;
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
|
||||
va_end(arg);
|
||||
|
||||
@@ -159,7 +159,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
result = message.result;
|
||||
if(result < 0)
|
||||
{
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
|
||||
va_end(arg);
|
||||
goto out;
|
||||
@@ -184,7 +184,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
result = message.result;
|
||||
if(result < 0)
|
||||
{
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
|
||||
va_end(arg);
|
||||
goto out;
|
||||
@@ -210,7 +210,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
|
||||
if(fdbase < 0)
|
||||
{
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -257,14 +257,14 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
goto out;
|
||||
}
|
||||
|
||||
__set_errno(EMFILE);
|
||||
errno = EMFILE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
SHOWMSG("something else");
|
||||
|
||||
__set_errno(ENOSYS);
|
||||
errno = ENOSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_get_default_file.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -55,7 +55,7 @@ __get_default_file(int file_descriptor,long * file_ptr)
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -42,10 +42,4 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _FCNTL_HEADERS_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_lseek.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_lseek.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -115,12 +115,10 @@ off_t
|
||||
lseek(int file_descriptor, off_t offset, int mode)
|
||||
{
|
||||
off_t result;
|
||||
int error;
|
||||
|
||||
ENTER();
|
||||
|
||||
result = __lseek(file_descriptor,offset,mode,&error);
|
||||
__set_errno(error);
|
||||
result = __lseek(file_descriptor,offset,mode,&errno);
|
||||
|
||||
RETURN(result);
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_open.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_open.c,v 1.7 2005-01-09 16:07:27 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -123,7 +123,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("path name is invalid");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("access mode is invalid");
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
|
||||
if(path_name_nti.is_root)
|
||||
{
|
||||
__set_errno(EACCES);
|
||||
errno = EACCES;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("the file already exists");
|
||||
|
||||
__set_errno(EEXIST);
|
||||
errno = EEXIST;
|
||||
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");
|
||||
|
||||
__set_errno(ENOTDIR);
|
||||
errno = ENOTDIR;
|
||||
goto out;
|
||||
}
|
||||
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
|
||||
{
|
||||
SHOWMSG("error accessing the object");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("could not examine the object");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("can't open a directory");
|
||||
|
||||
__set_errno(EISDIR);
|
||||
errno = EISDIR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
{
|
||||
SHOWMSG("this object is not write enabled");
|
||||
|
||||
__set_errno(EACCES);
|
||||
errno = EACCES;
|
||||
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");
|
||||
|
||||
__set_errno(ENOTDIR);
|
||||
errno = ENOTDIR;
|
||||
goto out;
|
||||
}
|
||||
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
|
||||
{
|
||||
SHOWMSG("error accessing the object");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -305,7 +305,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
LONG io_err = IoErr();
|
||||
|
||||
D(("the file '%s' didn't open in mode %ld",path_name,open_mode));
|
||||
__set_errno(__translate_access_io_error_to_errno(io_err));
|
||||
__translate_access_io_error_to_errno(IoErr(),&errno);
|
||||
|
||||
/* Check if ended up trying to open a directory as if
|
||||
it were a plain file. */
|
||||
@@ -317,7 +317,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
if(lock != ZERO)
|
||||
{
|
||||
if(Examine(lock,fib) && fib->fib_DirEntryType >= 0)
|
||||
__set_errno(EISDIR);
|
||||
errno = EISDIR;
|
||||
}
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_read.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_read.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -136,12 +136,10 @@ ssize_t
|
||||
read(int file_descriptor, void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t result;
|
||||
int error;
|
||||
|
||||
ENTER();
|
||||
|
||||
result = __read(file_descriptor,buffer,num_bytes,&error);
|
||||
__set_errno(error);
|
||||
result = __read(file_descriptor,buffer,num_bytes,&errno);
|
||||
|
||||
RETURN(result);
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_write.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_write.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -136,12 +136,10 @@ ssize_t
|
||||
write(int file_descriptor, const void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t result;
|
||||
int error;
|
||||
|
||||
ENTER();
|
||||
|
||||
result = __write(file_descriptor,buffer,num_bytes,&error);
|
||||
__set_errno(error);
|
||||
result = __write(file_descriptor,buffer,num_bytes,&errno);
|
||||
|
||||
RETURN(result);
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dos.h,v 1.7 2005-02-03 17:33:54 obarthel Exp $
|
||||
* $Id: dos.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -66,26 +66,6 @@ extern "C" {
|
||||
* ISO 'C' standard context. It is redefined to WBenchMsg to make it
|
||||
* compatible with the original Amiga program startup code which would
|
||||
* 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;
|
||||
#define WBenchMsg __WBenchMsg
|
||||
@@ -298,7 +278,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 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_io_error_to_errno(LONG io_error);
|
||||
extern void __translate_io_error_to_errno(LONG io_error,int * errno_ptr);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,296 +0,0 @@
|
||||
/*
|
||||
* $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 */
|
||||
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* $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 */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib.h,v 1.6 2005-01-30 09:48:06 obarthel Exp $
|
||||
* $Id: stdlib.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -149,12 +149,8 @@ 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 unsigned long long strtoull(const char *str, char **ptr, int base);
|
||||
#endif /* __SASC */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: unistd.h,v 1.9 2005-02-04 15:03:14 obarthel Exp $
|
||||
* $Id: unistd.h,v 1.8 2005-01-02 09:07:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -98,8 +98,6 @@ extern void usleep(unsigned long microseconds);
|
||||
extern int getopt(int argc, char * argv[], char *opts);
|
||||
extern pid_t getpid(void);
|
||||
extern char *realpath(const char *file_name, char *resolved_name);
|
||||
extern int fsync(int file_descriptor);
|
||||
extern int fdatasync(int file_descriptor);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: locale_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: locale_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -53,9 +53,9 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
#ifndef _STDLIB_LOCALE_UTILITY_H
|
||||
#include "stdlib_locale_utility.h"
|
||||
#endif /* _STDLIB_LOCALE_UTILITY_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: locale_setlocale.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: locale_setlocale.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -56,7 +56,7 @@ setlocale(int category, const char *locale)
|
||||
{
|
||||
SHOWMSG("invalid category");
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ setlocale(int category, const char *locale)
|
||||
{
|
||||
SHOWMSG("locale name is too long");
|
||||
|
||||
__set_errno(ENAMETOOLONG);
|
||||
errno = ENAMETOOLONG;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ setlocale(int category, const char *locale)
|
||||
{
|
||||
SHOWMSG("couldn't open the locale");
|
||||
|
||||
__set_errno(ENOENT);
|
||||
errno = ENOENT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "m.lib 1.188"
|
||||
#define VSTRING "m.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: m.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "m.lib 1.186"
|
||||
#define VSTRING "m.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: m.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "m881.lib 1.188"
|
||||
#define VSTRING "m881.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: m881.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "m881.lib 1.186"
|
||||
#define VSTRING "m881.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: m881.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: macros.h,v 1.8 2005-01-30 09:37:59 obarthel Exp $
|
||||
* $Id: macros.h,v 1.5 2005-01-12 09:15:50 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -60,6 +60,14 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define UNIX_TIME_OFFSET 252460800
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MILLION (1000000)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0]))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_acos.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_acos.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -227,7 +227,7 @@ acos(double x)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_asin.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_asin.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -238,7 +238,7 @@ asin(double x)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_atan2.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_atan2.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -108,7 +108,7 @@ __atan2(double y,double x)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ __atan2(double y,double x)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_ceil.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
|
||||
* $Id: math_ceil.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -150,6 +150,7 @@ __ceil(double x)
|
||||
|
||||
#if defined(PPC_FLOATING_POINT_SUPPORT)
|
||||
|
||||
|
||||
static const double huge = 1.0e300;
|
||||
|
||||
INLINE static const double
|
||||
@@ -232,7 +233,6 @@ __ceil(double x)
|
||||
}
|
||||
|
||||
#endif /* PPC_FLOATING_POINT_SUPPORT */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
double
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_cos.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
|
||||
* $Id: math_cos.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -172,7 +172,6 @@ __cos(double x)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PPC_FLOATING_POINT_SUPPORT */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_data.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_data.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -48,3 +48,5 @@ struct Library * MathIeeeDoubTransBase;
|
||||
/****************************************************************************/
|
||||
|
||||
double __huge_val;
|
||||
double __not_a_number;
|
||||
double __infinity;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_fmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_fmod.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -285,7 +285,7 @@ fmod(double x,double y)
|
||||
else
|
||||
{
|
||||
result = x;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_frexp.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_frexp.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -189,9 +189,8 @@ frexp(double x,int *nptr)
|
||||
{
|
||||
if(nptr == NULL)
|
||||
{
|
||||
__set_errno(EFAULT);
|
||||
|
||||
result = __get_huge_val();
|
||||
result = HUGE_VAL;
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_headers.h,v 1.6 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_headers.h,v 1.5 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -192,14 +192,8 @@ extern double __scalbn(double x, int n);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* math_huge_val.c */
|
||||
double __get_huge_val(void);
|
||||
extern double __not_a_number;
|
||||
extern double __infinity;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $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);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_init_exit.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_init_exit.c,v 1.6 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -127,28 +127,82 @@ __math_init(void)
|
||||
the largest representable floating point value. */
|
||||
if(sizeof(__huge_val) == 4) /* single precision */
|
||||
{
|
||||
union ieee_single * x = (union ieee_single *)&__huge_val;
|
||||
|
||||
static const unsigned long largest_fp_value[1] =
|
||||
{
|
||||
/* Exponent = +126, Mantissa = 8,388,607 */
|
||||
x->raw[0] = 0x7f7fffff;
|
||||
0x7f7fffff
|
||||
};
|
||||
|
||||
static const unsigned long not_a_number[1] =
|
||||
{
|
||||
/* 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 */
|
||||
{
|
||||
union ieee_double * x = (union ieee_double *)&__huge_val;
|
||||
|
||||
static const unsigned long largest_fp_value[2] =
|
||||
{
|
||||
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
|
||||
x->raw[0] = 0x7fefffff;
|
||||
x->raw[1] = 0xffffffff;
|
||||
0x7fefffff,0xffffffff
|
||||
};
|
||||
|
||||
static const unsigned long not_a_number[2] =
|
||||
{
|
||||
/* Exponent = 2047 and fraction != 0.0 */
|
||||
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)
|
||||
else if (sizeof(__huge_val) == 12) /* extended precision */
|
||||
{
|
||||
union ieee_long_double * x = (union ieee_long_double *)&__huge_val;
|
||||
|
||||
static const unsigned long largest_fp_value[3] =
|
||||
{
|
||||
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
|
||||
x->raw[0] = 0x7ffe0000;
|
||||
x->raw[1] = 0xffffffff;
|
||||
x->raw[2] = 0xffffffff;
|
||||
0x7ffe0000,0xffffffff,0xffffffff
|
||||
};
|
||||
|
||||
static const unsigned long not_a_number[3] =
|
||||
{
|
||||
/* Exponent = 32767 and fraction != 0.0 */
|
||||
0x7fff0000,0xffffffff,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 */
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_log.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_log.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -244,16 +244,19 @@ log(double x)
|
||||
{
|
||||
double result;
|
||||
|
||||
if(x > DBL_EPSILON)
|
||||
/* ZZZ when do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative. How large is epsilon, and how
|
||||
* do we return minus infinity?
|
||||
*/
|
||||
if(x > 0.0)
|
||||
{
|
||||
result = __log(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
__set_errno(ERANGE);
|
||||
|
||||
/* This should really be minus infinity. */
|
||||
result = (-__get_huge_val());
|
||||
/* ZZZ this should be minus infinity */
|
||||
result = -HUGE_VAL;
|
||||
errno = ERANGE;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_log10.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_log10.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -186,16 +186,19 @@ log10(double x)
|
||||
{
|
||||
double result;
|
||||
|
||||
if(x > DBL_EPSILON)
|
||||
/* ZZZ when do we consider 'x' to be invalid? If it's close
|
||||
* enough to zero or negative. How large is epsilon, and how
|
||||
* do we return minus infinity?
|
||||
*/
|
||||
if(x > 0.0)
|
||||
{
|
||||
result = __log10(x);
|
||||
}
|
||||
else
|
||||
{
|
||||
__set_errno(ERANGE);
|
||||
|
||||
/* This should really be minus infinity. */
|
||||
result = (-__get_huge_val());
|
||||
/* ZZZ this should be minus infinity */
|
||||
result = -HUGE_VAL;
|
||||
errno = ERANGE;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_logb.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_logb.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -103,7 +103,7 @@ logb(double x)
|
||||
|
||||
if(x == 0.0)
|
||||
{
|
||||
result = -__get_huge_val();
|
||||
result = -HUGE_VAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_modf.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_modf.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -150,9 +150,8 @@ modf(double x,double *nptr)
|
||||
{
|
||||
if(nptr == NULL)
|
||||
{
|
||||
__set_errno(EFAULT);
|
||||
|
||||
result = __get_huge_val();
|
||||
errno = EFAULT;
|
||||
result = HUGE_VAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_pow.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_pow.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -424,9 +424,8 @@ pow(double x,double y)
|
||||
|
||||
if(x == 0.0 && y < 0.0)
|
||||
{
|
||||
__set_errno(EDOM);
|
||||
|
||||
result = __get_huge_val();
|
||||
result = HUGE_VAL;
|
||||
errno = EDOM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -437,9 +436,8 @@ pow(double x,double y)
|
||||
abs_y = fabs(y);
|
||||
if(floor(abs_y) != abs_y)
|
||||
{
|
||||
__set_errno(EDOM);
|
||||
|
||||
result = __get_huge_val();
|
||||
result = HUGE_VAL;
|
||||
errno = EDOM;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_sqrt.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: math_sqrt.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -252,7 +252,7 @@ sqrt(double x)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
__set_errno(EDOM);
|
||||
errno = EDOM;
|
||||
}
|
||||
|
||||
return(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mount_fstatfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: mount_fstatfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
|
||||
{
|
||||
SHOWMSG("invalid buffer parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
|
||||
result = message.result;
|
||||
if(result != 0)
|
||||
{
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mount_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: mount_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -42,12 +42,6 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <sys/mount.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mount_statfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: mount_statfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -74,7 +74,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
SHOWMSG("that didn't work");
|
||||
|
||||
__set_errno(__translate_access_io_error_to_errno(IoErr()));
|
||||
__translate_access_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
SHOWMSG("didn't get the info");
|
||||
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "net.lib 1.188"
|
||||
#define VSTRING "net.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: net.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "net.lib 1.186"
|
||||
#define VSTRING "net.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: net.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_kill.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_kill.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -64,7 +64,7 @@ kill(pid_t pid, int signal_number)
|
||||
{
|
||||
SHOWMSG("didn't find the process");
|
||||
|
||||
__set_errno(ESRCH);
|
||||
errno = ESRCH;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ kill(pid_t pid, int signal_number)
|
||||
{
|
||||
SHOWMSG("didn't find the process");
|
||||
|
||||
__set_errno(ESRCH);
|
||||
errno = ESRCH;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_raise.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_raise.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -52,7 +52,7 @@ raise(int sig)
|
||||
{
|
||||
SHOWMSG("unknown signal number");
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigaddset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigaddset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -60,7 +60,7 @@ sigaddset(sigset_t * set,int sig)
|
||||
{
|
||||
if(set == NULL)
|
||||
{
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigemptyset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigemptyset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -60,7 +60,7 @@ sigemptyset(sigset_t * set)
|
||||
{
|
||||
if(set == NULL)
|
||||
{
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_signal.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_signal.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -51,7 +51,7 @@ void (*signal(int sig, void (* handler)(int)))(int)
|
||||
{
|
||||
SHOWMSG("unsupported signal");
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigprocmask.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigprocmask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -56,7 +56,7 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oset)
|
||||
{
|
||||
SHOWMSG("invalid operating mode");
|
||||
|
||||
__set_errno(EINVAL);
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
_#
|
||||
# $Id: smakefile,v 1.20 2005-02-04 15:03:10 obarthel Exp $
|
||||
#
|
||||
# $Id: smakefile,v 1.15 2004-12-26 10:28:56 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@@ -190,7 +190,6 @@ MATH_OBJ = \
|
||||
math_floor.o \
|
||||
math_fmod.o \
|
||||
math_frexp.o \
|
||||
math_huge_val.o \
|
||||
math_hypot.o \
|
||||
math_init_exit.o \
|
||||
math_isinf.o \
|
||||
@@ -376,8 +375,6 @@ STDLIB_OBJ = \
|
||||
stdlib_destructor.o \
|
||||
stdlib_detach.o \
|
||||
stdlib_dosbase.o \
|
||||
stdlib_get_errno.o \
|
||||
stdlib_set_errno.o \
|
||||
stdlib_sysbase.o \
|
||||
stdlib_termination_message.o \
|
||||
stdlib_threshold.o \
|
||||
@@ -474,12 +471,9 @@ TIME_OBJ = \
|
||||
time_asctime_r.o \
|
||||
time_clock.o \
|
||||
time_converttime.o \
|
||||
time_convert_datestamp.o \
|
||||
time_convert_time.o \
|
||||
time_ctime.o \
|
||||
time_ctime_r.o \
|
||||
time_data.o \
|
||||
time_days_per_date.o \
|
||||
time_difftime.o \
|
||||
time_gettimeofday.o \
|
||||
time_gmtime.o \
|
||||
@@ -489,8 +483,7 @@ TIME_OBJ = \
|
||||
time_mktime.o \
|
||||
time_numbertostring.o \
|
||||
time_strftime.o \
|
||||
time_time.o \
|
||||
time_weekday.o
|
||||
time_time.o
|
||||
|
||||
UNISTD_OBJ = \
|
||||
unistd_access.o \
|
||||
@@ -501,10 +494,8 @@ UNISTD_OBJ = \
|
||||
unistd_dup.o \
|
||||
unistd_dup2.o \
|
||||
unistd_fchown.o \
|
||||
unistd_fdatasync.o \
|
||||
unistd_fdopen.o \
|
||||
unistd_fileno.o \
|
||||
unistd_fsync.o \
|
||||
unistd_ftruncate.o \
|
||||
unistd_getcwd.o \
|
||||
unistd_getopt.o \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_accept.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_accept.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -71,7 +71,7 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_bind.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_bind.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ bind(int sockfd,struct sockaddr *name,int namelen)
|
||||
{
|
||||
SHOWMSG("invalid name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_connect.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_connect.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ connect(int sockfd,struct sockaddr *name,int namelen)
|
||||
{
|
||||
SHOWMSG("invalid name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_get_descriptor.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_get_descriptor.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -50,13 +50,13 @@ __get_socket_descriptor(int socket_descriptor)
|
||||
fd = __get_file_descriptor(socket_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET))
|
||||
{
|
||||
__set_errno(ENOTSOCK);
|
||||
errno = ENOTSOCK;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_gethostbyaddr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_gethostbyaddr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -67,7 +67,7 @@ gethostbyaddr(const char *addr, int len, int type)
|
||||
{
|
||||
SHOWMSG("invalid addr parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_gethostbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_gethostbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -65,7 +65,7 @@ gethostbyname(const char *name)
|
||||
{
|
||||
SHOWMSG("invalid name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_gethostname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_gethostname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -66,7 +66,7 @@ gethostname(const char *hostname,int size)
|
||||
{
|
||||
SHOWMSG("invalid host name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getnetbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getnetbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -65,7 +65,7 @@ getnetbyname(const char *name)
|
||||
{
|
||||
SHOWMSG("invalid name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getpeername.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getpeername.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ getpeername(int sockfd,struct sockaddr *name,int *namelen)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getprotobyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getprotobyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -63,7 +63,7 @@ getprotobyname(const char *name)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getservbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getservbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -63,7 +63,7 @@ getservbyname(const char *name, const char *proto)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getservbyport.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getservbyport.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -63,7 +63,7 @@ getservbyport(int port, const char *proto)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getsockname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getsockname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ getsockname(int sockfd,struct sockaddr *name,int *namelen)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getsockopt.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_getsockopt.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ getsockopt(int sockfd,int level,int optname,void *optval,int *optlen)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_headers.h,v 1.4 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -48,12 +48,6 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern struct Library * NOCOMMON __SocketBase;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_hook_entry.c,v 1.6 2005-02-04 15:03:10 obarthel Exp $
|
||||
* $Id: socket_hook_entry.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -73,7 +73,7 @@ __socket_hook_entry(
|
||||
PROFILE_OFF();
|
||||
|
||||
result = __recv((LONG)fd->fd_DefaultFile,message->data,message->size,0);
|
||||
error = __get_errno();
|
||||
error = errno;
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
@@ -92,7 +92,7 @@ __socket_hook_entry(
|
||||
PROFILE_OFF();
|
||||
|
||||
result = __send((LONG)fd->fd_DefaultFile,message->data,message->size,0);
|
||||
error = __get_errno();
|
||||
error = errno;
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
@@ -141,7 +141,7 @@ __socket_hook_entry(
|
||||
param = (int)(message->arg == 0);
|
||||
|
||||
result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,¶m);
|
||||
error = __get_errno();
|
||||
error = errno;
|
||||
|
||||
break;
|
||||
|
||||
@@ -152,7 +152,7 @@ __socket_hook_entry(
|
||||
param = (int)(message->arg != 0);
|
||||
|
||||
result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,¶m);
|
||||
error = __get_errno();
|
||||
error = errno;
|
||||
|
||||
break;
|
||||
|
||||
@@ -174,15 +174,6 @@ __socket_hook_entry(
|
||||
|
||||
break;
|
||||
|
||||
case file_hook_action_flush:
|
||||
|
||||
SHOWMSG("file_hook_action_flush attempted on socket");
|
||||
|
||||
result = -1;
|
||||
error = EINVAL;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
SHOWVALUE(message->action);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_inet_addr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_inet_addr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -65,7 +65,7 @@ inet_addr(const char *addr)
|
||||
{
|
||||
SHOWMSG("invalid parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_inet_aton.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_inet_aton.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -108,7 +108,7 @@ inet_aton(const char *cp, struct in_addr *addr)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_inet_network.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_inet_network.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -63,7 +63,7 @@ inet_network(const char *cp)
|
||||
{
|
||||
SHOWMSG("invalid cp parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recv.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_recv.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ recv(int sockfd,void *buff,size_t nbytes,int flags)
|
||||
{
|
||||
SHOWMSG("invalid buffer parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recvfrom.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_recvfrom.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -71,7 +71,7 @@ recvfrom(int sockfd,void *buff,int len,int flags,struct sockaddr *from,int *from
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recvmsg.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_recvmsg.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ recvmsg(int sockfd,struct msghdr *msg,int flags)
|
||||
{
|
||||
SHOWMSG("invalid msg parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_select.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_select.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :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();
|
||||
|
||||
/* Stop if a break signal arrives. */
|
||||
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
|
||||
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
|
||||
{
|
||||
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
|
||||
__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);
|
||||
PROFILE_ON();
|
||||
|
||||
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
|
||||
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
|
||||
{
|
||||
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
|
||||
__check_abort();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_send.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_send.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ send(int sockfd,const void *buff,size_t nbytes,int flags)
|
||||
{
|
||||
SHOWMSG("invalid buffer parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_sendmsg.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_sendmsg.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -68,7 +68,7 @@ sendmsg(int sockfd,struct msghdr *msg,int flags)
|
||||
{
|
||||
SHOWMSG("invalid msg parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_sendto.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_sendto.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -71,7 +71,7 @@ sendto(int sockfd,const void *buff,int len,int flags,struct sockaddr *to,int tol
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_setsockopt.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_setsockopt.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ setsockopt(int sockfd,int level,int optname,const void *optval,int optlen)
|
||||
{
|
||||
SHOWMSG("invalid optval parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 188
|
||||
#define DATE "7.2.2005"
|
||||
#define VERS "stack.lib 1.188"
|
||||
#define VSTRING "stack.lib 1.188 (7.2.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: stack.lib 1.188 (7.2.2005)"
|
||||
#define REVISION 186
|
||||
#define DATE "14.1.2005"
|
||||
#define VERS "stack.lib 1.186"
|
||||
#define VSTRING "stack.lib 1.186 (14.1.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: stack.lib 1.186 (14.1.2005)"
|
||||
|
||||
@@ -1 +1 @@
|
||||
188
|
||||
186
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_chmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_chmod.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ chmod(const char * path_name, mode_t mode)
|
||||
{
|
||||
SHOWMSG("invalid path parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ chmod(const char * path_name, mode_t mode)
|
||||
|
||||
if(path_name_nti.is_root)
|
||||
{
|
||||
__set_errno(EACCES);
|
||||
errno = EACCES;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -142,7 +142,7 @@ chmod(const char * path_name, mode_t mode)
|
||||
|
||||
if(status == DOSFALSE)
|
||||
{
|
||||
__set_errno(__translate_io_error_to_errno(IoErr()));
|
||||
__translate_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_convertfileinfo.c,v 1.6 2005-01-30 09:37:59 obarthel Exp $
|
||||
* $Id: stat_convertfileinfo.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -39,10 +39,6 @@
|
||||
#include "locale_headers.h"
|
||||
#endif /* _LOCALE_HEADERS_H */
|
||||
|
||||
#ifndef _TIME_HEADERS_H
|
||||
#include "time_headers.h"
|
||||
#endif /* _TIME_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void
|
||||
@@ -113,7 +109,9 @@ __convert_file_info_to_stat(
|
||||
if(FLAG_IS_SET(flags,FIBF_OTR_EXECUTE))
|
||||
SET_FLAG(mode,S_IXOTH);
|
||||
|
||||
mtime = __convert_datestamp_to_time(&fib->fib_Date);
|
||||
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);
|
||||
if(__default_locale != NULL)
|
||||
mtime += 60 * __default_locale->loc_GMTOffset;
|
||||
|
||||
if(fib->fib_DirEntryType < 0)
|
||||
{
|
||||
@@ -129,8 +127,8 @@ __convert_file_info_to_stat(
|
||||
st->st_dev = (dev_t)file_system;
|
||||
st->st_mode = mode;
|
||||
st->st_mtime = mtime;
|
||||
st->st_atime = mtime;
|
||||
st->st_ctime = mtime;
|
||||
st->st_atime = st->st_mtime;
|
||||
st->st_ctime = st->st_mtime;
|
||||
st->st_uid = fib->fib_OwnerUID;
|
||||
st->st_gid = fib->fib_OwnerGID;
|
||||
st->st_blksize = 512;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_fchmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_fchmod.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -67,7 +67,7 @@ fchmod(int file_descriptor, mode_t mode)
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -119,8 +119,7 @@ fchmod(int file_descriptor, mode_t mode)
|
||||
CallHookPkt(fd->fd_Hook,fd,&message);
|
||||
|
||||
result = message.result;
|
||||
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_fstat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_fstat.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ fstat(int file_descriptor, struct stat * buffer)
|
||||
{
|
||||
SHOWMSG("invalid buffer parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ fstat(int file_descriptor, struct stat * buffer)
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
errno = EBADF;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ fstat(int file_descriptor, struct stat * buffer)
|
||||
result = message.result;
|
||||
if(result != 0)
|
||||
{
|
||||
__set_errno(message.error);
|
||||
errno = message.error;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_headers.h,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -42,12 +42,6 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern mode_t NOCOMMON __current_umask;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_lstat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_lstat.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -65,7 +65,7 @@ lstat(const char * path_name, struct stat * buffer)
|
||||
{
|
||||
SHOWMSG("invalid parameters");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_mkdir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: stat_mkdir.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -70,7 +70,7 @@ mkdir(const char * path_name, mode_t mode)
|
||||
{
|
||||
SHOWMSG("invalid path name parameter");
|
||||
|
||||
__set_errno(EFAULT);
|
||||
errno = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ mkdir(const char * path_name, mode_t mode)
|
||||
|
||||
if(path_name_nti.is_root)
|
||||
{
|
||||
__set_errno(EACCES);
|
||||
errno = EACCES;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ mkdir(const char * path_name, mode_t mode)
|
||||
{
|
||||
SHOWMSG("that didn't work");
|
||||
|
||||
__set_errno(__translate_access_io_error_to_errno(IoErr()));
|
||||
__translate_access_io_error_to_errno(IoErr(),&errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user