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

- Lost the __not_a_number and __infinity variables, including the

code which initialized them.

- Reading/changing the errno variable is no longer done directly, but
  involves accessor functions.

- References to the HUGE_VAL quantity now involve an accessor function, too.

- Changed the manner in which the __huge_val constant is initialized by
  the __math_init() function.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14824 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-02-03 16:56:20 +00:00
parent 209884bd1f
commit 91028c63bc
224 changed files with 947 additions and 759 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.23 2005-01-29 18:05:13 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.24 2005-02-03 16:56:15 obarthel Exp $
#
# :ts=8
#
@ -272,6 +272,7 @@ C_LIB = \
stdlib_dosbase.o \
stdlib_exit.o \
stdlib_free.o \
stdlib_get_errno.o \
stdlib_getdefstacksize.o \
stdlib_getenv.o \
stdlib_getsp.o \
@ -298,6 +299,7 @@ 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 \
@ -475,6 +477,7 @@ 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 \

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.23 2005-01-29 18:05:13 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.24 2005-02-03 16:56:15 obarthel Exp $
#
# :ts=8
#
@ -275,6 +275,7 @@ 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 \
@ -299,6 +300,7 @@ 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 \
@ -479,6 +481,7 @@ 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 \

View File

@ -22,6 +22,17 @@
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.
c.lib 1.187 (29.1.2005)

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_closedir.c,v 1.4 2005-02-03 12:14:55 obarthel Exp $
* $Id: dirent_closedir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ closedir(DIR * directory_pointer)
if(directory_pointer == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -84,7 +84,7 @@ closedir(DIR * directory_pointer)
if(NOT directory_pointer_is_valid)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_headers.h,v 1.4 2005-02-03 12:14:55 obarthel Exp $
* $Id: dirent_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -42,6 +42,12 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h"
#endif /* _MACROS_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_opendir.c,v 1.4 2005-02-03 12:14:55 obarthel Exp $
* $Id: dirent_opendir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -106,7 +106,7 @@ opendir(const char * path_name)
{
SHOWMSG("invalid parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -159,7 +159,7 @@ opendir(const char * path_name)
{
UnLockDosList(LDF_VOLUMES|LDF_READ);
errno = ENOMEM;
__set_errno(ENOMEM);
goto out;
}
@ -189,7 +189,7 @@ opendir(const char * path_name)
/* Bail out if we cannot present anything. */
if(IsListEmpty((struct List *)&dh->dh_VolumeList))
{
errno = ENOMEM;
__set_errno(ENOMEM);
goto out;
}
}
@ -212,7 +212,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't get a lock on it");
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out;
}
@ -226,7 +226,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't examine it");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -234,7 +234,7 @@ opendir(const char * path_name)
{
SHOWMSG("this isn't a directory");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_readdir.c,v 1.6 2005-02-03 12:14:55 obarthel Exp $
* $Id: dirent_readdir.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -61,7 +61,7 @@ readdir(DIR * directory_pointer)
{
SHOWMSG("ouch. invalid parameter");
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -164,7 +164,7 @@ readdir(DIR * directory_pointer)
{
if(CANNOT Examine(parent_directory,fib))
{
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
}
@ -206,7 +206,7 @@ readdir(DIR * directory_pointer)
{
SHOWMSG("error scanning directory");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_close.c,v 1.6 2005-01-14 08:36:54 obarthel Exp $
* $Id: fcntl_close.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -178,10 +178,12 @@ int
close(int file_descriptor)
{
int result;
int error;
ENTER();
result = __close(file_descriptor,&errno);
result = __close(file_descriptor,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_open.c,v 1.7 2005-01-09 16:07:27 obarthel Exp $
* $Id: fcntl_open.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -123,7 +123,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("path name is invalid");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -134,7 +134,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("access mode is invalid");
errno = EINVAL;
__set_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)
{
errno = EACCES;
__set_errno(EACCES);
goto out;
}
}
@ -187,7 +187,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("the file already exists");
errno = EEXIST;
__set_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");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -233,7 +233,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("could not examine the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -242,7 +242,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("can't open a directory");
errno = EISDIR;
__set_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");
errno = EACCES;
__set_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");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
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));
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(io_err));
/* Check if ended up trying to open a directory as if
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)
errno = EISDIR;
__set_errno(EISDIR);
}
PROFILE_ON();

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_read.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_read.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -136,10 +136,12 @@ 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,&errno);
result = __read(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_write.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_write.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -136,10 +136,12 @@ 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,&errno);
result = __write(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: dos.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
* $Id: dos.h,v 1.6 2005-02-03 16:56:20 obarthel Exp $
*
* :ts=4
*
@ -278,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 void __translate_io_error_to_errno(LONG io_error,int * errno_ptr);
extern int __translate_io_error_to_errno(LONG io_error);
/****************************************************************************/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

44
library/math_huge_val.c Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#
# $Id: smakefile,v 1.18 2005-01-29 18:05:14 obarthel Exp $
# $Id: smakefile,v 1.19 2005-02-03 16:56:15 obarthel Exp $
#
# :ts=8
#
@ -190,6 +190,7 @@ 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 \
@ -375,6 +376,8 @@ 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 \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_hook_entry.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_hook_entry.c,v 1.5 2005-02-03 16:56:15 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 = errno;
error = __get_errno();
PROFILE_ON();
@ -92,7 +92,7 @@ __socket_hook_entry(
PROFILE_OFF();
result = __send((LONG)fd->fd_DefaultFile,message->data,message->size,0);
error = errno;
error = __get_errno();
PROFILE_ON();
@ -141,7 +141,7 @@ __socket_hook_entry(
param = (int)(message->arg == 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,&param);
error = errno;
error = __get_errno();
break;
@ -152,7 +152,7 @@ __socket_hook_entry(
param = (int)(message->arg != 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,&param);
error = errno;
error = __get_errno();
break;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_select.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_select.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -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 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__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 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__check_abort();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: stat_rmdir.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
* $Id: stat_rmdir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -70,7 +70,7 @@ rmdir(const char * path_name)
{
SHOWMSG("invalid path name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -88,7 +88,7 @@ rmdir(const char * path_name)
if(path_name_nti.is_root)
{
errno = EACCES;
__set_errno(EACCES);
goto out;
}
}
@ -105,7 +105,7 @@ rmdir(const char * path_name)
{
SHOWMSG("that didn't work");
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out;
}
@ -117,7 +117,7 @@ rmdir(const char * path_name)
{
SHOWMSG("couldn't examine it");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -125,7 +125,7 @@ rmdir(const char * path_name)
{
SHOWMSG("this is not a directory");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
@ -145,7 +145,7 @@ rmdir(const char * path_name)
{
SHOWMSG("that didn't work");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stat_stat.c,v 1.5 2005-01-30 09:37:59 obarthel Exp $
* $Id: stat_stat.c,v 1.6 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -80,7 +80,7 @@ stat(const char * path_name, struct stat * st)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -138,7 +138,7 @@ stat(const char * path_name, struct stat * st)
{
SHOWMSG("that didn't work");
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out;
}
@ -150,7 +150,7 @@ stat(const char * path_name, struct stat * st)
{
SHOWMSG("couldn't examine it");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_asprintf.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_asprintf.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -64,7 +64,7 @@ asprintf(char **ret, const char *format, ...)
{
if(ret == NULL || format == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_clearerr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_clearerr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -62,7 +62,7 @@ clearerr(FILE *stream)
{
if(stream == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_dropiobreadbuffer.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_dropiobreadbuffer.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -94,8 +94,9 @@ __drop_iob_read_buffer(struct iob * file)
SET_FLAG(file->iob_Flags,IOBF_ERROR);
result = -1;
errno = message.error;
result = -1;
__set_errno(message.error);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fclose.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fclose.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -72,7 +72,7 @@ fclose(FILE *stream)
result = EOF;
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -91,7 +91,7 @@ fclose(FILE *stream)
result = EOF;
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -111,8 +111,9 @@ fclose(FILE *stream)
if(result != EOF)
{
result = message.result;
errno = message.error;
result = message.result;
__set_errno(message.error);
}
/* Now that the file is closed and we are in fact

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fdhookentry.c,v 1.7 2005-01-12 09:15:50 obarthel Exp $
* $Id: stdio_fdhookentry.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -1249,7 +1249,7 @@ handle_record_locking(int cmd,struct flock * l,struct fd * fd,int * error_ptr)
{
SetIoErr(error);
__translate_io_error_to_errno(IoErr(),error_ptr);
(*error_ptr) = __translate_io_error_to_errno(error);
}
RETURN(result);
@ -1332,7 +1332,7 @@ grow_file_size(struct fd * fd,int num_bytes,int * error_ptr)
{
SHOWMSG("could not move to the end of the file");
__translate_io_error_to_errno(IoErr(),error_ptr);
(*error_ptr) = __translate_io_error_to_errno(IoErr());
goto out;
}
@ -1374,7 +1374,7 @@ grow_file_size(struct fd * fd,int num_bytes,int * error_ptr)
if(bytes_written != size)
{
__translate_io_error_to_errno(IoErr(),error_ptr);
(*error_ptr) = __translate_io_error_to_errno(IoErr());
goto out;
}
@ -1439,7 +1439,8 @@ __fd_hook_entry(
if(result < 0)
{
D(("read failed ioerr=%ld",IoErr()));
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
break;
}
@ -1490,7 +1491,7 @@ __fd_hook_entry(
{
D(("write failed ioerr=%ld",IoErr()));
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
break;
}
@ -1600,7 +1601,7 @@ __fd_hook_entry(
{
D(("seek failed, mode=%ld (%ld), offset=%ld, ioerr=%ld",mode,message->mode,message->position,IoErr()));
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
#if defined(UNIX_PATH_SEMANTICS)
{
@ -1665,7 +1666,7 @@ __fd_hook_entry(
}
if(CANNOT Close(fd->fd_DefaultFile))
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
PROFILE_ON();
@ -1913,7 +1914,7 @@ __fd_hook_entry(
{
SHOWMSG("that didn't work");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
#else
@ -1930,7 +1931,7 @@ __fd_hook_entry(
{
SHOWMSG("that didn't work");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
else
@ -1954,13 +1955,13 @@ __fd_hook_entry(
if(DoPkt(dvp->dvp_Port,ACTION_SET_OWNER,dvp->dvp_Lock,MKBADDR(new_name),(LONG)((((ULONG)message->owner) << 16) | message->group),0,0))
result = 0;
else
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
FreeDeviceProc(dvp);
}
else
{
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
}
@ -1974,14 +1975,14 @@ __fd_hook_entry(
{
SHOWMSG("couldn't find parent directory");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
else
{
SHOWMSG("couldn't examine file handle");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
PROFILE_ON();
@ -2007,7 +2008,7 @@ __fd_hook_entry(
if(CANNOT safe_examine_file_handle(fd->fd_DefaultFile,fib))
{
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
break;
}
@ -2025,7 +2026,7 @@ __fd_hook_entry(
}
else
{
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
else if (message->size > fib->fib_Size)
@ -2039,7 +2040,7 @@ __fd_hook_entry(
}
else
{
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
}
else
@ -2071,7 +2072,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't examine the file");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
break;
}
@ -2111,7 +2112,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't get info on drive");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
UnLock(parent_dir);
@ -2120,7 +2121,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't find parent directory");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
PROFILE_ON();
@ -2163,7 +2164,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't change protection bits; oh well, it was worth the effort...");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
CurrentDir(old_current_dir);
@ -2172,7 +2173,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't examine file");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
UnLock(parent_dir);
@ -2181,7 +2182,7 @@ __fd_hook_entry(
{
SHOWMSG("couldn't get a lock on the parent directory");
__translate_io_error_to_errno(IoErr(),&error);
error = __translate_io_error_to_errno(IoErr());
}
PROFILE_ON();

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_feof.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_feof.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -65,8 +65,10 @@ feof(FILE *stream)
{
SHOWMSG("invalid stream parameter");
errno = EFAULT;
__set_errno(EFAULT);
result = 0;
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_ferror.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_ferror.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -65,8 +65,10 @@ ferror(FILE *stream)
{
SHOWMSG("invalid stream parameter");
errno = EFAULT;
__set_errno(EFAULT);
result = 0;
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fflush.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fflush.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -97,7 +97,7 @@ fflush(FILE *stream)
{
SHOWMSG("invalid file handle");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fgetc.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fgetc.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -89,7 +89,7 @@ __fgetc_check(FILE * stream)
{
if(stream == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -107,7 +107,7 @@ __fgetc_check(FILE * stream)
SET_FLAG(file->iob_Flags,IOBF_ERROR);
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -115,7 +115,7 @@ __fgetc_check(FILE * stream)
{
SET_FLAG(file->iob_Flags,IOBF_ERROR);
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -142,7 +142,7 @@ fgetc(FILE *stream)
{
if(stream == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fgetpos.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fgetpos.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -62,7 +62,7 @@ fgetpos(FILE *stream, fpos_t *pos)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fgets.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fgets.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ fgets(char *s,int n,FILE *stream)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
result = NULL;
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_filliobreadbuffer.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_filliobreadbuffer.c,v 1.4 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -92,9 +92,9 @@ __fill_iob_read_buffer(struct iob * file)
if(message.result < 0)
{
errno = message.error;
__set_errno(message.error);
D(("got error %ld",errno));
D(("got error %ld",message.error));
SET_FLAG(file->iob_Flags,IOBF_ERROR);
goto out;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_flush.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_flush.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -68,7 +68,7 @@ __flush(FILE *stream)
{
SHOWMSG("invalid stream parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_flushiobwritebuffer.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_flushiobwritebuffer.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -102,9 +102,9 @@ __flush_iob_write_buffer(struct iob * file)
SET_FLAG(file->iob_Flags,IOBF_ERROR);
result = -1;
errno = message.error;
__set_errno(message.error);
result = -1;
goto out;
}

View File

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

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fprintf.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fprintf.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -60,7 +60,7 @@ fprintf(FILE *stream,const char *format,...)
{
if(stream == NULL || format == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fputc.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fputc.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -55,7 +55,7 @@ __fputc_check(FILE *stream)
{
if(stream == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -72,7 +72,7 @@ __fputc_check(FILE *stream)
{
SHOWMSG("this file is not even in use");
errno = EBADF;
__set_errno(EBADF);
SET_FLAG(file->iob_Flags,IOBF_ERROR);
goto out;
@ -82,7 +82,7 @@ __fputc_check(FILE *stream)
{
SHOWMSG("this stream is not write enabled");
errno = EBADF;
__set_errno(EBADF);
SET_FLAG(file->iob_Flags,IOBF_ERROR);
goto out;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fputs.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fputs.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -62,7 +62,7 @@ fputs(const char *s, FILE *stream)
{
if(s == NULL || stream == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_fread.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_fread.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -65,7 +65,7 @@ fread(void *ptr,size_t element_size,size_t count,FILE *stream)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -82,7 +82,7 @@ fread(void *ptr,size_t element_size,size_t count,FILE *stream)
{
SHOWMSG("this file is not even in use");
errno = EBADF;
__set_errno(EBADF);
SET_FLAG(file->iob_Flags,IOBF_ERROR);
goto out;
@ -92,7 +92,7 @@ fread(void *ptr,size_t element_size,size_t count,FILE *stream)
{
SHOWMSG("this file is not read-enabled");
errno = EBADF;
__set_errno(EBADF);
SET_FLAG(file->iob_Flags,IOBF_ERROR);
goto out;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_freopen.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: stdio_freopen.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
*
* :ts=4
*
@ -64,7 +64,7 @@ freopen(const char *filename, const char *mode, FILE *stream)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

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