Changeset 8552df6 in rtems


Ignore:
Timestamp:
Mar 9, 2015, 2:23:12 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
40ecd11
Parents:
19799fb
git-author:
Sebastian Huber <sebastian.huber@…> (03/09/15 14:23:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/09/15 14:25:17)
Message:

sysconf: Simplify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/sysconf.c

    r19799fb r8552df6  
    2323#include <errno.h>
    2424
    25 #include <rtems/score/todimpl.h>
    26 #include <rtems/system.h>
     25#include <rtems.h>
    2726#include <rtems/seterr.h>
    2827#include <rtems/libio_.h>
     
    3837)
    3938{
    40   if ( name == _SC_CLK_TCK )
    41     return (TOD_MICROSECONDS_PER_SECOND /
    42       rtems_configuration_get_microseconds_per_tick());
    43 
    44   if ( name == _SC_OPEN_MAX )
    45     return rtems_libio_number_iops;
    46 
    47   if ( name == _SC_GETPW_R_SIZE_MAX )
    48     return 1024;
    49 
    50   if ( name == _SC_PAGESIZE )
    51     return PAGE_SIZE;
    52 
    53   if ( name == _SC_SYMLOOP_MAX )
    54     return RTEMS_FILESYSTEM_SYMLOOP_MAX;
    55 
     39  switch ( name ) {
     40    case _SC_CLK_TCK:
     41      return (long) rtems_clock_get_ticks_per_second();
     42    case _SC_OPEN_MAX:
     43      return rtems_libio_number_iops;
     44    case _SC_GETPW_R_SIZE_MAX:
     45      return 1024;
     46    case _SC_PAGESIZE:
     47      return PAGE_SIZE;
     48    case _SC_SYMLOOP_MAX:
     49      return RTEMS_FILESYSTEM_SYMLOOP_MAX;
    5650#if defined(__sparc__)
    57   if ( name == 515 ) /* Solaris _SC_STACK_PROT */
    58    return 0;
     51    case 515: /* Solaris _SC_STACK_PROT */
     52      return 0;
    5953#endif
    60 
    61   rtems_set_errno_and_return_minus_one( EINVAL );
     54    default:
     55      rtems_set_errno_and_return_minus_one( EINVAL );
     56  }
    6257}
Note: See TracChangeset for help on using the changeset viewer.