#886 closed defect (fixed)

fcntl(F_GETFL) POSIX violation (non-blocking fd doesn't return O_NONBLOCK)

Reported by: strauman Owned by: Jennifer Averett
Priority: highest Milestone: 2
Component: fs Version: 4.7
Severity: critical Keywords:
Cc: bugs@…, joel.sherrill@… Blocked By:
Blocking:

Description

fcntl(fd,F_GETFL) fails to set O_NONBLOCK if the descriptor is in non-blocking mode.

This is because rtems_libio_to_fcntl_flags() is IMHO wrong. It returns O_NDELAY instead of O_NONBLOCK and worse, assumes a default value for O_NDELAY which is inconsistent with O_NONBLOCK. newlib 1.13 does not define O_NDELAY (nor, AFAIK, does POSIX).

Release:
4.6, 4.7

Environment:
n/a

How-To-Repeat:
assert ( O_NONBLOCK == rtems_libio_to_fcntl_flags(rtems_libio_fcntl_flags(O_NONBLOCK)) );

Attachments (1)

libio.c.diff (2.1 KB) - added by strauman on 12/03/06 at 13:31:12.
libio.c.diff

Download all attachments as: .zip

Change History (2)

comment:1 Changed on 03/07/06 at 20:02:49 by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Patch applied to both 4.6 branch and head.

Changed on 12/03/06 at 13:31:12 by strauman

Attachment: libio.c.diff added

libio.c.diff

Note: See TracTickets for help on using tickets.