This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Hide sethostname() in unistd.h


On Jun 17 07:38, Christian Franke wrote:
> Corinna Vinschen wrote:
> >On Jun 16 18:27, Christian Franke wrote:
> >>Found during an experimental build of busybox:
> >>
> >>The sethostname() prototype in /usr/include/sys/unistd.h is enabled also on
> >>Cygwin.
> >>It should be disabled because Cygwin does not provide this function.
> >>
> >>Christian
> >>
> >
> >What about implementing sethostname instead?
> >
> >   extern "C" int
> >   sethostname (const char *name, size_t len)
> >...
> 
> I didn't consider this as an alternative because I guessed that it is
> intentional that sethostname is missing.
> (it is not a typical that someone wants to use Cygwin to change the name of
> a Windows machine)

You're right there.  But, we have a lot of interfaces defined in newlib
headers which are not available on all platforms, but we're not
explicitely filtering them per platform.

Afaics, the problem is the configuration of busybox, not unistd.h.
Checking for prototypes in headers is not sufficient to check for the
availablility of functions, only for the availability of the prototype.
The configuration should also try a link check on the function with
AC_CHECK_FUNC or something like that.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpLKk1DbA3uP.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]