unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Wolfgang Jaehrling <pro-linux@gmx.de>
Cc: guile-devel@gnu.org
Subject: Re: gethostname max len
Date: Mon, 22 Mar 2004 02:05:11 +0100	[thread overview]
Message-ID: <20040322010510.GA235@gmx.de> (raw)
In-Reply-To: <87ad29on5v.fsf@zip.com.au>

On Mon, Mar 22, 2004 at 08:22:52AM +1000, Kevin Ryde wrote:
>         * posix.c (scm_gethostname): Use sysconf(_SC_HOST_NAME_MAX) and
>         MAXHOSTNAMELEN when available.
> 
> It's possible MAXHOSTNAMELEN is enough in practice, but posix
> specifies HOST_NAME_MAX instead of MAXHOSTNAMELEN, so it seems
> worthwhile checking that too.

The Single Unix Specification says about sysconf():

  "If name is an invalid value, sysconf() shall return -1 and set
  errno to indicate the error. If the variable corresponding to name
  has no limit, sysconf() shall return -1 without changing the value
  of errno."

And in the following informative section:

  "As -1 is a permissible return value in a successful situation, an
  application wishing to check for error situations should set errno
  to 0, then call sysconf(), and, if it returns -1, check to see if
  errno is non-zero."

Which is what Guile probably also should do, otherwise it won't work
correctly on the GNU system, which has no limit on the length of host
names; the current code that checks for ENAMETOOLONG looks quite
GNU/Linux-specific.

Cheers,
Wolfgang

-- 
Repeating false statements makes them true.
Repeating false statements makes them true.
Repeating false statements makes them true.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2004-03-22  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-21 22:22 gethostname max len Kevin Ryde
2004-03-22  1:05 ` Wolfgang Jaehrling [this message]
2004-03-22  1:02   ` Kevin Ryde
2004-03-22  1:34     ` Wolfgang Jaehrling
  -- strict thread matches above, loose matches on Subject: below --
2004-03-26 14:47 Nelson H. F. Beebe
2004-03-27 22:48 ` Kevin Ryde

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=20040322010510.GA235@gmx.de \
    --to=pro-linux@gmx.de \
    --cc=guile-devel@gnu.org \
    --cc=wolfgang@pro-linux.de \
    /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).