Changeset 5b78cd6 in rtems


Ignore:
Timestamp:
03/07/06 21:02:00 (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
79eb6e21
Parents:
ec24e126
Message:

2006-03-07 Till Strauman <strauman@…>

PR 886/filesystem

  • src/libio.c: fcntl(fd,F_GETFL) fails to set O_NONBLOCK if the descriptor is in non-blocking mode.
Location:
cpukit/libcsupport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/ChangeLog

    rec24e126 r5b78cd6  
     12006-03-07      Till Strauman <strauman@slac.stanford.edu>
     2
     3        PR 886/filesystem
     4        * src/libio.c: fcntl(fd,F_GETFL) fails to set O_NONBLOCK if the
     5        descriptor is in non-blocking mode.
     6
    172005-08-31  Ralf Corsepius  <ralf.corsepius@rtems.org>
    28
  • cpukit/libcsupport/src/libio.c

    rec24e126 r5b78cd6  
    2727#include <errno.h>
    2828
    29 #if ! defined(O_NDELAY)
    30 # if defined(solaris2)
    31 #  define O_NDELAY O_NONBLOCK
    32 # elif defined(__CYGWIN__)
    33 #   define O_NDELAY _FNBIO
    34 # elif defined(RTEMS_NEWLIB)
    35 #  define O_NDELAY _FNBIO
    36 # endif
    37 #endif
    38 
     29/* define this to alias O_NDELAY to  O_NONBLOCK, i.e.,
     30 * O_NDELAY is accepted on input but fcntl(F_GETFL) returns
     31 * O_NONBLOCK. This is because rtems has no distinction
     32 * between the two (but some systems have).
     33 * Note that accepting this alias creates a problem:
     34 * an application trying to clear the non-blocking flag
     35 * using a
     36 *
     37 *    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NDELAY);
     38 *
     39 * does (silently) ignore the operation.
     40 */
     41#undef ACCEPT_O_NDELAY_ALIAS
    3942
    4043#include <errno.h>
     
    115118
    116119rtems_assoc_t status_flags_assoc[] = {
     120#ifdef ACCEPT_O_NDELAY_ALIAS
    117121  { "NO DELAY",  LIBIO_FLAGS_NO_DELAY,  O_NDELAY },
     122#endif
    118123  { "NONBLOCK",  LIBIO_FLAGS_NO_DELAY,  O_NONBLOCK },
    119124  { "APPEND",    LIBIO_FLAGS_APPEND,    O_APPEND },
     
    167172
    168173  if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
    169     fcntl_flags |= O_NDELAY;
     174    fcntl_flags |= O_NONBLOCK;
    170175  }
    171176
Note: See TracChangeset for help on using the changeset viewer.