James Carlson wrote:
> Joachim Worringen writes:
>> Greetings,
>>
>> I wonder about the relevance and consideration of XOPEN sockets.
>>
>> For certain XOPEN defines, i.e. socket() is mapped to __xnet_socket(), 
>> which results in so_socket() being called with SOV_XPG4_2. However, this 
>> does not seem to make much difference in the code, though, as I only 
>> found checks like this one:
> 
> The flag is set when "-lxnet" is used, which is fairly common on
> Solaris.
> 
> Many people use "-lxnet" in preference to "-lsocket -lnsl" because:
> 
>   - It's standards-compliant
> 
>   - It allows you to use ancillary data
> 
> That latter one is quite important.  Lack of a compatible way to
> introduce ancillary data on "old-style BSD" sockets is a big flaw with
> -lsocket, and a good reason to want to kill that library off
> eventually (so we're always XPG compliant).

Thanks for the enlightment! I found further info at 
http://www.opengroup.org/onlinepubs/007908799/xns/syssocket.h.html

Is ancillary data is used by many real-world applications? I have never 
seen it (which does not mean much, though).

>> [from socksctp.c - and sctp seems to be the only protocol that considers 
>> this at all, judging from the code searches I did:
>> http://src.opensolaris.org/source/search?q=SOV_XPG4_2&defs=&refs=&path=&hist=&project=%2Fvolo]
> 
> You'll probably want to use cscope or grep or even google.  I don't
> think that search engine works very well.  (It certainly seems to miss
> things.)

I checked with grep once again, but it does not make a different AFAICT:
[EMAIL PROTECTED] $ pwd
/export/home/joachim/volo-gate/usr/src
[EMAIL PROTECTED] $ find . -print -exec egrep "SOV_XPG4_2" {} \; | grep -B 1 
"SOV_XPG4_2"
./lib/libsocket/socket/weaks.c
        return (_so_bind(sock, addr, addrlen, SOV_XPG4_2));
        return (_so_listen(sock, backlog, SOV_XPG4_2));
        return (_so_connect(sock, addr, addrlen, SOV_XPG4_2));
                    option_lenp, SOV_XPG4_2));
./lib/libsocket/socket/socket.c
        return (_socket_create(family, type, protocol, SOV_XPG4_2));
                        if (version != SOV_XPG4_2)
./lib/libsocket/socket/socketpair.c
                                SOV_XPG4_2));
--
./cmd/truss/print.c
        case SOV_XPG4_2:        outstring(pri, "SOV_XPG4_2");   break;
--
./uts/common/inet/sockmods/socksctp.c
                    fflag, (so->so_version == SOV_XPG4_2) * _SOCONNECT_XPG4_2,
                        if ((so->so_version == SOV_XPG4_2) &&
--
./uts/common/sys/socketvar.h
#define SOV_XPG4_2      4       /* Xnet socket */
--
./uts/common/fs/sockfs/socksyscalls.c
        case SOV_XPG4_2:
            (version != SOV_XPG4_2) ? 0 : _SOCONNECT_XPG4_2, CRED());
            &optlen_res, (version != SOV_XPG4_2) ? 0 : _SOGETSOCKOPT_XPG4_2,

> Anything that calls __xnet_socket directly is broken.  I hope it's
> actually calling socket() and compiling with the right flags ...

Yes, I checked the source, they use socket(). However, I wonder how this 
is mapped to __xnet_socket as
- no _XOPEN_SOURCE define anywhere, only _XOPEN_XPG4 is set, which 
should not trigger this remapping
- -lxnet is only used as a "hack" - from configure.in (the only 
occurence of -lxnet):

# Hack for Siemens UNIX
if test "$with_named_thread" = "no"
then
   AC_MSG_CHECKING("Siemens threads")
   if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4"
   then
     LIBS="-lxnet $LIBS"
...

I guess I have to ask some MySQL people I know. Seems they compile their 
binaries for publishing from different sources.

>> The reason why I care at all is that we are implementing plug-in sockets 
>> for low-latency communication (see project volo).
> 
> Sounds good ... but both XPG and old-style sockets are required.

old-style is BSD here, right?

  Joachim

-- 
Joachim Worringen, Software Architect, Dolphin Interconnect Solutions
phone ++49/(0)228/324 08 17 - http://www.dolphinics.com
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to