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

c.lib 1.166 (28.7.2004)

- Added h_strerror() function to libnet.a; there's a global 'h_errno'
  variable available, too.

- <signal.h> now defines a type 'sig_t'.

- <unistd.h> now allows the 'fd_set' type to be referenced as
  'struct fd_set', too.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14690 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-07-28 15:50:45 +00:00
parent 39860a86f8
commit 8e5ebc5400
25 changed files with 227 additions and 58 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.1.1.1 2004-07-26 16:30:14 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.2 2004-07-28 15:50:44 obarthel Exp $
#
# :ts=8
#
@ -574,6 +574,7 @@ NET_LIB = \
socket_shutdown.o \
socket_socket.o \
socket_hook_entry.o \
socket_hstrerror.o \
stat_umask.o \
usergroup_crypt.o \
usergroup_data.o \

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.1.1.1 2004-07-26 16:30:15 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.2 2004-07-28 15:50:44 obarthel Exp $
#
# :ts=8
#
@ -568,6 +568,7 @@ NET_LIB = \
socket_shutdown.o \
socket_socket.o \
socket_hook_entry.o \
socket_hstrerror.o \
usergroup_crypt.o \
usergroup_data.o \
usergroup_endgrent.o \

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "amiga.lib 1.165"
#define VSTRING "amiga.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "amiga.lib 1.166"
#define VSTRING "amiga.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "c.lib 1.165"
#define VSTRING "c.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: c.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "c.lib 1.166"
#define VSTRING "c.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: c.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "debug.lib 1.165"
#define VSTRING "debug.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "debug.lib 1.166"
#define VSTRING "debug.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,5 +1,5 @@
/*
* $Id: unistd.h,v 1.2 2004-07-28 15:25:59 obarthel Exp $
* $Id: unistd.h,v 1.3 2004-07-28 15:50:45 obarthel Exp $
*
* :ts=4
*
@ -195,6 +195,11 @@ struct in_addr
/****************************************************************************/
/* Error codes set by the name<->address resolution functions. */
extern int h_errno;
/****************************************************************************/
extern int accept(int sockfd,struct sockaddr *cliaddr,int *addrlen);
extern int bind(int sockfd,struct sockaddr *name,int namelen);
extern int connect(int sockfd,struct sockaddr *name,int namelen);
@ -230,6 +235,7 @@ extern unsigned long inet_lnaof(struct in_addr in);
extern struct in_addr inet_makeaddr(int net,int host);
extern unsigned long inet_netof(struct in_addr in);
extern unsigned long inet_network(const char *cp);
extern const char * hstrerror(int error_number);
/****************************************************************************/

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "m.lib 1.165"
#define VSTRING "m.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: m.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "m.lib 1.166"
#define VSTRING "m.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: m.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "m881.lib 1.165"
#define VSTRING "m881.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "m881.lib 1.166"
#define VSTRING "m881.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "net.lib 1.165"
#define VSTRING "net.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: net.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "net.lib 1.166"
#define VSTRING "net.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: net.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,3 +1,14 @@
c.lib 1.166 (28.7.2004)
- Added h_strerror() function to libnet.a; there's a global 'h_errno'
variable available, too.
- <signal.h> now defines a type 'sig_t'.
- <unistd.h> now allows the 'fd_set' type to be referenced as
'struct fd_set', too.
c.lib 1.165 (26.7.2004)
- In printf(), if the precision is 0 and the value to be printed for

View File

@ -1,5 +1,5 @@
#
# $Id: smakefile,v 1.1.1.1 2004-07-26 16:31:07 obarthel Exp $
# $Id: smakefile,v 1.2 2004-07-28 15:50:45 obarthel Exp $
#
# :ts=8
#
@ -243,7 +243,8 @@ SOCKET_OBJ = \
socket_setsockopt.o \
socket_shutdown.o \
socket_socket.o \
socket_hook_entry.o
socket_hook_entry.o \
socket_hstrerror.o
STAT_OBJ = \
stat_chmod.o \

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_data.c,v 1.1.1.1 2004-07-26 16:31:08 obarthel Exp $
* $Id: socket_data.c,v 1.2 2004-07-28 15:50:45 obarthel Exp $
*
* :ts=4
*
@ -53,4 +53,8 @@ struct SocketIFace *__ISocket;
/****************************************************************************/
int h_errno;
/****************************************************************************/
#endif /* SOCKET_SUPPORT */

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_headers.h,v 1.1.1.1 2004-07-26 16:31:14 obarthel Exp $
* $Id: socket_headers.h,v 1.2 2004-07-28 15:50:45 obarthel Exp $
*
* :ts=4
*
@ -60,6 +60,10 @@ extern struct SocketIFace *__ISocket;
/****************************************************************************/
extern int h_errno;
/****************************************************************************/
extern struct fd * __get_socket_descriptor(int socket_descriptor);
extern void __socket_hook_entry(struct Hook * hook,struct fd * fd,struct file_hook_message * message);

136
library/socket_hstrerror.c Normal file
View File

@ -0,0 +1,136 @@
/*
* $Id: socket_hstrerror.c,v 1.1 2004-07-28 15:50:45 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2004 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.
*/
#if defined(SOCKET_SUPPORT)
/****************************************************************************/
#ifndef _SOCKET_HEADERS_H
#include "socket_headers.h"
#endif /* _SOCKET_HEADERS_H */
/****************************************************************************/
const char *
hstrerror(int error_number)
{
const char * result;
if(error_number < 1 || error_number > 4)
{
static char error_buffer[80];
char number[30];
char *s = number;
int is_negative = 0;
unsigned int n;
int i,len,c;
/* We convert the error number into in an unsigned
integer, so that numbers such as 0x80000000
can come out of the conversion. */
if(error_number < 0)
{
is_negative = 1;
n = (-error_number);
}
else
{
n = error_number;
}
/* Convert the error number into a string of digits. */
len = 0;
do
{
(*s++) = '0' + (n % 10);
n /= 10;
len++;
}
while(n > 0 && len < (int)sizeof(number)-1);
/* Add the sign, if necessary. */
if(is_negative && len < (int)sizeof(number)-1)
{
(*s++) = '-';
len++;
}
(*s) = '\0';
/* Reverse the string in place. */
for(i = 0 ; i < len / 2 ; i++)
{
c = number[len-1-i];
number[len-1-i] = number[i];
number[i] = c;
}
strcpy(error_buffer,"Unknown resolver error ");
strcat(error_buffer,number);
result = error_buffer;
}
else
{
switch(error_number)
{
case 1: /* HOST_NOT_FOUND */
result = "Unknown host";
break;
case 2: /* TRY_AGAIN */
result = "Host name lookup failure; try again";
break;
case 3: /* NO_RECOVERY */
result = "Unknown server error_number";
break;
case 4: /* NO_ADDRESS */
result = "No address associated with name";
break;
}
}
return(result);
}
/****************************************************************************/
#endif /* SOCKET_SUPPORT */

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_init_exit.c,v 1.1.1.1 2004-07-26 16:31:16 obarthel Exp $
* $Id: socket_init_exit.c,v 1.2 2004-07-28 15:50:45 obarthel Exp $
*
* :ts=4
*
@ -61,6 +61,7 @@ extern BOOL __detach;
#define SBTC_BREAKMASK 1 /* Interrupt signal mask */
#define SBTC_LOGTAGPTR 11 /* Under which name log entries are filed */
#define SBTC_ERRNOLONGPTR 24 /* Pointer to errno, length == sizeof(errno) */
#define SBTC_HERRNOLONGPTR 25 /* 'h_errno' pointer (with sizeof(h_errno) == sizeof(long)) */
/****************************************************************************/
@ -151,7 +152,7 @@ int
__socket_init(void)
{
struct Process * this_process;
struct TagItem tags[4];
struct TagItem tags[5];
int result = ERROR;
LONG status;
@ -203,7 +204,11 @@ __socket_init(void)
tags[2].ti_Tag = SBTM_SETVAL(SBTC_LOGTAGPTR);
tags[2].ti_Data = (ULONG)__program_name;
tags[3].ti_Tag = TAG_END;
/* Wire the library's h_errno variable to our local h_errno. */
tags[3].ti_Tag = SBTM_SETVAL(SBTC_HERRNOLONGPTR);
tags[3].ti_Data = (ULONG)&errno;
tags[4].ti_Tag = TAG_END;
PROFILE_OFF();
status = __SocketBaseTagList(tags);

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "stack.lib 1.165"
#define VSTRING "stack.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: stack.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "stack.lib 1.166"
#define VSTRING "stack.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: stack.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 165
#define DATE "26.7.2004"
#define VERS "unix.lib 1.165"
#define VSTRING "unix.lib 1.165 (26.7.2004)\r\n"
#define VERSTAG "\0$VER: unix.lib 1.165 (26.7.2004)"
#define REVISION 166
#define DATE "28.7.2004"
#define VERS "unix.lib 1.166"
#define VSTRING "unix.lib 1.166 (28.7.2004)\r\n"
#define VERSTAG "\0$VER: unix.lib 1.166 (28.7.2004)"

View File

@ -1 +1 @@
165
166