Changeset 18b32d76 in rtems


Ignore:
Timestamp:
Sep 8, 2017, 1:25:47 PM (23 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
694e946d
Parents:
2fc32460
git-author:
Sebastian Huber <sebastian.huber@…> (09/08/17 13:25:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/12/17 09:50:39)
Message:

posix: Ignore pshared for semaphores

Since we have only one process, sharing between processes is trivial.

Close #3124.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/semaphore.h

    r2fc32460 r18b32d76  
    4444   Objects_Control         Object;
    4545   CORE_semaphore_Control  Semaphore;
    46    int                     process_shared;
    4746   bool                    named;
    4847   bool                    linked;
  • cpukit/posix/include/rtems/posix/semaphoreimpl.h

    r2fc32460 r18b32d76  
    7979  const char                *name,
    8080  size_t                     name_len,
    81   int                        pshared,
    8281  unsigned int               value,
    8382  POSIX_Semaphore_Control  **the_sem
  • cpukit/posix/src/semaphorecreatesupp.c

    r2fc32460 r18b32d76  
    4343  const char                *name_arg,
    4444  size_t                     name_len,
    45   int                        pshared,
    4645  unsigned int               value,
    4746  POSIX_Semaphore_Control  **the_sem
     
    5049  POSIX_Semaphore_Control *the_semaphore;
    5150  char                    *name;
    52 
    53   /* Sharing semaphores among processes is not currently supported */
    54   if (pshared != 0)
    55     rtems_set_errno_and_return_minus_one( ENOSYS );
    5651
    5752  /*
     
    7368    rtems_set_errno_and_return_minus_one( ENOSPC );
    7469  }
    75 
    76   the_semaphore->process_shared  = pshared;
    7770
    7871  if ( name ) {
  • cpukit/posix/src/seminit.c

    r2fc32460 r18b32d76  
    5656    NULL,
    5757    0,
    58     pshared,
    5958    value,
    6059    &the_semaphore
  • cpukit/posix/src/semopen.c

    r2fc32460 r18b32d76  
    120120    name,
    121121    name_len,
    122     false,         /* not shared across processes */
    123122    value,
    124123    &the_semaphore
  • testsuites/psxtests/psxsem01/init.c

    r2fc32460 r18b32d76  
    137137  TEST_BEGIN();
    138138
     139  puts( "Init: sem_init - SUCCESSFUL" );
     140  status = sem_init(&sem2, 1, 1);
     141  fatal_posix_service_status( status, 0, "sem_init with pshared != 0");
     142
     143  puts( "Init: sem_destroy - SUCCESSFUL" );
     144  status = sem_destroy(&sem2);
     145  fatal_posix_service_status( status, 0, "sem_destroy");
     146
    139147  puts( "Init: sem_init - UNSUCCESSFUL (EINVAL)" );
    140148  status = sem_init(NULL, 0, 1);
     
    153161  fatal_posix_service_status( errno, ENOSPC, "sem_init errorno ENOSPC" );
    154162
    155   puts( "Init: sem_init - UNSUCCESSFUL (ENOSYS -- pshared not supported)" );
    156   status = sem_init(&sem2, 1, 1);
    157   fatal_posix_service_status( status, -1, "sem_init error return status");
    158   fatal_posix_service_status( errno, ENOSYS, "sem_init errno set to ENOSYS");
    159 
    160163  puts( "Init: sem_getvalue - SUCCESSFUL ");
    161164  for (i = 0; i < MAX_SEMS; i++) {
     
    166169  }
    167170  puts( "Init: sem_getvalue - UNSUCCESSFUL ");
     171  sem2 = 0;
    168172  status = sem_getvalue(&sem2, &value);
    169173  fatal_posix_service_status( status, -1, "sem_getvalue error return status");
Note: See TracChangeset for help on using the changeset viewer.