X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_FREE_WEBM_LAPOSTE,TW_BX,TW_IB,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <4C254D71.7050205@laposte.net> Date: Sat, 26 Jun 2010 02:44:33 +0200 From: Cyrille Lefevre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: history (was Re: base-files: LOGNAME) References: <4C021FA8 DOT 4030403 AT users DOT sourceforge DOT net> <20100531081825 DOT GF16885 AT calimero DOT vinschen DOT de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-me-spamlevel: not-spam X-me-spamrating: 42.020203 X-me-spamcause: OK, (10)(0000)gggruggvucftvghtrhhoucdtuddrvdelhedrtddvucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddvtddmnehlohhgihhnucdlqddvtddmnehlohhgihhnucdlqddvtddmnehnohcuhhhoshhtuchurhhlucdlfedtmd X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Le 31/05/2010 13:22, Andy Koppe a =C3=A9crit : > Posix defines LOGNAME, but regarding USER it only says that it is > "unwise to conflict with certain variables that are frequently > exported by widely used command interpreters and applications". > (http://opengroup.org/onlinepubs/007908799/xbd/envvar.html) FYI only, in short : historically, USER is the bsd variant of the sysv LOGNAME. long... sunos, login(1) both set USER and LOGNAME using pwd->pw_name also, logname(1) uses cuserid(3) instead of getlogin(3) cuserid(3) does getpwuid(geteuid()) || getlogin() || NULL funny, logname(3) does getenv("LOGNAME") in libxpg ! solaris, login(1) only set LOGNAME logname(1) does getlogin(3) in both case, getlogin(3) does an utmp lookup using a kind of ttyslot() * sizeof(struct utmp) || NULL sys5r4, same as solaris, but getlogin(3) does an utmp lookup using a kind of a while getsid(0) !=3D utmp.ut_pid loop cuserid(3) does a getlogin(3) || getpwuid(getuid()) || NULL irix, login(1) and logname(1) does as sunos getlogin(2) does an utmp lookup using a kind of a while ttyname(0||1||2) =3D=3D utmp.ut_line cuserid(3) does as sys5r4 osf1, login(1) does as sunos, logname(1) as solaris getlogin(1) does a syscall _getlogin(2) cuserid(3) does as getpwuid(getuid()) || NULL Regards, Cyrille Lefevre --=20 mailto:Cyrille DOT Lefevre-lists AT laposte DOT net -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple