summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sysconf.c
blob: d13d7a62a144a42ba98990d9af733b83dafb8672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* Get file-specific information about a file.  OpenSolaris version.
   Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#include <unistd.h>
#include <sys/sysconfig.h>

extern long _sysconfig (int which);

static long int posix_sysconf (int name);


/* Get the value of the system variable NAME.  */
long int
__sysconf (int name)
{
  switch (name)
    {
    case _SC_NGROUPS_MAX:
      return _sysconfig (_CONFIG_NGROUPS);
    case _SC_STREAM_MAX:
      return __getdtablesize ();
    case _SC_NPROCESSORS_MAX:
      return _sysconfig (_CONFIG_NPROC_MAX);
    case _SC_STACK_PROT:
      return _sysconfig (_CONFIG_STACK_PROT);
    case _SC_AIO_LISTIO_MAX:
      return _sysconfig (_CONFIG_AIO_LISTIO_MAX);
    case _SC_AIO_MAX:
      return _sysconfig (_CONFIG_AIO_MAX);
    case _SC_AIO_PRIO_DELTA_MAX:
      return _sysconfig (_CONFIG_AIO_PRIO_DELTA_MAX);
    case _SC_DELAYTIMER_MAX:
      return _sysconfig (_CONFIG_DELAYTIMER_MAX);
    case _SC_MQ_OPEN_MAX:
      return _sysconfig (_CONFIG_MQ_OPEN_MAX);
    case _SC_MQ_PRIO_MAX:
      return _sysconfig (_CONFIG_MQ_PRIO_MAX);
    case _SC_RTSIG_MAX:
      return _sysconfig (_CONFIG_RTSIG_MAX);
    case _SC_SEM_NSEMS_MAX:
      return _sysconfig (_CONFIG_SEM_NSEMS_MAX);
    case _SC_SEM_VALUE_MAX:
      return _sysconfig (_CONFIG_SEM_VALUE_MAX);
    case _SC_SIGQUEUE_MAX:
      return _sysconfig (_CONFIG_SIGQUEUE_MAX);
    case _SC_SIGRT_MAX:
      return _sysconfig (_CONFIG_SIGRT_MAX);
    case _SC_SIGRT_MIN:
      return _sysconfig (_CONFIG_SIGRT_MIN);
    case _SC_TIMER_MAX:
      return _sysconfig (_CONFIG_TIMER_MAX);
    case _SC_COHER_BLKSZ:
      return _sysconfig (_CONFIG_COHERENCY);
    case _SC_SPLIT_CACHE:
      return _sysconfig (_CONFIG_SPLIT_CACHE);
    case _SC_ICACHE_SZ:
      return _sysconfig (_CONFIG_ICACHESZ);
    case _SC_DCACHE_SZ:
      return _sysconfig (_CONFIG_DCACHESZ);
    case _SC_ICACHE_LINESZ:
      return _sysconfig (_CONFIG_ICACHELINESZ);
    case _SC_DCACHE_LINESZ:
      return _sysconfig (_CONFIG_DCACHELINESZ);
    case _SC_ICACHE_BLKSZ:
      return _sysconfig (_CONFIG_ICACHEBLKSZ);
    case _SC_DCACHE_BLKSZ:
      return _sysconfig (_CONFIG_DCACHEBLKSZ);
    case _SC_ICACHE_ASSOC:
      return _sysconfig (_CONFIG_ICACHE_ASSOC);
    case _SC_DCACHE_ASSOC:
      return _sysconfig (_CONFIG_DCACHE_ASSOC);
    case _SC_MAXPID:
      return _sysconfig (_CONFIG_MAXPID);
    case _SC_CPUID_MAX:
      return _sysconfig (_CONFIG_CPUID_MAX);
    case _SC_EPHID_MAX:
      return _sysconfig (_CONFIG_EPHID_MAX);
    case _SC_SYMLOOP_MAX:
      return _sysconfig (_CONFIG_SYMLOOP_MAX);
    default:
      return posix_sysconf (name);
  }
}

/* Now the POSIX version.  */
#undef __sysconf
#define __sysconf static posix_sysconf
#include <sysdeps/posix/sysconf.c>

weak_alias (__sysconf, _sysconf)