Changeset 7ae7cf7 in rtems


Ignore:
Timestamp:
Apr 26, 2002, 11:41:02 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
2b454fa
Parents:
53092d1
Message:

2001-04-26 Joel Sherrill <joel@…>

  • psxmsgq01/init.c: Reflect changes made to address PR81 that reworked POSIX message queues to add a descriptor separate from the underlying message queue. This allows non-blocking to follow the "open" not the underlying queue.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/psxtests/ChangeLog

    r53092d1 r7ae7cf7  
     12001-04-26      Joel Sherrill <joel@OARcorp.com>
     2
     3        * psxmsgq01/init.c: Reflect changes made to address PR81 that
     4        reworked POSIX message queues to add a descriptor separate from
     5        the underlying message queue.  This allows non-blocking to follow
     6        the "open" not the underlying queue.
     7 
    182002-04-14      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    29
  • c/src/tests/psxtests/psxmsgq01/init.c

    r53092d1 r7ae7cf7  
    159159  struct mq_attr  attr;
    160160  int             status;
    161   mqd_t           open_mq[CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES];
     161  mqd_t           open_mq[CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES + 1];
    162162
    163163  attr.mq_maxmsg  = MAXMSG;
     
    204204  fatal_posix_service_status( errno, ENOENT,  "mq_open errno ENOENT");
    205205
    206 
    207206  /*
    208207   * XXX EINTR  - call was interrupted by a signal
     
    225224
    226225  /*
     226   * EEXIST - Create an existing queue.
     227   */
     228
     229  puts( "Init: mq_open - Create an Existing mq (EEXIST)" );
     230  open_mq[0] = mq_open(
     231    Build_Queue_Name(0), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL );
     232  assert( open_mq[0] != (-1) );
     233
     234  n_mq2 = mq_open(
     235    Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL);
     236  fatal_posix_service_status(
     237    (int) n_mq2, (int ) (-1), "mq_open error return status" );
     238  fatal_posix_service_status( errno, EEXIST,  "mq_open errno EEXIST");
     239
     240  status = mq_unlink( Build_Queue_Name(0) );
     241  fatal_posix_service_status( status, 0, "mq_unlink message queue");
     242
     243  status = mq_close( open_mq[0]);
     244  fatal_posix_service_status( status, 0, "mq_close message queue");
     245
     246  /*
    227247   * Open maximum number of message queues
    228248   */
     
    233253      Build_Queue_Name(i), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL );
    234254    assert( open_mq[i] != (-1) );
     255    assert( open_mq[i] );
    235256    /*XXX - Isn't there a more general check */
     257/* JRS     printf( "mq_open 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */
    236258  }
    237259
     
    243265   * XXX EACCES - queue exists permissions specified by o_flag are denied.
    244266   */
    245 
    246   /*
    247    * EEXIST - Create an existing queue.
    248    */
    249 
    250   puts( "Init: mq_open - Create an Existing mq (EEXIST)" );
    251   n_mq2 = mq_open(
    252     Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL);
    253   fatal_posix_service_status(
    254     (int) n_mq2, (int ) (-1), "mq_open error return status" );
    255   fatal_posix_service_status( errno, EEXIST,  "mq_open errno EEXIST");
    256267
    257268  /*
     
    280291
    281292    status = mq_unlink( Build_Queue_Name(i) );
     293    if ( status == -1 )
     294      perror( "mq_unlink" );
    282295    fatal_posix_service_status( status, 0, "mq_unlink message queue");
     296    /* JRS printf( "mq_close/mq_unlink 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */
    283297  }
    284298}
     
    670684   */
    671685
     686#if 0
    672687  puts( "Init: mq_open - Open an existing mq ( same id )" );
    673688  n_mq = mq_open( RD_NAME, 0 );
    674689  fatal_posix_service_status(
    675690    (int) n_mq, (int ) Test_q[RD_QUEUE].mq, "mq_open error return status" );
     691#endif
    676692}
    677693
  • testsuites/psxtests/ChangeLog

    r53092d1 r7ae7cf7  
     12001-04-26      Joel Sherrill <joel@OARcorp.com>
     2
     3        * psxmsgq01/init.c: Reflect changes made to address PR81 that
     4        reworked POSIX message queues to add a descriptor separate from
     5        the underlying message queue.  This allows non-blocking to follow
     6        the "open" not the underlying queue.
     7 
    182002-04-14      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    29
  • testsuites/psxtests/psxmsgq01/init.c

    r53092d1 r7ae7cf7  
    159159  struct mq_attr  attr;
    160160  int             status;
    161   mqd_t           open_mq[CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES];
     161  mqd_t           open_mq[CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES + 1];
    162162
    163163  attr.mq_maxmsg  = MAXMSG;
     
    204204  fatal_posix_service_status( errno, ENOENT,  "mq_open errno ENOENT");
    205205
    206 
    207206  /*
    208207   * XXX EINTR  - call was interrupted by a signal
     
    225224
    226225  /*
     226   * EEXIST - Create an existing queue.
     227   */
     228
     229  puts( "Init: mq_open - Create an Existing mq (EEXIST)" );
     230  open_mq[0] = mq_open(
     231    Build_Queue_Name(0), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL );
     232  assert( open_mq[0] != (-1) );
     233
     234  n_mq2 = mq_open(
     235    Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL);
     236  fatal_posix_service_status(
     237    (int) n_mq2, (int ) (-1), "mq_open error return status" );
     238  fatal_posix_service_status( errno, EEXIST,  "mq_open errno EEXIST");
     239
     240  status = mq_unlink( Build_Queue_Name(0) );
     241  fatal_posix_service_status( status, 0, "mq_unlink message queue");
     242
     243  status = mq_close( open_mq[0]);
     244  fatal_posix_service_status( status, 0, "mq_close message queue");
     245
     246  /*
    227247   * Open maximum number of message queues
    228248   */
     
    233253      Build_Queue_Name(i), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL );
    234254    assert( open_mq[i] != (-1) );
     255    assert( open_mq[i] );
    235256    /*XXX - Isn't there a more general check */
     257/* JRS     printf( "mq_open 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */
    236258  }
    237259
     
    243265   * XXX EACCES - queue exists permissions specified by o_flag are denied.
    244266   */
    245 
    246   /*
    247    * EEXIST - Create an existing queue.
    248    */
    249 
    250   puts( "Init: mq_open - Create an Existing mq (EEXIST)" );
    251   n_mq2 = mq_open(
    252     Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL);
    253   fatal_posix_service_status(
    254     (int) n_mq2, (int ) (-1), "mq_open error return status" );
    255   fatal_posix_service_status( errno, EEXIST,  "mq_open errno EEXIST");
    256267
    257268  /*
     
    280291
    281292    status = mq_unlink( Build_Queue_Name(i) );
     293    if ( status == -1 )
     294      perror( "mq_unlink" );
    282295    fatal_posix_service_status( status, 0, "mq_unlink message queue");
     296    /* JRS printf( "mq_close/mq_unlink 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */
    283297  }
    284298}
     
    670684   */
    671685
     686#if 0
    672687  puts( "Init: mq_open - Open an existing mq ( same id )" );
    673688  n_mq = mq_open( RD_NAME, 0 );
    674689  fatal_posix_service_status(
    675690    (int) n_mq, (int ) Test_q[RD_QUEUE].mq, "mq_open error return status" );
     691#endif
    676692}
    677693
Note: See TracChangeset for help on using the changeset viewer.