[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POSIX 2008 available, openat
From: |
Jim Meyering |
Subject: |
Re: POSIX 2008 available, openat |
Date: |
Mon, 15 Dec 2008 08:40:20 +0100 |
"James Youngman" <address@hidden> wrote:
> On Mon, Dec 15, 2008 at 12:18 AM, Bruno Haible <address@hidden> wrote:
>> However, for openat-die.c I don't see a good replacement. In particular, I
>> don't see a way how openat_restore_fail() could be handled in library code.
>> A program cannot simply continue when its current directory is different from
>> what it was expecting. And errno values don't adequately capture this
>> situation. ?? Any ideas?
>
> I would suggest simply avoiding the case where save_cwd() calls
> xgetcwd(). Certainly this will make openat() fail for directories
> (other than the original current directory) which are not readable.
> However, apart from that restriction, using only fchdir does have the
> advantage that we know that restoring the current directory can't
> fail. (It can fail IIRC on SunOS, but I think we don't support the
> affected versions any more).
This would also cause failure when emulating openat support and running
from an absolute directory whose name is longer than PATH_MAX.
The real solution is to add support for POSIX.2008's proposed
O_SEARCH open flag to our favorite kernels.
- Re: a good pdf-to-text converter? [Re: POSIX 2008 available, (continued)
- Re: POSIX 2008 available, Bruno Haible, 2008/12/10
- Re: POSIX 2008 available, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, openat, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, openat, Jim Meyering, 2008/12/14
- Re: POSIX 2008 available, openat, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, openat, James Youngman, 2008/12/14
- Re: POSIX 2008 available, openat, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, openat,
Jim Meyering <=
- Re: POSIX 2008 available, openat, Jim Meyering, 2008/12/15
- Re: POSIX 2008 available, openat, Bruno Haible, 2008/12/15
- Re: POSIX 2008 available, openat, Eric Blake, 2008/12/15
- Re: POSIX 2008 available, Bruno Haible, 2008/12/21
- Re: POSIX 2008 available, Eric Blake, 2008/12/21