#1629 closed defect (fixed)

sigsuspend not following POSIX spec

Reported by: Vinu Rajashekhar Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.11
Severity: normal Keywords:
Cc: sebastian.huber@…, vinutheraj@… Blocked By:
Blocking:

Description

The current sigsuspend implementation is not does not follow the POSIX spec - http://www.opengroup.org/onlinepubs/009695399/functions/sigsuspend.html.

First, the spec wants the signal mask to be replaced. At present, the union of the new signal mask is taken with old signal mask.

Then, sigsuspend is implemented with the help of sigtimedwait. The set of signals sigtimedwait waits upon in the implementation consists of all the signals. This is wrong because sigtimedwait, will successfully return, if any of the signals in the set is pending, which is not the case with sigsuspend. sigsuspend should only return if any of the non-blocked signals are caught, or a signal causes termination of the process. So sigtimedwait should only wait on the non-blocked signals.

I have attached a patch with the necessary changes.

Attachments (6)

sigsuspend.patch (1.2 KB) - added by Vinu Rajashekhar on 07/26/10 at 09:24:05.
patch for sigsuspend.c
sigsuspend_v1.patch (1.3 KB) - added by Vinu Rajashekhar on 07/26/10 at 09:55:09.
patch for sigsuspend.c
sigsuspend_v2.patch (1.4 KB) - added by Vinu Rajashekhar on 07/26/10 at 11:28:32.
patch for sigsuspend.c
sigsuspend_v3.patch (1.3 KB) - added by Vinu Rajashekhar on 07/26/10 at 11:59:44.
patch for sigsuspend.c without RTEMS_DEBUG
sigsuspend_v4.patch (1.5 KB) - added by Vinu Rajashekhar on 07/27/10 at 05:33:38.
patch for sigsuspend.c
psx04_init.patch (466 bytes) - added by Vinu Rajashekhar on 07/27/10 at 05:38:35.
patch for psx04 test

Download all attachments as: .zip

Change History (12)

Changed on 07/26/10 at 09:24:05 by Vinu Rajashekhar

Attachment: sigsuspend.patch added

patch for sigsuspend.c

Changed on 07/26/10 at 09:55:09 by Vinu Rajashekhar

Attachment: sigsuspend_v1.patch added

patch for sigsuspend.c

comment:1 Changed on 07/26/10 at 09:55:09 by Vinu Rajashekhar

attachments.isobsolete: 01

comment:2 Changed on 07/26/10 at 11:16:36 by Sebastian Huber

Cc: Sebastian Huber added

Changed on 07/26/10 at 11:28:32 by Vinu Rajashekhar

Attachment: sigsuspend_v2.patch added

patch for sigsuspend.c

comment:3 Changed on 07/26/10 at 11:28:32 by Vinu Rajashekhar

attachments.isobsolete: 01

Changed on 07/26/10 at 11:59:44 by Vinu Rajashekhar

Attachment: sigsuspend_v3.patch added

patch for sigsuspend.c without RTEMS_DEBUG

Changed on 07/27/10 at 05:33:38 by Vinu Rajashekhar

Attachment: sigsuspend_v4.patch added

patch for sigsuspend.c

comment:4 Changed on 07/27/10 at 05:33:38 by Vinu Rajashekhar

attachments.isobsolete: 01, 1

Changed on 07/27/10 at 05:38:35 by Vinu Rajashekhar

Attachment: psx04_init.patch added

patch for psx04 test

comment:5 Changed on 07/28/10 at 17:28:17 by Vinu Rajashekhar

Resolution: fixed
Status: newclosed

Replying to comment:10:

Patch applied. Confirm the fix is OK on your side and close.

Thanks. Yes, closing this PR.

comment:6 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

Note: See TracTickets for help on using tickets.