httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <>
Subject Re: More compiler warnings
Date Fri, 22 Mar 1996 16:20:34 GMT
In reply to Frank Peters who said
> On Fri, 22 Mar 1996, Paul Richards wrote:
> > In reply to who said
> > > This one seems to be a Solaris'ism.  I can't find a gethostname
> > > prototype in any of the system header files.  I would suggest adding
> > > a manual prototype to conf.h.
> >
> > There's no gethostname in SYSV, it's a BSD call. It only compiles at all
> > because SunOS 5.x still ships with a BSD compatibility library.
> This is incorrect.  Note that SVR4 != SYSV.

What's SVR4 got to do with it?

> The gethostname call is not in the BSD compatibility library under
> solaris, its in libc.  Trust me on porting platform doesn't have
> any of the BSD compatibility libraries or software installed at all.

I work on a SunOS 5.5 box in work which I guess is my alternate
porting platform, do most of my "fun" work on my FreeBSD box at home.

Well, it may be in libc but it's definately slated as s BSD compatibility
function. What exactly that means for the future I don't know but it's
not wholly supported by the rest of the system, headers in particular
are lacking BSD defines and prototypes.

> The man page for gethostname gives this prototype:
>    int gethostname(char *name, int namelen);

gethostname(SunOS/BSD Compatibility Library Functigethostname(3B)
                                          I wonder why that happens?
     gethostname, sethostname - get/set name of current host
     /usr/ucb/cc [ flag ... ] file ...
     int gethostname( name, namelen)
     char *name;
     int namelen;
     int sethostname( name, namelen)
     char *name;
     int namelen;

and at the end

     Use of these interfaces should be restricted to only  appli-
     cations  written  on BSD platforms.  Use of these interfaces
     with any of the system libraries or in multi-thread applica-
     tions is unsupported.

SunOS tries to maintain back compatibility with the very common BSD calls
but I'm pretty certain that SYSV doesn't have them at all (anyone with
a genuine SYSV lineage system ?). Uname is now the most portable way
to do this since most BSD boxes have that as well.

  Paul Richards. Originative Solutions Ltd.  (Netcraft Ltd. contractor)
  Elsevier Science TIS online journal project.
  Phone: 0370 462071 (Mobile), +44 (0)1865 843155

View raw message