Thread (1 message) 1 message, 1 author, 2014-06-30

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?

From: Andy Lutomirski <hidden>
Date: 2014-06-30 22:08:10

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
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help