Anonymous | Login | 2024-12-12 16:08 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000223 | [1003.1(2008)/Issue 7] System Interfaces | Editorial | Enhancement Request | 2010-02-24 21:16 | 2010-03-04 16:52 | ||
Reporter | EdSchouten | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Rejected | ||||
Status | Resolved | ||||||
Name | Ed Schouten | ||||||
Organization | |||||||
User Reference | |||||||
Section | <mqueue.h> | ||||||
Page Number | 294 | ||||||
Line Number | 9862-9869 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0000223: mq_* routines use char * for data buffer | ||||||
Description |
The <mqueue.h> header provides the following functions: ssize_t mq_receive(mqd_t, char *, size_t, unsigned *); int mq_send(mqd_t, const char *, size_t, unsigned); int mq_setattr(mqd_t, const struct mq_attr *restrict, struct mq_attr *restrict); ssize_t mq_timedreceive(mqd_t, char *restrict, size_t, unsigned *restrict, const struct timespec *restrict); int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *); For some reason I've never understood why these routines use char *'s for data buffers, while functions like write() and send() use a void *. Message queues don't use strings. Message queues are binary safe. |
||||||
Desired Action |
Change the prototypes to use void * instead: ssize_t mq_receive(mqd_t, void *, size_t, unsigned *); int mq_send(mqd_t, const void *, size_t, unsigned); int mq_setattr(mqd_t, const struct mq_attr *restrict, struct mq_attr *restrict); ssize_t mq_timedreceive(mqd_t, void *restrict, size_t, unsigned *restrict, const struct timespec *restrict); int mq_timedsend(mqd_t, const void *, size_t, unsigned, const struct timespec *); I suspect this will break code that uses function pointers to refer to these functions, but code that just calls these functions will not be affected. |
||||||
Tags | No tags attached. | ||||||
Attached Files | |||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |