Last change
on this file since f83676d was
f83676d,
checked in by Ryan Long <ryan.long@…>, on 04/30/21 at 20:01:44
|
sysconf: Remove sysconf(515)
GCC originally needed this 20 years ago. No longer needed, so it
is being removed.
Closes #4391
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup POSIXAPI |
---|
5 | * |
---|
6 | * @brief Get Configurable System Variables |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2007. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifdef HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <time.h> |
---|
23 | #include <unistd.h> |
---|
24 | #include <errno.h> |
---|
25 | |
---|
26 | #include <rtems.h> |
---|
27 | #include <rtems/seterr.h> |
---|
28 | #include <rtems/libio_.h> |
---|
29 | |
---|
30 | #include <sys/param.h> |
---|
31 | |
---|
32 | /* |
---|
33 | * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 95 |
---|
34 | */ |
---|
35 | |
---|
36 | long sysconf( |
---|
37 | int name |
---|
38 | ) |
---|
39 | { |
---|
40 | switch ( name ) { |
---|
41 | case _SC_CLK_TCK: |
---|
42 | return (long) rtems_clock_get_ticks_per_second(); |
---|
43 | case _SC_OPEN_MAX: |
---|
44 | return rtems_libio_number_iops; |
---|
45 | case _SC_GETPW_R_SIZE_MAX: |
---|
46 | return 1024; |
---|
47 | case _SC_PAGESIZE: |
---|
48 | return PAGE_SIZE; |
---|
49 | case _SC_SYMLOOP_MAX: |
---|
50 | return RTEMS_FILESYSTEM_SYMLOOP_MAX; |
---|
51 | case _SC_NPROCESSORS_CONF: |
---|
52 | return (long) rtems_configuration_get_maximum_processors(); |
---|
53 | case _SC_NPROCESSORS_ONLN: |
---|
54 | return (long) rtems_scheduler_get_processor_maximum(); |
---|
55 | case _SC_POSIX_26_VERSION: |
---|
56 | return (long) _POSIX_26_VERSION; |
---|
57 | default: |
---|
58 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
59 | } |
---|
60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.