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. */