Use enum types for remote fileio flags

This changes gdbsupport/fileio.h to use enums with underlying types
for the various constants -- open flags, modes, and lseek flags.
These types replace #defines that were previously used.

Then, this fixes all the users of these flags.  This found a few bugs.
Some of these were pedantic (using the constant 0700 where perhaps
FILEIO_S_IRWXU would be more precise), but sparc64-tdep.c confused
host and remote flags.

Also, I believe solib-rocm.c had a couple of arguments in the wrong
order.

I also found that gdb/remote-fileio.c had essentially duplicated some
code from gdbsupport.  This patch removes the duplicates.

New in v2:
- The lseek enum is anonymous, the type itself isn't used, just
  the constants

Approved-By: Simon Marchi <simon.marchi@efficios.com>


12 files changed