Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F121620696
PR234099_test.c
felix.the.red_gmail.com (Felix Johnson)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
felix.the.red_gmail.com
Jun 28 2025, 1:17 AM
2025-06-28 01:17:05 (UTC+0)
Size
630 B
Referenced Files
None
Subscribers
None
PR234099_test.c
View Options
#include
<stdio.h>
#include
<mqueue.h>
// #include <fcntl.h> // Required for O_CREAT and other O_* macros
int
main
(
void
)
{
mqd_t
mqd
;
struct
mq_attr
attr
;
attr
.
mq_flags
=
0
;
// Blocking mode
attr
.
mq_maxmsg
=
10
;
// Max number of messages
attr
.
mq_msgsize
=
256
;
// Max message size
attr
.
mq_curmsgs
=
0
;
// Ignored for mq_open
// Attempt to open (or create) a message queue named "/testmq"
mqd
=
mq_open
(
"/testmq"
,
O_CREAT
|
O_RDWR
,
0644
,
&
attr
);
if
(
mqd
==
(
mqd_t
)
-1
)
{
perror
(
"mq_open failed"
);
return
1
;
}
mq_close
(
mqd
);
return
0
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20086645
Default Alt Text
PR234099_test.c (630 B)
Attached To
Mode
D51079: Document that fnctl.h is required for mq_open(2)
Attached
Detach File
Event Timeline
Log In to Comment