bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX 2008 available, openat


From: Bruno Haible
Subject: Re: POSIX 2008 available, openat
Date: Mon, 15 Dec 2008 01:18:14 +0100
User-agent: KMail/1.9.9

Hi Jim,

> openat emulation depends on save-cwd (GPL), which can call xgetcwd (GPL), 
> which
> in turn can call xalloc_die (GPL)?

openat() and the related system calls are not supposed to signal errors by
themselves and exit the program. Is it possible to restructure the code so that
they only return an error code?

The dependency openat -> save-cwd -> xgetcwd -> xalloc-die (GPL) could IMO be
avoided by having save_cwd() either return or save an error code of ENOMEM in
case of failure.

The dependency openat -> dirname could be avoided by merging the 'filename'
and 'dirname' modules, something with is already on my TODO list for a long
time.

The dependency openat -> lchown could be handled by changing the license of
'lchown' to LGPL, if you agree.

The dependency openat -> rmdir could be dropped; the module 'rmdir' is obsolete.

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?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]