This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31299] getlog returns blanks when not run from the command prompt
- From: "ebb9 at byu dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2007 04:46:04 -0000
- Subject: [Bug fortran/31299] getlog returns blanks when not run from the command prompt
- References: <bug-31299-14284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ebb9 at byu dot net 2007-03-22 04:46 -------
According to POSIX, "The getlogin() function shall return a pointer to a
string containing the user name associated by the login activity with the
controlling terminal of the current process." The behavior of nohup was
intentionally changed in 5.90, as permitted by POSIX: "If stdin is a
terminal, nohup now redirects it from /dev/null to prevent the command
from tying up an OpenSSH session after you logout." The difference in
behavior, then, is explainable by the fact that the child app no longer
has a controlling terminal, therefore there is no login user to be found.
In my mind, this is considered a feature of coreutils' nohup and not a
bug. And since POSIX permits either behavior (preserving stdin and
keeping a controlling terminal, vs. redirecting stdin and thereby
disassociating from a terminal), it means that getlogin() is not portable
in a nohup environment.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31299