This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Cpp patches for VMS


On Mon, Nov 19, 2001 at 03:45:55PM -0800, Douglas B. Rupp wrote:

> HAVE_MMAP_FILE is not defined in auto-host.h anyway, so that's not
> it.

Okay.  mmap is documented to exist in the VMS 7.3 CRTL, but I guess
our tests determine it doesn't work.

> I'll try forcing the file to be opened in stream_lf mode, regardless
> of its type.

Also, it might be worth taking the O_BINARY out of the open() call (at
about line 247 of cppfiles.c).

Incidentally, it's perfectly okay to put very OS-specific code in
cppfiles.c as long as you only #ifdef around entire functions, or
define OS-specific macros at the top of the file.  For instance, if
it turns out that changing the arguments to open() is the right fix,
you should put at the top of the file

#ifdef VMS
#define OPEN_FLAGS O_RDONLY, 0666, "magic", "extra", "args"
#else
#define OPEN_FLAGS O_RDONLY|O_NOCTTY|O_BINARY, 0666
#endif

and then much later

  file->fd = open(filename, OPEN_FLAGS);

You could also write your own stat-alike that makes low-level RMS
calls to find the size of the file as it will be reported by read().

I generally mistrust the system runtime library, to the point where in
some ways I'd be more comfortable with code that ignored the CRTL and
most of RMS and did all its own $QIO operations.  No joke.

zw


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