#2158 reopened defect

dup2 is broken

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: Indefinite
Component: fs Version: 4.11
Severity: normal Keywords: POSIX-Compliance
Cc: sebastian.huber@… Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

The dup2 call is just the dup call and this is wrong. The switch in fcntl needs to know which call is dup and which is dup2.

The dup2 call is needed to implement redirection.

Attachments (1)

rtems-dup2-fix.diff (3.5 KB) - added by Chris Johns on 12/03/13 at 17:16:36.
Add dup2 support.

Download all attachments as: .zip

Change History (13)

Changed on 12/03/13 at 17:16:36 by Chris Johns

Attachment: rtems-dup2-fix.diff added

Add dup2 support.

comment:1 Changed on 12/03/13 at 17:16:54 by Chris Johns

Status: newassigned

comment:2 Changed on 12/10/13 at 02:14:52 by Chris Johns

Resolution: fixed
Status: assignedclosed

comment:3 Changed on 12/10/13 at 06:54:45 by Sebastian Huber

Resolution: fixed
Status: closedreopened, sebastian.huber@embedded-brains.de

comment:4 Changed on 12/10/13 at 19:56:07 by Chris Johns

Good idea to link the test case to this PR. I have code to add which redirects stderr and stdout to a buffer.

comment:5 Changed on 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:6 Changed on 03/02/15 at 20:42:45 by Gedare Bloom

Milestone: 4.114.11.1

bump milestone

comment:7 Changed on 02/12/16 at 19:46:07 by Joel Sherrill

Description: modified (diff)

I added this ticket to the potential GSoC project https://devel.rtems.org/wiki/Developer/Projects/Open/POSIXCompliance. Chris mentioned a test case. Where is it? It would be good to get that available.

comment:8 Changed on 01/26/17 at 07:16:00 by Sebastian Huber

Milestone: 4.11.14.11.2

comment:9 Changed on 03/23/17 at 01:03:28 by Chris Johns

Milestone: 4.11.24.11.3

The 4.11.2 milestone is closing.

comment:10 Changed on 04/03/17 at 23:29:20 by Joel Sherrill

Keywords: POSIX-Compliance added

comment:11 Changed on 02/07/18 at 23:19:52 by Chris Johns

Milestone: 4.11.3Indefinite

Requires funding to add a test case. The patch is applied.

comment:12 Changed on 04/22/21 at 23:43:34 by Joel Sherrill

Support for dup2() was added in 2013.

https://git.rtems.org/rtems/commit/cpukit/libcsupport/src/fcntl.c?id=6122cb6af67c88550fecaa786c1dfd3bc1ceb1d1

Older coverage information indicates this code is probably fully covered. This should be confirmed on the master and at least architectures. Then this can be closed.

Note: See TracTickets for help on using tickets.