|Anonymous | Login||2020-03-31 15:38 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001282||[1003.1(2016)/Issue7+TC2] Base Definitions and Headers||Editorial||Clarification Requested||2019-08-23 16:19||2019-08-24 21:25|
|Page Number||NA - used web|
|Line Number||NA - used web|
|Final Accepted Text|
|Summary||0001282: mqueue.h - pthread_attr_t is listed as defined but unclear why|
Ref: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html [^]
Issue: In mqueue.h, pthread_attr_t is listed as defined but there is no need for it as best I can see in the mqueue APIs. Is this just a cut and paste mistake?
Response from Geoff Clare when asked on mailing list:
"It's needed if you want to have mq_notify() do a SIGEV_THREAD notification. However, what's odd here is that mqueue.h is only required to declare struct sigevent as incomplete, so if you want to actually populate a struct sigevent you therefore need to include signal.h to get it properly defined -- in which case signal.h will define pthread_attr_t, so there is no need for mqueue.h to do it.
So I think either mqueue.h should be required to define struct sigevent or it should not be required to define pthread_attr_t."
There are multiple ways to resolve this but I think Geoff's suggestion of not requiring mqueue.h to define pthread_attr_t seems the simplest. It also is consistent with the example provided with mq_notify() that includes pthread.h.
|Tags||No tags attached.|
The example code includes <pthread.h>, but it doesn't include <signal.h>.
If we don't change <mqueue.h> to require a complete definition of struct sigevent then we should add #include <signal.h> to the example.
edited on: 2019-08-24 21:34
I think the sigevent reference as an incomplete type is so it is not material whether <mqueue.h> #include's <signal.h> or not, or which order an application may #include these headers separately. It would be a quality of implementation issue that these headers note whether the necessary types have been declared already, whichever is referenced first. If an application doesn't make use of mq_notify() it may not have to #include <signal.h> at all then.
What I see as missing, if <mqueue.h> is #include'd first, is that the sigval union should also be defined or declared, as the sigevent structure requires this type also.
|2019-08-23 16:19||joelsherrill||New Issue|
|2019-08-23 16:19||joelsherrill||Name||=> Joel Sherrill|
|2019-08-23 16:19||joelsherrill||Section||=> mqueue.h|
|2019-08-23 16:19||joelsherrill||Page Number||=> NA - used web|
|2019-08-23 16:19||joelsherrill||Line Number||=> NA - used web|
|2019-08-23 16:29||geoffclare||Interp Status||=> ---|
|2019-08-23 16:29||geoffclare||Category||System Interfaces => Base Definitions and Headers|
|2019-08-23 16:41||geoffclare||Note Added: 0004537|
|2019-08-24 21:25||shware_systems||Note Added: 0004539|
|2019-08-24 21:34||shware_systems||Note Edited: 0004539|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|