[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POSIX 2008 available, openat
From: |
James Youngman |
Subject: |
Re: POSIX 2008 available, openat |
Date: |
Mon, 15 Dec 2008 00:50:03 +0000 |
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).
Coincidentally this probably also breaks the dependency on xgetcwd().
James.
- 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 <=
- Re: POSIX 2008 available, openat, Bruno Haible, 2008/12/14
- Re: POSIX 2008 available, openat, Jim Meyering, 2008/12/15
- 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