public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Hide sethostname() in unistd.h
Date: Wed, 17 Jun 2015 08:46:00 -0000	[thread overview]
Message-ID: <20150617084626.GI31537@calimero.vinschen.de> (raw)
In-Reply-To: <558107F2.3030809@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-06-17  8:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 16:27 Christian Franke
2015-06-16 17:45 ` Corinna Vinschen
2015-06-17  5:39   ` Christian Franke
2015-06-17  8:46     ` Corinna Vinschen [this message]
2015-06-17 20:25       ` Christian Franke
2015-06-17 20:57         ` Yaakov Selkowitz
2015-06-17 21:15           ` Eric Blake
2015-06-18  8:26             ` Corinna Vinschen
2015-06-19  5:28               ` Christian Franke
2015-06-19  8:20                 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150617084626.GI31537@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).