source: rtems/cpukit/posix/src/sysconf.c @ 3bacb250

4.104.115
Last change on this file since 3bacb250 was 1de949a8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 15:49:52

Whitespace removal.

  • Property mode set to 100644
File size: 1.0 KB
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
32long 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.