Changeset d9f6165 in rtems


Ignore:
Timestamp:
Jan 12, 2001, 1:34:24 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
9c1dc8c
Parents:
4d6b3b6
Message:

2001-01-12 Joel Sherrill <joel@…>

  • src/README.mqueue: Enhanced example.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/ChangeLog

    r4d6b3b6 rd9f6165  
     12001-01-12      Joel Sherrill <joel@OARcorp.com>
     2
     3        * src/README.mqueue: Enhanced example.
     4
    152000-12-19      Joel Sherrill <joel@OARcorp.com>
    26
  • c/src/exec/posix/src/README.mqueue

    r4d6b3b6 rd9f6165  
    77
    88#include <mqueue.h>
     9#include <stdio.h>
    910
    1011main()
     
    1415  int status;
    1516
     17  /* this should create it */
    1618  mqfd = mq_open("myipc",O_WRONLY|O_CREAT,NULL);
     19  if ( (int)mqfd == -1 ) {
     20    perror( "Unable to open message queue" );
     21    exit( 1 );
     22  }
    1723
    1824  status = mq_getattr(mqfd, &mqstat);
    19   printf( "status: %d\n", status );
    2025  if ( !status ) {
    2126    printf( "mq_maxmsg: %d\n", mqstat.mq_maxmsg );
    2227    printf( "mq_msgsize: %d\n", mqstat.mq_msgsize );
    2328    printf( "mq_curmsgs: %d\n", mqstat.mq_curmsgs );
     29  } else {
     30    perror( "Unable to get attributes on message queue" );
     31    exit( 1 );
    2432  }
     33
     34  /* this should delete it */
     35  (void) mq_close( mqfd );
    2536  exit( 0 );
    2637}
  • cpukit/posix/ChangeLog

    r4d6b3b6 rd9f6165  
     12001-01-12      Joel Sherrill <joel@OARcorp.com>
     2
     3        * src/README.mqueue: Enhanced example.
     4
    152000-12-19      Joel Sherrill <joel@OARcorp.com>
    26
  • cpukit/posix/src/README.mqueue

    r4d6b3b6 rd9f6165  
    77
    88#include <mqueue.h>
     9#include <stdio.h>
    910
    1011main()
     
    1415  int status;
    1516
     17  /* this should create it */
    1618  mqfd = mq_open("myipc",O_WRONLY|O_CREAT,NULL);
     19  if ( (int)mqfd == -1 ) {
     20    perror( "Unable to open message queue" );
     21    exit( 1 );
     22  }
    1723
    1824  status = mq_getattr(mqfd, &mqstat);
    19   printf( "status: %d\n", status );
    2025  if ( !status ) {
    2126    printf( "mq_maxmsg: %d\n", mqstat.mq_maxmsg );
    2227    printf( "mq_msgsize: %d\n", mqstat.mq_msgsize );
    2328    printf( "mq_curmsgs: %d\n", mqstat.mq_curmsgs );
     29  } else {
     30    perror( "Unable to get attributes on message queue" );
     31    exit( 1 );
    2432  }
     33
     34  /* this should delete it */
     35  (void) mq_close( mqfd );
    2536  exit( 0 );
    2637}
Note: See TracChangeset for help on using the changeset viewer.