Changeset d3490f27 in rtems


Ignore:
Timestamp:
03/07/06 21:02:45 (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
75bf564
Parents:
f0ad529
Message:

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

PR 886/filesystem

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

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf0ad529 rd3490f27  
     12006-03-07      Till Strauman <strauman@slac.stanford.edu>
     2
     3        PR 886/filesystem
     4        * libcsupport/src/libio.c: fcntl(fd,F_GETFL) fails to set O_NONBLOCK if
     5        the descriptor is in non-blocking mode.
     6
    172006-03-07      Joel Sherrill <joel@OARcorp.com>
    28
  • cpukit/libcsupport/src/libio.c

    rf0ad529 rd3490f27  
    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.