aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/std/process.h
blob: 2fdf6ae59b483ea400594b5f3964f549a7617e41 (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
/*
 * Portable process handling routines.
 * $Id$
 * Copyright (c) 1997 by Tycho Softworks.
 * For conditions of distribution and reuse see product license.
 */

#ifndef	__STD_PROCESS_H__
#define	__STD_PROCESS_H__

#ifndef	__STD_TYPES_H__
#include <std/types.h>
#endif

#ifndef	__STD_LIMITS_H__
#include <std/limits.h>
#endif

#ifndef	POSIX2_LIM_H_MISSING
#include <posix2_lim.h>
#endif

#ifndef	POSIX_OPT_H_MISSING
#include <posix_opt.h>
#endif

#ifndef	UNISTD_H_MISSING
#include <unistd.h>
#endif

#ifndef	_SC_OPEN_MAX
#ifndef	CONFNAME_H_MISSING
#include <confname.h>
#else
#ifndef	SYSCONF_H_MISSING
#include <sysconf.h>
#endif
#endif
#endif

#ifndef	PROCESS_H_MISSING
#include <process.h>
#endif

#ifndef	WAIT_H_MISSING
#include <wait.h>
#else
#ifndef	SYS_WAIT_H_MISSING
#include <sys/wait.h>
#endif
#endif

#ifndef ENV_H_MISSING
#include <env.h>
#endif

#ifndef	SYSEXITS_H_MISSING
#include <sysexits.h>
#else
#include <std/sysexits.h>
#endif

/* We now re-evaluate system limits using runtime sysconf() values */ 

#ifdef	_SC_ARG_MAX
#undef	ARG_MAX
#define	ARG_MAX (sysconf(_SC_ARG_MAX))
#endif

#ifdef	_SC_CHILD_MAX
#undef	CHILD_MAX
#define	CHILD_MAX (sysconf(_SC_CHILD_MAX))
#endif

#ifdef	_SC_NGROUPS_MAX
#undef	NGROUPS_MAX
#define	NGROUPS_MAX (sysconf(_SC_NGROUPS_MAX))
#endif

#ifdef	_SC_OPEN_MAX
#undef	OPEN_MAX
#define	OPEN_MAX (sysconf(_SC_OPEN_MAX))
#endif

#ifdef	_SC_STREAM_MAX
#undef	STREAM_MAX
#define	STREAM_MAX (sysconf(_SC_STREAM_MAX))
#endif

#ifdef	_SC_TZNAME_MAX
#undef	TZNAME_MAX
#define	TZNAME_MAX (sysconf(_SC_TZNAME_MAX))
#endif

#ifdef	PID_T_MISSING
typedef	int pid_t;
#endif

#endif