From 7492d108a3dc05265be1d8bd6f8ddfccf0ad42af Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sun, 28 Nov 2004 10:01:26 +0000 Subject: [PATCH] c.lib 1.184 (28.11.2004) - Added asctime_r(), ctime_r(), gmtime_r(), localtime_r() and strtok_r(). - Added stubs for the Rexx Variables Interface code that used to be part of amiga.lib. While comparable functionality is available in rexxsyslib.library V45, the new stubs might be helpful during porting. Care must be taken since these functions don't work exactly like the originals. - Integrated strlcpy() and strlcat() which are intended to be safer replacements for strncpy() and strncat(). - The program's task priority is now configurable through an external variable '__priority'. - The process name to be used when detaching can be configured through the new '__process_name' variable. - The minimum required operating system version can be configured through the new '__minimum_os_lib_version' variable; a matching error message can be provided through the new '__minimum_os_lib_error' variable. - The default console window specification can be overriden through the new '__stdio_window_specification' variable. - The socket initialization code did not set up a reference to the 'h_errno' variable correctly. This had the effect of making name and address resolution errors trash the 'errno' variable instead and leaving 'h_errno' always set to 0. Fixed. - For sockets, ioctl() and fcntl() now interact on the FIONBIO/FIOASYNC requests (ioctl) and the O_NOBLOCK/O_ASYNC flags (fcntl). - popen() now accepts "rb" and "wb" as mode parameters. However, "r+", "w+" and variants thereof are still unsupported due to the unidirectional pipe support in the standard "PIPE:" device. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14777 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/amiga.lib_rev.h | 10 +++++----- library/amiga.lib_rev.rev | 2 +- library/c.lib_rev.h | 10 +++++----- library/c.lib_rev.rev | 2 +- library/changes | 2 ++ library/debug.lib_rev.h | 10 +++++----- library/debug.lib_rev.rev | 2 +- library/fcntl_close.c | 4 ++-- library/fcntl_fcntl.c | 6 +++--- library/m.lib_rev.h | 10 +++++----- library/m.lib_rev.rev | 2 +- library/m881.lib_rev.h | 10 +++++----- library/m881.lib_rev.rev | 2 +- library/net.lib_rev.h | 10 +++++----- library/net.lib_rev.rev | 2 +- library/socket_hook_entry.c | 6 +++--- library/socket_ioctl.c | 8 ++++---- library/stack.lib_rev.h | 10 +++++----- library/stack.lib_rev.rev | 2 +- library/stdio_fdhookentry.c | 4 ++-- library/stdio_headers.h | 4 ++-- library/unix.lib_rev.h | 10 +++++----- library/unix.lib_rev.rev | 2 +- 23 files changed, 66 insertions(+), 64 deletions(-) diff --git a/library/amiga.lib_rev.h b/library/amiga.lib_rev.h index 3606c0d..36ec4d6 100644 --- a/library/amiga.lib_rev.h +++ b/library/amiga.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "amiga.lib 1.183" -#define VSTRING "amiga.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: amiga.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "amiga.lib 1.184" +#define VSTRING "amiga.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: amiga.lib 1.184 (28.11.2004)" diff --git a/library/amiga.lib_rev.rev b/library/amiga.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/amiga.lib_rev.rev +++ b/library/amiga.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 77e39e3..79e0e2e 100644 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "c.lib 1.183" -#define VSTRING "c.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: c.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "c.lib 1.184" +#define VSTRING "c.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: c.lib 1.184 (28.11.2004)" diff --git a/library/c.lib_rev.rev b/library/c.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/c.lib_rev.rev +++ b/library/c.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/changes b/library/changes index b2ca44b..be42058 100644 --- a/library/changes +++ b/library/changes @@ -1,3 +1,5 @@ +c.lib 1.184 (28.11.2004) + - Added asctime_r(), ctime_r(), gmtime_r(), localtime_r() and strtok_r(). - Added stubs for the Rexx Variables Interface code that used to diff --git a/library/debug.lib_rev.h b/library/debug.lib_rev.h index 2029002..917614d 100644 --- a/library/debug.lib_rev.h +++ b/library/debug.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "debug.lib 1.183" -#define VSTRING "debug.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: debug.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "debug.lib 1.184" +#define VSTRING "debug.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: debug.lib 1.184 (28.11.2004)" diff --git a/library/debug.lib_rev.rev b/library/debug.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/debug.lib_rev.rev +++ b/library/debug.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/fcntl_close.c b/library/fcntl_close.c index 3d6bf6b..bd4ec8d 100644 --- a/library/fcntl_close.c +++ b/library/fcntl_close.c @@ -1,5 +1,5 @@ /* - * $Id: fcntl_close.c,v 1.2 2004-08-07 09:15:32 obarthel Exp $ + * $Id: fcntl_close.c,v 1.3 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -135,7 +135,7 @@ __close(int file_descriptor,int * error_ptr) SHOWMSG("resetting non-blocking access mode"); message.action = file_hook_action_set_blocking; - message.block = 1; + message.arg = 1; assert( fd->fd_Hook != NULL ); diff --git a/library/fcntl_fcntl.c b/library/fcntl_fcntl.c index 636acc3..95e6bc9 100644 --- a/library/fcntl_fcntl.c +++ b/library/fcntl_fcntl.c @@ -1,5 +1,5 @@ /* - * $Id: fcntl_fcntl.c,v 1.3 2004-11-27 12:43:11 obarthel Exp $ + * $Id: fcntl_fcntl.c,v 1.4 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -150,7 +150,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ ) (FLAG_IS_CLEAR(flags,O_NONBLOCK) && FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING))) { message.action = file_hook_action_set_blocking; - message.block = FLAG_IS_CLEAR(flags,O_NONBLOCK); + message.arg = FLAG_IS_CLEAR(flags,O_NONBLOCK); assert( fd->fd_Hook != NULL ); @@ -175,7 +175,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ ) (FLAG_IS_CLEAR(flags,O_ASYNC) && FLAG_IS_SET(fd->fd_Flags,FDF_ASYNC_IO))) { message.action = file_hook_action_set_async; - message.block = FLAG_IS_SET(flags,O_ASYNC); + message.arg = FLAG_IS_SET(flags,O_ASYNC); assert( fd->fd_Hook != NULL ); diff --git a/library/m.lib_rev.h b/library/m.lib_rev.h index c7ef42e..3b8936d 100644 --- a/library/m.lib_rev.h +++ b/library/m.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "m.lib 1.183" -#define VSTRING "m.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: m.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "m.lib 1.184" +#define VSTRING "m.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: m.lib 1.184 (28.11.2004)" diff --git a/library/m.lib_rev.rev b/library/m.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/m.lib_rev.rev +++ b/library/m.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/m881.lib_rev.h b/library/m881.lib_rev.h index f0b25c3..be614cf 100644 --- a/library/m881.lib_rev.h +++ b/library/m881.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "m881.lib 1.183" -#define VSTRING "m881.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: m881.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "m881.lib 1.184" +#define VSTRING "m881.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: m881.lib 1.184 (28.11.2004)" diff --git a/library/m881.lib_rev.rev b/library/m881.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/m881.lib_rev.rev +++ b/library/m881.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/net.lib_rev.h b/library/net.lib_rev.h index 0c35734..f50ca86 100644 --- a/library/net.lib_rev.h +++ b/library/net.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "net.lib 1.183" -#define VSTRING "net.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: net.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "net.lib 1.184" +#define VSTRING "net.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: net.lib 1.184 (28.11.2004)" diff --git a/library/net.lib_rev.rev b/library/net.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/net.lib_rev.rev +++ b/library/net.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/socket_hook_entry.c b/library/socket_hook_entry.c index dcced5d..fc94491 100644 --- a/library/socket_hook_entry.c +++ b/library/socket_hook_entry.c @@ -1,5 +1,5 @@ /* - * $Id: socket_hook_entry.c,v 1.2 2004-11-27 12:43:11 obarthel Exp $ + * $Id: socket_hook_entry.c,v 1.3 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -138,7 +138,7 @@ __socket_hook_entry( SHOWMSG("file_hook_action_set_blocking"); - param = (int)(message->block == 0); + param = (int)(message->arg == 0); result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,¶m); error = errno; @@ -149,7 +149,7 @@ __socket_hook_entry( SHOWMSG("file_hook_action_set_async"); - param = (int)(message->block != 0); + param = (int)(message->arg != 0); result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,¶m); error = errno; diff --git a/library/socket_ioctl.c b/library/socket_ioctl.c index 03c4951..00d19be 100644 --- a/library/socket_ioctl.c +++ b/library/socket_ioctl.c @@ -1,5 +1,5 @@ /* - * $Id: socket_ioctl.c,v 1.2 2004-11-27 12:43:11 obarthel Exp $ + * $Id: socket_ioctl.c,v 1.3 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -87,18 +87,18 @@ ioctl(int sockfd,unsigned long request, ... /* char *arg */) if(result == OK) { - int * arg = (int *)param; + int * option = (int *)param; if(request == FIONBIO) { - if((*arg) != 0) + if((*option) != 0) SET_FLAG(fd->fd_Flags,FDF_NON_BLOCKING); else CLEAR_FLAG(fd->fd_Flags,FDF_NON_BLOCKING); } else if (request == FIOASYNC) { - if((*arg) != 0) + if((*option) != 0) SET_FLAG(fd->fd_Flags,FDF_ASYNC_IO); else CLEAR_FLAG(fd->fd_Flags,FDF_ASYNC_IO); diff --git a/library/stack.lib_rev.h b/library/stack.lib_rev.h index 67c16cf..b64fc8b 100644 --- a/library/stack.lib_rev.h +++ b/library/stack.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "stack.lib 1.183" -#define VSTRING "stack.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: stack.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "stack.lib 1.184" +#define VSTRING "stack.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: stack.lib 1.184 (28.11.2004)" diff --git a/library/stack.lib_rev.rev b/library/stack.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/stack.lib_rev.rev +++ b/library/stack.lib_rev.rev @@ -1 +1 @@ -183 +184 diff --git a/library/stdio_fdhookentry.c b/library/stdio_fdhookentry.c index 1da66cb..822211f 100644 --- a/library/stdio_fdhookentry.c +++ b/library/stdio_fdhookentry.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_fdhookentry.c,v 1.1.1.1 2004-07-26 16:31:28 obarthel Exp $ + * $Id: stdio_fdhookentry.c,v 1.2 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -1829,7 +1829,7 @@ __fd_hook_entry( SHOWMSG("changing the mode"); - if(message->block) + if(message->arg != 0) mode = 0; /* buffered mode */ else mode = 1; /* single character mode */ diff --git a/library/stdio_headers.h b/library/stdio_headers.h index f795a55..b7e22a2 100644 --- a/library/stdio_headers.h +++ b/library/stdio_headers.h @@ -1,5 +1,5 @@ /* - * $Id: stdio_headers.h,v 1.4 2004-11-27 12:43:11 obarthel Exp $ + * $Id: stdio_headers.h,v 1.5 2004-11-28 10:01:26 obarthel Exp $ * * :ts=4 * @@ -327,7 +327,7 @@ struct file_hook_message struct flock * lock; /* Record locking request */ int command; /* What kind of locking command was sent */ - int block; /* Whether or not this file should + int arg; /* Whether or not this file should be set non-blocking */ uid_t owner; diff --git a/library/unix.lib_rev.h b/library/unix.lib_rev.h index 028d9e8..4c1c6df 100644 --- a/library/unix.lib_rev.h +++ b/library/unix.lib_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 183 -#define DATE "13.11.2004" -#define VERS "unix.lib 1.183" -#define VSTRING "unix.lib 1.183 (13.11.2004)\r\n" -#define VERSTAG "\0$VER: unix.lib 1.183 (13.11.2004)" +#define REVISION 184 +#define DATE "28.11.2004" +#define VERS "unix.lib 1.184" +#define VSTRING "unix.lib 1.184 (28.11.2004)\r\n" +#define VERSTAG "\0$VER: unix.lib 1.184 (28.11.2004)" diff --git a/library/unix.lib_rev.rev b/library/unix.lib_rev.rev index 90afb3e..dc37bbd 100644 --- a/library/unix.lib_rev.rev +++ b/library/unix.lib_rev.rev @@ -1 +1 @@ -183 +184