#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 Dec 3, 2006 at 1:31:12 PM.
libio.c.diff

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Mar 7, 2006 at 8:02:49 PM 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 Dec 3, 2006 at 1:31:12 PM by strauman

Attachment: libio.c.diff added

libio.c.diff

Note: See TracTickets for help on using tickets.