View Issue Details

IDProjectCategoryView StatusLast Update
00002231003.1(2008)/Issue 7System Interfacespublic2010-03-04 16:52
ReporterEdSchouten Assigned Toajosey  
PrioritynormalSeverityEditorialTypeEnhancement Request
Status ResolvedResolutionRejected 
NameEd Schouten
Organization
User Reference
Section<mqueue.h>
Page Number294
Line Number9862-9869
Interp Status---
Final Accepted Text
Summary0000223: mq_* routines use char * for data buffer
DescriptionThe <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 ActionChange 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.
TagsNo tags attached.

Activities

Don Cragun

2010-03-04 16:52

manager   bugnote:0000395

Although we agree that it would have been better if these functions had been designed this way to begin with, we believe that making the change now will break existing, conforming code with no real benefit.

Issue History

Date Modified Username Field Change
2010-02-24 21:16 EdSchouten New Issue
2010-02-24 21:16 EdSchouten Status New => Under Review
2010-02-24 21:16 EdSchouten Assigned To => ajosey
2010-02-24 21:16 EdSchouten Name => Ed Schouten
2010-02-24 21:16 EdSchouten Section => <mqueue.h>
2010-02-24 21:16 EdSchouten Page Number => n/a
2010-02-24 21:16 EdSchouten Line Number => n/a
2010-03-04 16:48 nick Page Number n/a => 294
2010-03-04 16:48 nick Line Number n/a => 9862-9869
2010-03-04 16:48 nick Interp Status => ---
2010-03-04 16:52 Don Cragun Note Added: 0000395
2010-03-04 16:52 Don Cragun Status Under Review => Resolved
2010-03-04 16:52 Don Cragun Resolution Open => Rejected