[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: purpose of *-safer?
From: |
Bruno Haible |
Subject: |
Re: purpose of *-safer? |
Date: |
Wed, 26 Jul 2006 15:38:25 +0200 |
User-agent: |
KMail/1.9.1 |
Eric Blake wrote:
> POSIX requires [n]>&- and [n]<&- redirection operators to close
> the respective stream, even when n is 0, 1, or 2. POSIX allows an
> implementation to supply replacement file descriptors when exec'ing a
> setuid or setgid program. But in the normal case, implementations really
> do allow you to start life with any of the three standard streams closed.
Thanks for explaining. I wasn't aware that sh has built-in operators
for doing this.
> that doesn't mean GNU programs can't be robust against it.
OK, but what is the correct behaviour? Signal an error?
$ cp --help >&- ; echo $?
cp: write error: Bad file descriptor
1
or treat it like /dev/null?
$ cp --help >&- ; echo $?
0
Bruno
- Re: split stdio-safer into fopen-safer, tmpfile-safer, (continued)
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Eric Blake, 2006/07/25
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Ben Pfaff, 2006/07/25
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Eric Blake, 2006/07/25
- Re: [bug-gnulib] split stdio-safer into fopen-safer, tmpfile-safer, Bruno Haible, 2006/07/26
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Ben Pfaff, 2006/07/26
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Eric Blake, 2006/07/26
- Re: split stdio-safer into fopen-safer, tmpfile-safer, Paul Eggert, 2006/07/27
- Re: purpose of *-safer?, Bruno Haible, 2006/07/25
- Re: purpose of *-safer?, Paul Eggert, 2006/07/27
- Re: purpose of *-safer?, Jim Meyering, 2006/07/27
Re: split stdio-safer into fopen-safer, tmpfile-safer, Eric Blake, 2006/07/28