Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Török Edwin" <edwin+ml-ocaml@etorok.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Unix.getlogin () fails when stdin is redirected
Date: Wed, 21 Mar 2012 14:26:30 +0200	[thread overview]
Message-ID: <4F69C8F6.2050408@etorok.net> (raw)
In-Reply-To: <20120320224525.GE3352@siouxsie>

On 03/21/2012 12:45 AM, oliver wrote:
> Are there so many bugs in glibc that fixing this one means waiting
> in a long, long queue... and bugfixes will need months or years?
> 
> Are there any reasons this bug is not already fixed?
> And since when is it known?

Using stdin might be on purpose, this is what a glibc comment says:
  /* Get name of tty connected to fd 0.  Return NULL if not a tty or
     if fd 0 isn't open.  Note that a lot of documentation says that
     getlogin() is based on the controlling terminal---what they
     really mean is "the terminal connected to standard input".  The
     getlogin() implementation of DEC Unix, SunOS, Solaris, HP-UX all
     return NULL if fd 0 has been closed, so this is the compatible
     thing to do.  Note that ttyname(open("/dev/tty")) on those
     systems returns /dev/tty, so that is not a possible solution for
     getlogin().  */

--Edwin

  reply	other threads:[~2012-03-21 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 17:51 [Caml-list] " Ricardo Catalinas Jiménez
2012-03-20 18:07 ` [Caml-list] " Ricardo Catalinas Jiménez
2012-03-20 18:28   ` David House
2012-03-20 18:48     ` Till Varoquaux
2012-03-20 19:41       ` Yaron Minsky
2012-03-20 20:12         ` Till Varoquaux
2012-03-20 22:45           ` oliver
2012-03-21 12:26             ` Török Edwin [this message]
2012-03-21  2:17 ` [Caml-list] " malc
2012-03-21 11:29   ` Gerd Stolpmann
2012-03-21 17:59     ` malc
2012-03-21  0:51 [Caml-list] " Gerd Stolpmann
2012-03-21  2:10 ` Yaron Minsky
2012-03-21  2:22   ` Yaron Minsky

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=4F69C8F6.2050408@etorok.net \
    --to=edwin+ml-ocaml@etorok.net \
    --cc=caml-list@inria.fr \
    /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