O_NDELAY versus O_NONBLOCK
Joel Sherrill
joel.sherrill@OARcorp.com
Tue Sep 5 06:21:00 GMT 2000
Chris Faylor wrote:
>
> On Sun, Sep 03, 2000 at 01:15:13PM -0500, Joel Sherrill wrote:
> >
> >Simple question. They have different values in newlib but
> >appear to have the same meaning. Under Linux, they have
> >the same value.
> >
> >What should newlib do? If they are supposed to be treated semantically
> >the same, then can they be the same value?
>
> That's a good question. I notice that cygwin sporadically attempts to test
> both values but it isn't consistent.
This is the same thing inside RTEMS. I started tracked down a
problem with fcntl and it turned out to be that the path did not
check one of the part.
> Having them equal makes sense to me.
In starting to fix this, I came across another similar constant --
FNBIO. I don't even see it in the Linux headers, so it can't
be that important. :) Regardless, should this one be the same
value as well -- or does it have different semantics?
Regardless, attached is a patch that makes O_NDELAY and O_NONBLOCK
the same.
2000-09-05 Joel Sherrill <joel@OARcorp.com>
* libc/include/fcntl.h: Make O_NDELAY and O_NONBLOCK
have the same value.
> cgf
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
--- ../original/newlib-1.8.2/newlib/libc/include/sys/fcntl.h Mon Apr 26 20:22:30 1999
+++ newlib-1.8.2/newlib/libc/include/sys/fcntl.h Tue Sep 5 08:13:42 2000
@@ -20,7 +20,7 @@
#define _FEXCL 0x0800 /* error on open if file exists */
#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */
#define _FSYNC 0x2000 /* do all writes synchronously */
-#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
+#define _FNONBLOCK _FNDELAY /* non blocking I/O (POSIX style) */
#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
More information about the Newlib
mailing list