From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12442 invoked by alias); 22 Mar 2007 04:46:13 -0000 Received: (qmail 12377 invoked by uid 48); 22 Mar 2007 04:46:04 -0000 Date: Thu, 22 Mar 2007 04:46:00 -0000 Message-ID: <20070322044604.12376.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/31299] getlog returns blanks when not run from the command prompt In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ebb9 at byu dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg02103.txt.bz2 ------- 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