summaryrefslogtreecommitdiff
path: root/contrib/opie/libmissing/sysconf.c
blob: fb3a5bc75a5418e4b597d1535f58e31f64939c44 (plain) (blame)
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
/* sysconf.c: A (partial) replacement for the sysconf function

%%% copyright-cmetz
This software is Copyright 1996 by Craig Metz, All Rights Reserved.
The Inner Net License Version 2 applies to this software.
You should have received a copy of the license with this software. If
you didn't get a copy, you may request one from <license@inner.net>.

        History:

	Created by cmetz for OPIE 2.3.
*/
#include "opie_cfg.h"
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#include "opie.h"

long sysconf(int name)
{
  switch(name) {
    case _SC_OPEN_MAX:
#if HAVE_GETDTABLESIZE
      return getdtablesize();
#else /* HAVE_GETDTABLESIZE */
#error Need getdtablesize() to build a replacement sysconf()
#endif /* HAVE_GETDTABLESIZE */

  return -1;
}