where is _WRITE

I have written a number of resource managers in 6.0 and have just updated my
system to 6.1 and have recompiled them. As per Robert Krten’s book, I use
<stdio.h>'s _WRITE and _READ definitions to check on open mode. In 6.1,
however, these definitons have disappeared from stdio.h. They do not appear
to be defined in any other header file. What gives?

Poseidon

“Poseidon” <paul.ryan2@nospam.virgin.net> wrote in message
news:9rr8pl$3qp$1@nntp.qnx.com

I have written a number of resource managers in 6.0 and have just updated
my
system to 6.1 and have recompiled them. As per Robert Krten’s book, I use
stdio.h>'s _WRITE and _READ definitions to check on open mode. In 6.1,
however, these definitons have disappeared from stdio.h. They do not
appear
to be defined in any other header file. What gives?

I think these where not standard C. Since the new library/header that
comes with
6.1 are more standard C (C99) compliant, these macro disappeared.

Poseidon

I think these where not standard C. Since the new library/header that
comes with
6.1 are more standard C (C99) compliant, these macro disappeared.

Thank you, Mario. If Mr. Krten is listening and he is doing an update to his
book, he may want to change page 285 to reflect this.

Poseidon

Hi,

Are you speaking about flags definition? They were _F_READ and _F_WRIT in old Borland C, they are
_IOREAD and _IOWRT in lcc (free C compiler for win32). And now I see under linux
/*

  •  ISO C99 Standard: 7.19 Input/output     <stdio.h>
    

*/
This header include libio.h, and now these flags are:
_IO_NO_READS
_IO_NO_WRITES

Eduard.

Poseidon <paul.ryan2@nospam.virgin.net> wrote in article <9rrjpf$a7n$1@nntp.qnx.com>…

I think these where not standard C. Since the new library/header that
comes with
6.1 are more standard C (C99) compliant, these macro disappeared.

Thank you, Mario. If Mr. Krten is listening and he is doing an update to his
book, he may want to change page 285 to reflect this.

Poseidon

Poseidon <paul.ryan2@nospam.virgin.net> wrote:

I think these where not standard C. Since the new library/header that
comes with
6.1 are more standard C (C99) compliant, these macro disappeared.

Thank you, Mario. If Mr. Krten is listening and he is doing an update to his
book, he may want to change page 285 to reflect this.

Yup; thanks for the update! I just finished the second printing of the book
about 2 months ago, so it won’t make it out for a while, but I’ll make a note of
it.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com
Email my initials at parse dot com.

Hi,

ed1k <ed1k@yahoo.com> wrote in article 01c162e0$dc4b4000$7b6fa8c0@ED1K

Hi,

Are you speaking about flags definition? They were _F_READ and _F_WRIT in old Borland C, they are
_IOREAD and _IOWRT in lcc (free C compiler for win32). And now I see under linux
/*

  •  ISO C99 Standard: 7.19 Input/output     <stdio.h
    

*/
This header include libio.h, and now these flags are:
_IO_NO_READS
_IO_NO_WRITES

I’ve found these flags in a minute under Linux (unfortunately I had no QNX box at that moment). But
I really cannot find the flags in QNX RTP 6.1A. Is there any solution? Or ISO C99 in QNX is
different than ISO C99 in Linux…?

Thanks,
Eduard.

“Mario Charest” <mcharest@clipzinformatic.com> wrote in message
news:9rrfvn$a99$1@inn.qnx.com

“Poseidon” <> paul.ryan2@nospam.virgin.net> > wrote in message
news:9rr8pl$3qp$> 1@nntp.qnx.com> …
I have written a number of resource managers in 6.0 and have just
updated
my
system to 6.1 and have recompiled them. As per Robert Krten’s book, I
use
stdio.h>'s _WRITE and _READ definitions to check on open mode. In 6.1,
however, these definitons have disappeared from stdio.h. They do not
appear
to be defined in any other header file. What gives?

I think these where not standard C. Since the new library/header that
comes with
6.1 are more standard C (C99) compliant, these macro disappeared.

So, what is the proper way to check for the open mode in 6.1?

-Arthur

When I upgraded from 6.0 to 6.1, I put an extra couple of hash defines in my
header file:

#ifndef _WRITE
#define _WRITE 0x0002
#endif

#ifndef _READ
#define _READ 0x0001
#endif

This allows my code to work as before on both 6.0 and 6.1.

Poseidon

“Poseidon” <paul.ryan2@nospam.virgin.net> wrote in message
news:9s6fuv$h64$1@inn.qnx.com

When I upgraded from 6.0 to 6.1, I put an extra couple of hash defines in
my
header file:

#ifndef _WRITE
#define _WRITE 0x0002
#endif

#ifndef _READ
#define _READ 0x0001
#endif

You should change that to use the defines as: _IO_FLAG_RD, _IO_FLAG_WR
instead of the values they represent.

-Adam