tech-kern archive

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

Re: O_NOACCESS?



> Right.  You add O_DIRECTORY to that check.

Ah, I misunderstood.  My apologies.

> if ((flags & (FREAD|FWRITE)) == 0 && (flags & O_DIRECTORY) == 0)
>       return EINVAL;
> if ((flags & O_DIRECTORY) != 0 && (flags & (FREAD|FWRITE)) != 0)
>       return EINVAL;

Actually, what I have now skips the latter of those two checks, because
I can't see any reason wby O_DIRECTORY shouldn't be specifiable with,
eg, O_RDONLY.

Am I missing something important there?  After how I missed something
pretty blatantly obvious before, I don't trust myself tonight.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index