Changeset 3195d9c in rtems


Ignore:
Timestamp:
Mar 8, 1999, 9:39:16 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b10f6e1
Parents:
1bb17020
Message:

Added code to translate internal libio flags to POSIX style flags.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/libio.c

    r1bb17020 r3195d9c  
    159159  unsigned32 fcntl_flags = 0;
    160160
    161   fcntl_flags = rtems_assoc_remote_by_local( access_modes_assoc, flags );
    162   fcntl_flags |=
    163      rtems_assoc_remote_by_local_bitfield(status_flags_assoc, flags);
     161  if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
     162    fcntl_flags |= O_RDWR;
     163  } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
     164    fcntl_flags |= O_RDONLY;
     165  } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
     166    fcntl_flags |= O_WRONLY;
     167  }
     168
     169  if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
     170    fcntl_flags |= O_NDELAY;
     171  }
     172
     173  if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
     174    fcntl_flags |= O_APPEND;
     175  }
     176
     177  if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
     178    fcntl_flags |= O_CREAT;
     179  }
     180
    164181  return fcntl_flags;
    165182}
  • c/src/lib/libc/libio.c

    r1bb17020 r3195d9c  
    159159  unsigned32 fcntl_flags = 0;
    160160
    161   fcntl_flags = rtems_assoc_remote_by_local( access_modes_assoc, flags );
    162   fcntl_flags |=
    163      rtems_assoc_remote_by_local_bitfield(status_flags_assoc, flags);
     161  if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
     162    fcntl_flags |= O_RDWR;
     163  } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
     164    fcntl_flags |= O_RDONLY;
     165  } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
     166    fcntl_flags |= O_WRONLY;
     167  }
     168
     169  if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
     170    fcntl_flags |= O_NDELAY;
     171  }
     172
     173  if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
     174    fcntl_flags |= O_APPEND;
     175  }
     176
     177  if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
     178    fcntl_flags |= O_CREAT;
     179  }
     180
    164181  return fcntl_flags;
    165182}
  • cpukit/libcsupport/src/libio.c

    r1bb17020 r3195d9c  
    159159  unsigned32 fcntl_flags = 0;
    160160
    161   fcntl_flags = rtems_assoc_remote_by_local( access_modes_assoc, flags );
    162   fcntl_flags |=
    163      rtems_assoc_remote_by_local_bitfield(status_flags_assoc, flags);
     161  if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
     162    fcntl_flags |= O_RDWR;
     163  } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
     164    fcntl_flags |= O_RDONLY;
     165  } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
     166    fcntl_flags |= O_WRONLY;
     167  }
     168
     169  if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
     170    fcntl_flags |= O_NDELAY;
     171  }
     172
     173  if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
     174    fcntl_flags |= O_APPEND;
     175  }
     176
     177  if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
     178    fcntl_flags |= O_CREAT;
     179  }
     180
    164181  return fcntl_flags;
    165182}
Note: See TracChangeset for help on using the changeset viewer.