[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] I Could Have Sworn that the inc Command used to work.
From: |
Ralph Corderoy |
Subject: |
Re: [nmh-workers] I Could Have Sworn that the inc Command used to work. |
Date: |
Mon, 03 Jun 2019 11:28:52 +0100 |
Hi Bakul,
> > Should we simplify the code to demand $LOGNAME exists and use that?
>
> You can use getlogin(3) or getlogin_r(3) as per ISO/IEC 9945-1:1996.
That seems worse. Linux's getlogin(3) says in Description that $LOGNAME
is often more useful, and its Bugs section is an amusing read.
getlogin(3p) from POSIX is also available for detail.
getlogin() copes with multiple usernames for the same ID and finds the
one used on this controlling terminal, checking FDs 0-2 until ‘success’
and crawling utmp. That's overkill for our purposes. $LOGNAME is in
our memory and a function call away, plus it's easy to document and
useful to override.
--
Cheers, Ralph.
- [nmh-workers] I Could Have Sworn that the inc Command used to work., Martin McCormick, 2019/06/01
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., David Levine, 2019/06/01
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/01
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Valdis Klētnieks, 2019/06/01
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/02
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/02
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., David Levine, 2019/06/02
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ken Hornstein, 2019/06/02
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/03
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/03
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work.,
Ralph Corderoy <=
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ken Hornstein, 2019/06/03
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/04
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ken Hornstein, 2019/06/04
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Bakul Shah, 2019/06/08
- Re: [nmh-workers] I Could Have Sworn that the inc Command used to work., Ralph Corderoy, 2019/06/09