Print

Print


A small side point: the code should not use "#include <sys/poll.h>", 
unless it's unavoidable because of platform problems.  It's a non-standard 
header.  The Unix98 standard header for poll() is <poll.h>:  

http://www.opengroup.org/onlinepubs/007908799/xsh/poll.html

(I know that it's just a forwarding header to sys/poll.h on some
platforms.)

I'd also like to spin the strlcpy() thread a little differently:
On Thu, 04 Dec 2004, Rainer Bartoldus wrote:
> > Actually, I don't think strlcpy() is part of the standard C library.
> > It was introduced by OpenBSD and adopted by Solaris, but it is not
> > there on many flavors of Unix.  In fact, RedHat has been vehemently
> > rejecting it. You get an idea here:
> >
> >   http://sources.redhat.com/ml/libc-alpha/2002-01/msg00001.html

If portability is a value, I would encourage discussions of this sort to
start by reference to the very well documented industry standards, and
only if absolutely necessary move to questions of whether one flavor or
another of extension is or isn't adopted on various platforms.  The Unix98
standard can be found at

http://www.unix.org/version2/online.html

from which I quoted the above link.  

There are some corners of the Unix networking API space that were not yet 
standardized in Unix98, so it's acknowledged that there are a few things 
that simply can't be done without going beyond it.  But this should be a 
well-labeled exception in our code.

BaBar does not yet use its successor, informally known as Unix03, but we
should be keeping an eye on platform support for it.

Finally, at some point in the future we'll have to think about replacing
the deprecated gethostbyname(), etc., with getaddrinfo() and
getnameinfo(), so that we don't run into problems with IPv6.  
Unfortunately the last time we looked at this the new functions weren't
quite up to speed on Solaris (unfortunately I don't remember which
version).

Gregory

P.S. strlcpy() does not appear in Unix98 or Unix03.

On Mon, 23 Aug 2004, Stephen J. Gowdy wrote:
> [cc Gregory, Steffen & Rainer]
> 
> Yeah, forgot to write that hint before.
> 
> On Mon, 23 Aug 2004, Peter Elmer wrote:
> 
> >   Hi Stephen,
> >
> >   We went through this in some private mail just before the mailing list
> > was setup (and Andy said more or less the same thing as you wrote below).
> > ROOT still has some legacy people using Solaris 7, so still needs to support
> > Sol7. Hopefully whoever it is can be convinced that the world has moved on...
> >
> >   [Not sure who you CC-d: note that I've CC-d this to the mailing list and
> > not the HN. That combination isn't doing exactly what I thought it was doing.]
> >
> >                                    Pete
> >
> > On Mon, Aug 23, 2004 at 07:54:18AM -0700, [log in to unmask] wrote:
> > > Hi Gerri,
> > >         Solaris 7 is pretty old. Is there still a need for that? BaBar has
> > > been using Solaris8 for a long time now and we're about to move to 9.
> > > It looks like 10 will be out soon.
> > >         Hopefully Andy can answer your actual question thought... I've
> > > cced a couple of other people who might be knowable about Solaris
> > > "issues" like this one.
> > >
> > >                                                         regards,
> > >
> > >                                                         Stephen.
> > >
> > > On Mon, 23 Aug 2004, Gerardo Ganis  wrote:
> > >
> > > >
> > > >   Hi,
> > > >
> > > >   I could finally test compilation of the latest xrootd test version
> > > >   on Solaris 7: the problem with strlcpy has disappeared,
> > > >   but there is another one that prevents from building
> > > >   successfully:
> > > >
> > > > Making xrd component...
> > > > Compiling XrdPoll.cc
> > > > "/usr/include/sys/poll_impl.h", line 271: Error: A declaration was expected
> > > > instead of "}".
> > > > 1 Error(s) detected.
> > > > gmake[4]: *** [../../obj/sun4x_57/XrdPoll.o] Error 1
> > > > gmake[3]: *** [SunOSall] Error 2
> > > > gmake[2]: *** [all] Error 2
> > > > gmake[1]: *** [Xrd] Error 2
> > > > gmake: *** [all] Error 2
> > > >
> > > >   this is caused by a bug in /usr/include/sys/poll_impl.h:
> > > >   two "if's" are incorrectly nested so that the code opening
> > > >   the "{" never gets pre-processed.
> > > >   Since the first 'if' is
> > > >
> > > > #if defined(_KERNEL) || defined(_KMEMUSER)
> > > >
> > > >   I have made a try by using -D_KMEMUSER to compile XrdPoll.cc:
> > > >   it seems to work fine, but perhaps there are unwanted side-effects.
> > > >
> > > >   The machine I have access runs this:
> > > >
> > > >   "SunOS refsol7 5.7 Generic_106541-20 sun4u sparc SUNW,Ultra-5_10"
> > > >
> > > >   The problem was corrected in more recent versions - eg Solaris 8.
> > > >
> > > >   What should we do?
> > > >
> > > >   Gerri

------------------------------------------------------------------------------
Gregory P. Dubois-Felsmann                                [log in to unmask]
Member of the Professional Staff (Staff Scientist)        tel: +1-626-395-6693
High Energy Physics -- BaBar group -- Caltech             fax: +1-626-584-9304