This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libio bitflags help please


I am trying to port some code to Linux. THe code uses some bitflags from
stdio.h. These are defined on the other OS as follows

#define _IOFBF  0000 /* full buffered */
#define _IOLBF  0100 /* line buffered */
#define _IONBF  0004 /* not buffered */
#define _IOEOF  0020 /* EOF reached on read */
#define _IOERR  0040 /* I/O error from system */

#define _IOREAD  0001 /* currently reading */
#define _IOWRT  0002 /* currently writing */
#define _IORW  0200 /* opened for reading and writing */

Looking in  stdio.h I can find the following

#define _IOFBF 0   /* Fully buffered.  */
#define _IOLBF 1  /* Line buffered.  */
#define _IONBF 2  /* No buffering.  */

thus I have a 1 to 1 relation of the names for the buffering flags. Then
looking in libio.h I can find the following

#define _IO_NO_READS 4 /* Reading not allowed */
#define _IO_NO_WRITES 8 /* Writing not allowd */
#define _IO_EOF_SEEN 0x10
#define _IO_ERR_SEEN 0x20

thus I can establish the following in the code I am trying to port

#idef LINUX
#define _IOEOF       _IO_EOF_SEEN
#define _IOERR       _IO_ERR_SEEN
#define _IOREAD    ~_IO_NO_READS
#define _IOWRT      ~_IO_NO_WRITES
#endif

But what do I do with _IORW?

Help is appreciated.

Thanks,
Robert

--
Robert Schweikert                      MAY THE SOURCE BE WITH YOU
rjschwei@mindspring.com                         LINUX




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]