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?

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

 



On Sat, Jun 28, 2014 at 12:16 PM, Steven Stewart-Gallus
<sstewartgallus00@xxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux