James Carlson wrote:
Paul Durrant writes:
On 4/8/06, Xie Gang <[EMAIL PROTECTED]> wrote:
I wrote a socket program and compiled it on solaris. I found it quite different
from linux. The gcc did not search for the socket lib automatically. The
-lsocket must be given.
I don't know why this happens.
On Linux the socket calls are in (g)libc so it's not that the linux
linker magically searches for libsocket.so - such a library simply
does not exist on Linux. However, I do sympathise - the fact that one
needs to add -lsocket to the linker flags trips up many an open source
app. when building it on Solaris and it gets annoying after a while.
True, but the deeper issue is that we have at least two[1] competing
and incompatible sockets interfaces -- one is the 3SOCKET old-BSD
style family and the other is the 3XNET standards-compliant family.
In most cases, folks really want 3XNET (one example issue: this is the
only way to get ancillary data) and yet they stumble into libsocket
first. The few things 3XNET doesn't offer (*_r, r*, and ether_*
functions) are seldom needed.
I never even knew about 3XNET...why would I want it?
What does the standards compliance give me besides the
tags words "standards compliance"?
Why is 3XNET what other folks want when we don't?
(Using ldd on /usr/bin is very disappointing.)
And how does anyone learn about 3XNET if "man socket", etc,
will show 3SOCKET first and using it gives them either 100% of
what they want or very close to it?
I suspect the easiest way to get more people using 3XNET would
be to submit a patch to the maintainers of autoconf to search for
and use -lxnet on SunOS 5 before -lsocket/-lnsl. So long as they
don't want to use any of the functions that aren't in it.
As for *_r being seldom needed, we need to be more forward
thinking than that, especially considering niagara and threads.
Darren
_______________________________________________
networking-discuss mailing list
[email protected]