source: trunk/src/emx/src/lib/misc/sysconf.c@ 123

Last change on this file since 123 was 123, checked in by zap, 23 years ago

Started the work for re-designing the EMX C runtime library to not require
EMX.DLL. The new design is projected to be as follows:

  • all emx syscalls are replaced with the routines from the old sys.lib library which is now compilable in both a.out and OMF formats.
  • the sys.a library should be made replaceable and selectable by some gcc switch (e.g. -msyslib=emx would link with emx.a instead of sys.a which would give almost full backward compatibility with emx).
  • All C functions names were renamed to not contain the starting underscore (e.g. fopen and not _fopen). The underscored aliases will be added later with the c_alias library (which will be generated automatically from all public symbols of libc; any exported symbol that do not start with an underscore will be given an underscored alias unless such a symbol is already defined).

Also a lot of updates to the building system. It is now much faster (thanks
to Knut's suggestion of using ash's builtin echo).
Also re-wrote thunk1.asm and thunk2.asm to GAS format; this removes the need
for MASM and makes it possible to use 16-bit functions in a.out programs
without the need for EMX.DLL.
Also made a lot of small changes I don't remember now.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 954 bytes
Line 
1/* sysconf.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */
2
3#include <unistd.h>
4#include <limits.h>
5#include <time.h>
6#include <errno.h>
7
8/* Return the POSIX.1 minimum values, for now. */
9
10long sysconf (int name)
11{
12 switch (name)
13 {
14 case _SC_ARG_MAX:
15 return _POSIX_ARG_MAX;
16
17 case _SC_CHILD_MAX:
18 return _POSIX_CHILD_MAX;
19
20 case _SC_CLK_TCK:
21 /* On emx, CLK_TCK is a constant. On other systems, it may a
22 macro which calls sysconf (_SC_CLK_TCK). */
23
24 return CLK_TCK;
25
26 case _SC_NGROUPS_MAX:
27 return _POSIX_NGROUPS_MAX;
28
29 case _SC_OPEN_MAX:
30 return _POSIX_OPEN_MAX;
31
32 case _SC_STREAM_MAX:
33 return _POSIX_STREAM_MAX;
34
35 case _SC_TZNAME_MAX:
36 return _POSIX_TZNAME_MAX;
37
38 case _SC_JOB_CONTROL:
39 return -1;
40
41 case _SC_SAVED_IDS:
42 return -1;
43
44 case _SC_VERSION:
45 return _POSIX_VERSION;
46
47 default:
48 errno = EINVAL;
49 return -1;
50 }
51}
Note: See TracBrowser for help on using the repository browser.