Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/spawn.h
+++ new/usr/src/head/spawn.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 /*
28 30 * Copyright (c) 2011 by Delphix. All rights reserved.
29 31 */
30 32
31 33 #ifndef _SPAWN_H
32 34 #define _SPAWN_H
33 35
34 36 #include <sys/feature_tests.h>
35 37 #include <sys/types.h>
36 38 #include <signal.h>
37 39 #include <sched.h>
38 40
39 41 #ifdef __cplusplus
40 42 extern "C" {
41 43 #endif
42 44
43 45 /*
44 46 * flags for posix_spawnattr_setflags()
45 47 */
46 48 #define POSIX_SPAWN_RESETIDS 0x0001
47 49 #define POSIX_SPAWN_SETPGROUP 0x0002
48 50 #define POSIX_SPAWN_SETSIGDEF 0x0004
49 51 #define POSIX_SPAWN_SETSIGMASK 0x0008
50 52 #define POSIX_SPAWN_SETSCHEDPARAM 0x0010
51 53 #define POSIX_SPAWN_SETSCHEDULER 0x0020
52 54 /*
53 55 * non-portable Solaris extensions
54 56 */
55 57 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
56 58 #define POSIX_SPAWN_SETSIGIGN_NP 0x0800
57 59 #define POSIX_SPAWN_NOSIGCHLD_NP 0x1000
58 60 #define POSIX_SPAWN_WAITPID_NP 0x2000
59 61 #define POSIX_SPAWN_NOEXECERR_NP 0x4000
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
60 62 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
61 63
62 64 typedef struct {
63 65 void *__spawn_attrp; /* implementation-private */
64 66 } posix_spawnattr_t;
65 67
66 68 typedef struct {
67 69 void *__file_attrp; /* implementation-private */
68 70 } posix_spawn_file_actions_t;
69 71
70 -#if defined(__STDC__)
71 -
72 72 extern int posix_spawn(
73 73 pid_t *_RESTRICT_KYWD pid,
74 74 const char *_RESTRICT_KYWD path,
75 75 const posix_spawn_file_actions_t *file_actions,
76 76 const posix_spawnattr_t *_RESTRICT_KYWD attrp,
77 77 char *const argv[_RESTRICT_KYWD],
78 78 char *const envp[_RESTRICT_KYWD]);
79 79
80 80 extern int posix_spawnp(
81 81 pid_t *_RESTRICT_KYWD pid,
82 82 const char *_RESTRICT_KYWD file,
83 83 const posix_spawn_file_actions_t *file_actions,
84 84 const posix_spawnattr_t *_RESTRICT_KYWD attrp,
85 85 char *const argv[_RESTRICT_KYWD],
86 86 char *const envp[_RESTRICT_KYWD]);
87 87
88 88 extern int posix_spawn_file_actions_init(
89 89 posix_spawn_file_actions_t *file_actions);
90 90
91 91 extern int posix_spawn_file_actions_destroy(
92 92 posix_spawn_file_actions_t *file_actions);
93 93
94 94 extern int posix_spawn_file_actions_addopen(
95 95 posix_spawn_file_actions_t *_RESTRICT_KYWD file_actions,
96 96 int filedes,
97 97 const char *_RESTRICT_KYWD path,
98 98 int oflag,
99 99 mode_t mode);
100 100
101 101 extern int posix_spawn_file_actions_addclose(
102 102 posix_spawn_file_actions_t *file_actions,
103 103 int filedes);
104 104
105 105 extern int posix_spawn_file_actions_adddup2(
106 106 posix_spawn_file_actions_t *file_actions,
107 107 int filedes,
108 108 int newfiledes);
109 109
110 110 extern int posix_spawnattr_init(
111 111 posix_spawnattr_t *attr);
112 112
113 113 extern int posix_spawnattr_destroy(
114 114 posix_spawnattr_t *attr);
115 115
116 116 extern int posix_spawnattr_setflags(
117 117 posix_spawnattr_t *attr,
118 118 short flags);
119 119
120 120 extern int posix_spawnattr_getflags(
121 121 const posix_spawnattr_t *_RESTRICT_KYWD attr,
122 122 short *_RESTRICT_KYWD flags);
123 123
124 124 extern int posix_spawnattr_setpgroup(
125 125 posix_spawnattr_t *attr,
126 126 pid_t pgroup);
127 127
128 128 extern int posix_spawnattr_getpgroup(
129 129 const posix_spawnattr_t *_RESTRICT_KYWD attr,
130 130 pid_t *_RESTRICT_KYWD pgroup);
131 131
132 132 extern int posix_spawnattr_setschedparam(
133 133 posix_spawnattr_t *_RESTRICT_KYWD attr,
134 134 const struct sched_param *_RESTRICT_KYWD schedparam);
135 135
136 136 extern int posix_spawnattr_getschedparam(
137 137 const posix_spawnattr_t *_RESTRICT_KYWD attr,
138 138 struct sched_param *_RESTRICT_KYWD schedparam);
139 139
140 140 extern int posix_spawnattr_setschedpolicy(
141 141 posix_spawnattr_t *attr,
142 142 int schedpolicy);
143 143
144 144 extern int posix_spawnattr_getschedpolicy(
145 145 const posix_spawnattr_t *_RESTRICT_KYWD attr,
146 146 int *_RESTRICT_KYWD schedpolicy);
147 147
148 148 extern int posix_spawnattr_setsigdefault(
149 149 posix_spawnattr_t *_RESTRICT_KYWD attr,
150 150 const sigset_t *_RESTRICT_KYWD sigdefault);
151 151
152 152 extern int posix_spawnattr_getsigdefault(
153 153 const posix_spawnattr_t *_RESTRICT_KYWD attr,
154 154 sigset_t *_RESTRICT_KYWD sigdefault);
155 155
156 156 /*
157 157 * non-portable Solaris extensions
158 158 */
159 159 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
160 160
161 161 extern int posix_spawn_pipe_np(
162 162 pid_t *_RESTRICT_KYWD pidp,
163 163 int *_RESTRICT_KYWD fdp,
164 164 const char *_RESTRICT_KYWD cmd,
165 165 boolean_t write,
166 166 posix_spawn_file_actions_t *_RESTRICT_KYWD fact,
167 167 posix_spawnattr_t *_RESTRICT_KYWD attr);
168 168
169 169 extern int posix_spawn_file_actions_addclosefrom_np(
170 170 posix_spawn_file_actions_t *file_actions,
171 171 int lowfiledes);
172 172
173 173 extern int posix_spawnattr_setsigignore_np(
174 174 posix_spawnattr_t *_RESTRICT_KYWD attr,
175 175 const sigset_t *_RESTRICT_KYWD sigignore);
176 176
177 177 extern int posix_spawnattr_getsigignore_np(
178 178 const posix_spawnattr_t *_RESTRICT_KYWD attr,
179 179 sigset_t *_RESTRICT_KYWD sigignore);
180 180
↓ open down ↓ |
99 lines elided |
↑ open up ↑ |
181 181 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
182 182
183 183 extern int posix_spawnattr_setsigmask(
184 184 posix_spawnattr_t *_RESTRICT_KYWD attr,
185 185 const sigset_t *_RESTRICT_KYWD sigmask);
186 186
187 187 extern int posix_spawnattr_getsigmask(
188 188 const posix_spawnattr_t *_RESTRICT_KYWD attr,
189 189 sigset_t *_RESTRICT_KYWD sigmask);
190 190
191 -#else /* __STDC__ */
192 -
193 -extern int posix_spawn();
194 -extern int posix_spawnp();
195 -extern int posix_spawn_file_actions_init();
196 -extern int posix_spawn_file_actions_destroy();
197 -extern int posix_spawn_file_actions_addopen();
198 -extern int posix_spawn_file_actions_addclose();
199 -extern int posix_spawn_file_actions_adddup2();
200 -extern int posix_spawnattr_init();
201 -extern int posix_spawnattr_destroy();
202 -extern int posix_spawnattr_setflags();
203 -extern int posix_spawnattr_getflags();
204 -extern int posix_spawnattr_setpgroup();
205 -extern int posix_spawnattr_getpgroup();
206 -extern int posix_spawnattr_setschedparam();
207 -extern int posix_spawnattr_getschedparam();
208 -extern int posix_spawnattr_setschedpolicy();
209 -extern int posix_spawnattr_getschedpolicy();
210 -extern int posix_spawnattr_setsigdefault();
211 -extern int posix_spawnattr_getsigdefault();
212 -#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
213 -extern int posix_spawn_pipe_np();
214 -extern int posix_spawn_file_actions_addclosefrom_np();
215 -extern int posix_spawnattr_setsigignore_np();
216 -extern int posix_spawnattr_getsigignore_np();
217 -#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
218 -extern int posix_spawnattr_setsigmask();
219 -extern int posix_spawnattr_getsigmask();
220 -
221 -#endif /* __STDC__ */
222 -
223 191 #ifdef __cplusplus
224 192 }
225 193 #endif
226 194
227 195 #endif /* _SPAWN_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX