Re: Does it make sense to define a constant for openat and such that is guaranteed not to be used for special purposes later on?

Started by Andy Lutomirski on Jun 30, 2014

open the first message on its own page

Message details and related content
On Sat, Jun 28, 2014 at 12:16 PM, Steven Stewart-Gallus
[off-list ref] wrote:
Hello,

For system calls such as openat I might wish to use the value -1 for
the directory file descriptor parameter to indicate that a path passed
in must be an absolute path. However, it has occurred to me that such
a usage isn't defined by POSIX and isn't safe for the future. In the
future -1 may be taken to be used for some other special purpose. I
would like a solution for that problem.

It'd be nice if we could define a constant (maybe call it AT_FDNODIR)
to maybe -1 that is set aside to mean that no directory is to be used
and that will not ever be ever used for some other purpose in the
future.
I like this.  Want to submit a patch?

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help