source: rtems/c/src/exec/posix/src/README.mqueue @ 590eb87

4.104.114.84.95
Last change on this file since 590eb87 was 590eb87, checked in by Joel Sherrill <joel.sherrill@…>, on 01/04/00 at 17:08:16

Added this file to contain an example program.

  • Property mode set to 100644
File size: 507 bytes
Line 
1#
2#  $Id$
3#
4
5This program should print out the default attribute settings for a
6POSIX message queue.
7
8#include <mqueue.h>
9
10main()
11{
12  mqd_t mqfd;
13  struct mq_attr mqstat;
14  int status;
15
16  mqfd = mq_open("myipc",O_WRONLY|O_CREAT,NULL);
17
18  status = mq_getattr(mqfd, &mqstat);
19  printf( "status: %d\n", status );
20  if ( !status ) {
21    printf( "mq_maxmsg: %d\n", mqstat.mq_maxmsg );
22    printf( "mq_msgsize: %d\n", mqstat.mq_msgsize );
23    printf( "mq_curmsgs: %d\n", mqstat.mq_curmsgs );
24  }
25  exit( 0 );
26}
27
Note: See TracBrowser for help on using the repository browser.