From 1bf430d1d670fd6c3dd7ac90172746ab597ee5af Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Fri, 4 Mar 2005 20:08:19 +0000 Subject: [PATCH] - In the thread-safe variant, the library now tries to allow multiple concurrent callers to use the socket functions. Note that this works only with the Roadshow TCP/IP stack, and the results with other TCP/IP stacks are rather unpredictable. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14858 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 5 +++++ library/socket_init_exit.c | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/library/changes b/library/changes index 5e22fe9..38d55b8 100644 --- a/library/changes +++ b/library/changes @@ -104,6 +104,11 @@ - Creation and initialization of semaphores now uses the AmigaOS4 specific functions for this purpose, if available. +- In the thread-safe variant, the library now tries to allow + multiple concurrent callers to use the socket functions. Note + that this works only with the Roadshow TCP/IP stack, and the + results with other TCP/IP stacks are rather unpredictable. + c.lib 1.188 (7.2.2005) diff --git a/library/socket_init_exit.c b/library/socket_init_exit.c index d063672..c69a85b 100644 --- a/library/socket_init_exit.c +++ b/library/socket_init_exit.c @@ -1,5 +1,5 @@ /* - * $Id: socket_init_exit.c,v 1.11 2005-03-03 14:20:55 obarthel Exp $ + * $Id: socket_init_exit.c,v 1.12 2005-03-04 20:08:19 obarthel Exp $ * * :ts=4 * @@ -197,6 +197,29 @@ __socket_init(void) goto out; } + /* If this library is built with the Roadshow SDK header files, and + * it should be thread-safe, then we'll try to allow multiple + * concurred processes to share the bsdsocket.library base opened + * above. This only works for Roadshow, though, and has the + * drawback that error reporting through 'errno' and 'h_errno' + * is no longer safe. + */ + #if defined(__THREAD_SAFE) && defined(SBTC_CAN_SHARE_LIBRARY_BASES) + { + if(SocketBase->lib_Version >= 4) + { + tags[0].ti_Tag = SBTM_SETVAL(SBTC_CAN_SHARE_LIBRARY_BASES); + tags[0].ti_Data = TRUE; + + tags[1].ti_Tag = TAG_END; + + PROFILE_OFF(); + __SocketBaseTagList(tags); + PROFILE_ON(); + } + } + #endif /* __THREAD_SAFE && SBTC_CAN_SHARE_LIBRARY_BASES */ + /* Check if this program was launched as a server by the Internet * superserver. */