Project

General

Profile

Actions

Bug #5863

closed

psiginfo arguments should be const

Added by Eric Sproul over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-04-23
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

According to POSIX, psiginfo's arguments should all be specified as const, but ours does not. From usr/src/head/siginfo.h :

extern void psiginfo(siginfo_t *, char *);

Based on http://pubs.opengroup.org/stage7tc1/functions/psiginfo.html I think it should look like this:

extern void psiginfo(const siginfo_t *, const char *);

Note that psignal(3C) looks to be compliant, so perhaps this was just an oversight?


Related issues

Related to illumos gate - Bug #5875: psignal and psiginfo should not be exposed in environments prior to POSIX 2008New2015-04-28

Actions
Actions #1

Updated by Eric Sproul over 6 years ago

I should add that this tripped me up when trying to build Apache Trafficserver, which expects psiginfo to use const. The workaround is simple (explicitly casting to const) but it looks like we shouldn't have to do that.

Actions #2

Updated by Eric Sproul over 6 years ago

  • Related to Bug #5875: psignal and psiginfo should not be exposed in environments prior to POSIX 2008 added
Actions #3

Updated by Eric Sproul over 6 years ago

During review, the issue of testing compliance for psiginfo and psignal was raised. During said testing, we realized that these functions are not properly scoped to the standards level where they were introduced. Issue #5875 is open to address that bug, as well as to expand signal.h test coverage.

Actions #4

Updated by Electric Monk over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 3e5de5d019b8b1edc6c40c035fa29f3a41341841

commit  3e5de5d019b8b1edc6c40c035fa29f3a41341841
Author: Eric Sproul <eric.sproul@circonus.com>
Date:   2015-04-28T18:14:23.000Z

    5863 psiginfo arguments should be const
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Actions

Also available in: Atom PDF