Re: more precise O_ACCMODE handling

2015-05-04 Thread Philip Guenther
On Mon, 4 May 2015, Miod Vallat wrote: > > > Index: libc/stdlib/posix_pty.c > > > === > > > RCS file: /cvs/src/lib/libc/stdlib/posix_pty.c,v > > > retrieving revision 1.1 > > > diff -u -p -r1.1 posix_pty.c > > > --- libc/stdlib/posix_

Re: more precise O_ACCMODE handling

2015-05-04 Thread Miod Vallat
> > Index: libc/stdlib/posix_pty.c > > === > > RCS file: /cvs/src/lib/libc/stdlib/posix_pty.c,v > > retrieving revision 1.1 > > diff -u -p -r1.1 posix_pty.c > > --- libc/stdlib/posix_pty.c 3 Dec 2012 20:08:33 - 1.1 > > +++ li

Re: more precise O_ACCMODE handling

2015-05-04 Thread Todd C. Miller
On Sun, 03 May 2015 22:07:33 -0700, Philip Guenther wrote: > The flags passed to open(2) and openat(2) are not a simple bitset. > Instead, the bits in O_ACCMODE are effectively an enumeration, and the > other bits are or'ed onto that. > > For example, a function that wraps open(2), taking a fl

more precise O_ACCMODE handling

2015-05-03 Thread Philip Guenther
The flags passed to open(2) and openat(2) are not a simple bitset. Instead, the bits in O_ACCMODE are effectively an enumeration, and the other bits are or'ed onto that. For example, a function that wraps open(2), taking a flag argument that it passes through, that wants to verify that it was