4.104.115
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2007. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <time.h> |
---|
17 | #include <unistd.h> |
---|
18 | #include <errno.h> |
---|
19 | |
---|
20 | #include <rtems/system.h> |
---|
21 | #include <rtems/seterr.h> |
---|
22 | #include <rtems/score/tod.h> |
---|
23 | #include <rtems/libio_.h> |
---|
24 | |
---|
25 | #include <sys/param.h> |
---|
26 | |
---|
27 | /*PAGE |
---|
28 | * |
---|
29 | * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95 |
---|
30 | */ |
---|
31 | |
---|
32 | long sysconf( |
---|
33 | int name |
---|
34 | ) |
---|
35 | { |
---|
36 | if ( name == _SC_CLK_TCK ) |
---|
37 | return (TOD_MICROSECONDS_PER_SECOND / |
---|
38 | rtems_configuration_get_microseconds_per_tick()); |
---|
39 | |
---|
40 | if ( name == _SC_OPEN_MAX ) |
---|
41 | return rtems_libio_number_iops; |
---|
42 | |
---|
43 | if ( name == _SC_GETPW_R_SIZE_MAX ) |
---|
44 | return 1024; |
---|
45 | |
---|
46 | if ( name == _SC_PAGESIZE ) |
---|
47 | return PAGE_SIZE; |
---|
48 | |
---|
49 | #if defined(__sparc__) |
---|
50 | if ( name == 515 ) /* Solaris _SC_STACK_PROT */ |
---|
51 | return 0; |
---|
52 | #endif |
---|
53 | |
---|
54 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.