2 * This file was automatically generated by create-native-map from ../../mcs/class/lib/net_2_0/Mono.Posix.dll.
8 #endif /* ndef HAVE_CONFIG_H */
14 * Implementation Macros
18 #endif /* ndef _GNU_SOURCE */
22 #endif /* ndef _XOPEN_SOURCE */
26 * Implementation Includes
28 #include <sys/types.h>
31 #ifdef HAVE_SYS_POLL_H
33 #endif /* ndef HAVE_SYS_POLL_H */
34 #ifdef HAVE_SYS_WAIT_H
36 #endif /* ndef HAVE_SYS_WAIT_H */
37 #ifdef HAVE_SYS_STATVFS_H
38 #include <sys/statvfs.h>
39 #endif /* ndef HAVE_SYS_STATVFS_H */
40 #ifdef HAVE_SYS_XATTR_H
41 #include <sys/xattr.h>
42 #endif /* ndef HAVE_SYS_XATTR_H */
43 #ifdef HAVE_SYS_MMAN_H
45 #endif /* ndef HAVE_SYS_MMAN_H */
51 #endif /* ndef HAVE_POLL_H */
54 #endif /* ndef HAVE_GRP_H */
58 #endif /* ndef HAVE_SYSLOG_H */
65 #include <errno.h> /* errno, EOVERFLOW */
66 #include <glib.h> /* g* types, g_assert_not_reached() */
68 #if defined (G_MININT8)
69 #define CNM_MININT8 G_MININT8
71 #define CNM_MININT8 (-128)
74 #if defined (G_MAXINT8)
75 #define CNM_MAXINT8 G_MAXINT8
77 #define CNM_MAXINT8 (127)
80 #if defined (G_MAXUINT8)
81 #define CNM_MAXUINT8 G_MAXUINT8
83 #define CNM_MAXUINT8 (255)
86 #if defined (G_MININT16)
87 #define CNM_MININT16 G_MININT16
89 #define CNM_MININT16 (-32768)
92 #if defined (G_MAXINT16)
93 #define CNM_MAXINT16 G_MAXINT16
95 #define CNM_MAXINT16 (32767)
98 #if defined (G_MAXUINT16)
99 #define CNM_MAXUINT16 G_MAXUINT16
101 #define CNM_MAXUINT16 (65535)
104 #if defined (G_MININT32)
105 #define CNM_MININT32 G_MININT32
107 #define CNM_MININT32 (-2147483648)
110 #if defined (G_MAXINT32)
111 #define CNM_MAXINT32 G_MAXINT32
113 #define CNM_MAXINT32 (2147483647)
116 #if defined (G_MAXUINT32)
117 #define CNM_MAXUINT32 G_MAXUINT32
119 #define CNM_MAXUINT32 (4294967295U)
122 #if defined (G_MININT64)
123 #define CNM_MININT64 G_MININT64
125 #define CNM_MININT64 (-9223372036854775808LL)
128 #if defined (G_MAXINT64)
129 #define CNM_MAXINT64 G_MAXINT64
131 #define CNM_MAXINT64 (9223372036854775807LL)
134 #if defined (G_MAXUINT64)
135 #define CNM_MAXUINT64 G_MAXUINT64
137 #define CNM_MAXUINT64 (18446744073709551615ULL)
141 /* returns TRUE if @type is an unsigned type */
142 #define _cnm_integral_type_is_unsigned(type) \
143 (sizeof(type) == sizeof(gint8) \
144 ? (((type)-1) > CNM_MAXINT8) \
145 : sizeof(type) == sizeof(gint16) \
146 ? (((type)-1) > CNM_MAXINT16) \
147 : sizeof(type) == sizeof(gint32) \
148 ? (((type)-1) > CNM_MAXINT32) \
149 : sizeof(type) == sizeof(gint64) \
150 ? (((type)-1) > CNM_MAXINT64) \
151 : (g_assert_not_reached (), 0))
153 /* returns the minimum value of @type as a gint64 */
154 #define _cnm_integral_type_min(type) \
155 (_cnm_integral_type_is_unsigned (type) \
157 : sizeof(type) == sizeof(gint8) \
159 : sizeof(type) == sizeof(gint16) \
161 : sizeof(type) == sizeof(gint32) \
163 : sizeof(type) == sizeof(gint64) \
165 : (g_assert_not_reached (), 0))
167 /* returns the maximum value of @type as a guint64 */
168 #define _cnm_integral_type_max(type) \
169 (_cnm_integral_type_is_unsigned (type) \
170 ? sizeof(type) == sizeof(gint8) \
172 : sizeof(type) == sizeof(gint16) \
174 : sizeof(type) == sizeof(gint32) \
176 : sizeof(type) == sizeof(gint64) \
178 : (g_assert_not_reached (), 0) \
179 : sizeof(type) == sizeof(gint8) \
181 : sizeof(type) == sizeof(gint16) \
183 : sizeof(type) == sizeof(gint32) \
185 : sizeof(type) == sizeof(gint64) \
187 : (g_assert_not_reached (), 0))
190 #define _cnm_dump(to_t,from) \
191 printf ("# %s -> %s: uns=%i; min=%llx; max=%llx; value=%llx; lt=%i; l0=%i; gt=%i; e=%i\n", \
193 (int) _cnm_integral_type_is_unsigned (to_t), \
194 (gint64) (_cnm_integral_type_min (to_t)), \
195 (gint64) (_cnm_integral_type_max (to_t)), \
197 (((gint64) _cnm_integral_type_min (to_t)) <= (gint64) from), \
199 (((guint64) from) <= (guint64) _cnm_integral_type_max (to_t)), \
200 !((int) _cnm_integral_type_is_unsigned (to_t) \
202 ((guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
203 : ((gint64) _cnm_integral_type_min(to_t) <= (gint64) from && \
204 (guint64) from <= (guint64) _cnm_integral_type_max (to_t))) \
206 #else /* ndef _CNM_DUMP */
207 #define _cnm_dump(to_t, from) do {} while (0)
208 #endif /* def _CNM_DUMP */
211 #define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
212 int uns = _cnm_integral_type_is_unsigned (to_t); \
213 gint64 min = (gint64) _cnm_integral_type_min (to_t); \
214 guint64 max = (guint64) _cnm_integral_type_max (to_t); \
215 gint64 sf = (gint64) from; \
216 guint64 uf = (guint64) from; \
217 if (!(uns ? ((0 <= from) && (uf <= max)) \
218 : (min <= sf && (from < 0 || uf <= max)))) { \
219 _cnm_dump(to_t, from); \
224 #else /* !def DEBUG */
225 /* don't do any overflow checking */
226 #define _cnm_return_val_if_overflow(to_t,from,val) G_STMT_START { \
228 #endif /* def DEBUG */
230 int Mono_Posix_FromAccessModes (int x
, int *r
)
233 if ((x
& Mono_Posix_AccessModes_F_OK
) == Mono_Posix_AccessModes_F_OK
)
237 {errno
= EINVAL
; return -1;}
238 #endif /* ndef F_OK */
239 if ((x
& Mono_Posix_AccessModes_R_OK
) == Mono_Posix_AccessModes_R_OK
)
243 {errno
= EINVAL
; return -1;}
244 #endif /* ndef R_OK */
245 if ((x
& Mono_Posix_AccessModes_W_OK
) == Mono_Posix_AccessModes_W_OK
)
249 {errno
= EINVAL
; return -1;}
250 #endif /* ndef W_OK */
251 if ((x
& Mono_Posix_AccessModes_X_OK
) == Mono_Posix_AccessModes_X_OK
)
255 {errno
= EINVAL
; return -1;}
256 #endif /* ndef X_OK */
262 int Mono_Posix_ToAccessModes (int x
, int *r
)
268 if ((x
& F_OK
) == F_OK
)
269 *r
|= Mono_Posix_AccessModes_F_OK
;
270 #endif /* ndef F_OK */
272 if ((x
& R_OK
) == R_OK
)
273 *r
|= Mono_Posix_AccessModes_R_OK
;
274 #endif /* ndef R_OK */
276 if ((x
& W_OK
) == W_OK
)
277 *r
|= Mono_Posix_AccessModes_W_OK
;
278 #endif /* ndef W_OK */
280 if ((x
& X_OK
) == X_OK
)
281 *r
|= Mono_Posix_AccessModes_X_OK
;
282 #endif /* ndef X_OK */
286 int Mono_Posix_FromConfstrName (int x
, int *r
)
289 if (x
== Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION
)
290 #ifdef _CS_GNU_LIBC_VERSION
291 {*r
= _CS_GNU_LIBC_VERSION
; return 0;}
292 #else /* def _CS_GNU_LIBC_VERSION */
293 {errno
= EINVAL
; return -1;}
294 #endif /* ndef _CS_GNU_LIBC_VERSION */
295 if (x
== Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION
)
296 #ifdef _CS_GNU_LIBPTHREAD_VERSION
297 {*r
= _CS_GNU_LIBPTHREAD_VERSION
; return 0;}
298 #else /* def _CS_GNU_LIBPTHREAD_VERSION */
299 {errno
= EINVAL
; return -1;}
300 #endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
301 if (x
== Mono_Posix_ConfstrName__CS_LFS64_CFLAGS
)
302 #ifdef _CS_LFS64_CFLAGS
303 {*r
= _CS_LFS64_CFLAGS
; return 0;}
304 #else /* def _CS_LFS64_CFLAGS */
305 {errno
= EINVAL
; return -1;}
306 #endif /* ndef _CS_LFS64_CFLAGS */
307 if (x
== Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS
)
308 #ifdef _CS_LFS64_LDFLAGS
309 {*r
= _CS_LFS64_LDFLAGS
; return 0;}
310 #else /* def _CS_LFS64_LDFLAGS */
311 {errno
= EINVAL
; return -1;}
312 #endif /* ndef _CS_LFS64_LDFLAGS */
313 if (x
== Mono_Posix_ConfstrName__CS_LFS64_LIBS
)
314 #ifdef _CS_LFS64_LIBS
315 {*r
= _CS_LFS64_LIBS
; return 0;}
316 #else /* def _CS_LFS64_LIBS */
317 {errno
= EINVAL
; return -1;}
318 #endif /* ndef _CS_LFS64_LIBS */
319 if (x
== Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS
)
320 #ifdef _CS_LFS64_LINTFLAGS
321 {*r
= _CS_LFS64_LINTFLAGS
; return 0;}
322 #else /* def _CS_LFS64_LINTFLAGS */
323 {errno
= EINVAL
; return -1;}
324 #endif /* ndef _CS_LFS64_LINTFLAGS */
325 if (x
== Mono_Posix_ConfstrName__CS_LFS_CFLAGS
)
326 #ifdef _CS_LFS_CFLAGS
327 {*r
= _CS_LFS_CFLAGS
; return 0;}
328 #else /* def _CS_LFS_CFLAGS */
329 {errno
= EINVAL
; return -1;}
330 #endif /* ndef _CS_LFS_CFLAGS */
331 if (x
== Mono_Posix_ConfstrName__CS_LFS_LDFLAGS
)
332 #ifdef _CS_LFS_LDFLAGS
333 {*r
= _CS_LFS_LDFLAGS
; return 0;}
334 #else /* def _CS_LFS_LDFLAGS */
335 {errno
= EINVAL
; return -1;}
336 #endif /* ndef _CS_LFS_LDFLAGS */
337 if (x
== Mono_Posix_ConfstrName__CS_LFS_LIBS
)
339 {*r
= _CS_LFS_LIBS
; return 0;}
340 #else /* def _CS_LFS_LIBS */
341 {errno
= EINVAL
; return -1;}
342 #endif /* ndef _CS_LFS_LIBS */
343 if (x
== Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS
)
344 #ifdef _CS_LFS_LINTFLAGS
345 {*r
= _CS_LFS_LINTFLAGS
; return 0;}
346 #else /* def _CS_LFS_LINTFLAGS */
347 {errno
= EINVAL
; return -1;}
348 #endif /* ndef _CS_LFS_LINTFLAGS */
349 if (x
== Mono_Posix_ConfstrName__CS_PATH
)
351 {*r
= _CS_PATH
; return 0;}
352 #else /* def _CS_PATH */
353 {errno
= EINVAL
; return -1;}
354 #endif /* ndef _CS_PATH */
355 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS
)
356 #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
357 {*r
= _CS_POSIX_V6_ILP32_OFF32_CFLAGS
; return 0;}
358 #else /* def _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
359 {errno
= EINVAL
; return -1;}
360 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
361 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS
)
362 #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
363 {*r
= _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
; return 0;}
364 #else /* def _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
365 {errno
= EINVAL
; return -1;}
366 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
367 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS
)
368 #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
369 {*r
= _CS_POSIX_V6_ILP32_OFF32_LIBS
; return 0;}
370 #else /* def _CS_POSIX_V6_ILP32_OFF32_LIBS */
371 {errno
= EINVAL
; return -1;}
372 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
373 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
)
374 #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
375 {*r
= _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
; return 0;}
376 #else /* def _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
377 {errno
= EINVAL
; return -1;}
378 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
379 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
)
380 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
381 {*r
= _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
; return 0;}
382 #else /* def _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
383 {errno
= EINVAL
; return -1;}
384 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
385 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
)
386 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
387 {*r
= _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
; return 0;}
388 #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
389 {errno
= EINVAL
; return -1;}
390 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
391 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS
)
392 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
393 {*r
= _CS_POSIX_V6_ILP32_OFFBIG_LIBS
; return 0;}
394 #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
395 {errno
= EINVAL
; return -1;}
396 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
397 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
)
398 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
399 {*r
= _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
; return 0;}
400 #else /* def _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
401 {errno
= EINVAL
; return -1;}
402 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
403 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS
)
404 #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
405 {*r
= _CS_POSIX_V6_LP64_OFF64_CFLAGS
; return 0;}
406 #else /* def _CS_POSIX_V6_LP64_OFF64_CFLAGS */
407 {errno
= EINVAL
; return -1;}
408 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
409 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS
)
410 #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
411 {*r
= _CS_POSIX_V6_LP64_OFF64_LDFLAGS
; return 0;}
412 #else /* def _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
413 {errno
= EINVAL
; return -1;}
414 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
415 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS
)
416 #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
417 {*r
= _CS_POSIX_V6_LP64_OFF64_LIBS
; return 0;}
418 #else /* def _CS_POSIX_V6_LP64_OFF64_LIBS */
419 {errno
= EINVAL
; return -1;}
420 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
421 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS
)
422 #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
423 {*r
= _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
; return 0;}
424 #else /* def _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
425 {errno
= EINVAL
; return -1;}
426 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
427 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
)
428 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
429 {*r
= _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
; return 0;}
430 #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
431 {errno
= EINVAL
; return -1;}
432 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
433 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
)
434 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
435 {*r
= _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
; return 0;}
436 #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
437 {errno
= EINVAL
; return -1;}
438 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
439 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS
)
440 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
441 {*r
= _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
; return 0;}
442 #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
443 {errno
= EINVAL
; return -1;}
444 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
445 if (x
== Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
)
446 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
447 {*r
= _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
; return 0;}
448 #else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
449 {errno
= EINVAL
; return -1;}
450 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
451 if (x
== Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS
)
452 #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
453 {*r
= _CS_V6_WIDTH_RESTRICTED_ENVS
; return 0;}
454 #else /* def _CS_V6_WIDTH_RESTRICTED_ENVS */
455 {errno
= EINVAL
; return -1;}
456 #endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
457 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS
)
458 #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
459 {*r
= _CS_XBS5_ILP32_OFF32_CFLAGS
; return 0;}
460 #else /* def _CS_XBS5_ILP32_OFF32_CFLAGS */
461 {errno
= EINVAL
; return -1;}
462 #endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
463 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS
)
464 #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
465 {*r
= _CS_XBS5_ILP32_OFF32_LDFLAGS
; return 0;}
466 #else /* def _CS_XBS5_ILP32_OFF32_LDFLAGS */
467 {errno
= EINVAL
; return -1;}
468 #endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
469 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS
)
470 #ifdef _CS_XBS5_ILP32_OFF32_LIBS
471 {*r
= _CS_XBS5_ILP32_OFF32_LIBS
; return 0;}
472 #else /* def _CS_XBS5_ILP32_OFF32_LIBS */
473 {errno
= EINVAL
; return -1;}
474 #endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
475 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS
)
476 #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
477 {*r
= _CS_XBS5_ILP32_OFF32_LINTFLAGS
; return 0;}
478 #else /* def _CS_XBS5_ILP32_OFF32_LINTFLAGS */
479 {errno
= EINVAL
; return -1;}
480 #endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
481 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS
)
482 #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
483 {*r
= _CS_XBS5_ILP32_OFFBIG_CFLAGS
; return 0;}
484 #else /* def _CS_XBS5_ILP32_OFFBIG_CFLAGS */
485 {errno
= EINVAL
; return -1;}
486 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
487 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS
)
488 #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
489 {*r
= _CS_XBS5_ILP32_OFFBIG_LDFLAGS
; return 0;}
490 #else /* def _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
491 {errno
= EINVAL
; return -1;}
492 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
493 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS
)
494 #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
495 {*r
= _CS_XBS5_ILP32_OFFBIG_LIBS
; return 0;}
496 #else /* def _CS_XBS5_ILP32_OFFBIG_LIBS */
497 {errno
= EINVAL
; return -1;}
498 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
499 if (x
== Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS
)
500 #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
501 {*r
= _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
; return 0;}
502 #else /* def _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
503 {errno
= EINVAL
; return -1;}
504 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
505 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS
)
506 #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
507 {*r
= _CS_XBS5_LP64_OFF64_CFLAGS
; return 0;}
508 #else /* def _CS_XBS5_LP64_OFF64_CFLAGS */
509 {errno
= EINVAL
; return -1;}
510 #endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
511 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS
)
512 #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
513 {*r
= _CS_XBS5_LP64_OFF64_LDFLAGS
; return 0;}
514 #else /* def _CS_XBS5_LP64_OFF64_LDFLAGS */
515 {errno
= EINVAL
; return -1;}
516 #endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
517 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS
)
518 #ifdef _CS_XBS5_LP64_OFF64_LIBS
519 {*r
= _CS_XBS5_LP64_OFF64_LIBS
; return 0;}
520 #else /* def _CS_XBS5_LP64_OFF64_LIBS */
521 {errno
= EINVAL
; return -1;}
522 #endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
523 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS
)
524 #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
525 {*r
= _CS_XBS5_LP64_OFF64_LINTFLAGS
; return 0;}
526 #else /* def _CS_XBS5_LP64_OFF64_LINTFLAGS */
527 {errno
= EINVAL
; return -1;}
528 #endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
529 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS
)
530 #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
531 {*r
= _CS_XBS5_LPBIG_OFFBIG_CFLAGS
; return 0;}
532 #else /* def _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
533 {errno
= EINVAL
; return -1;}
534 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
535 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS
)
536 #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
537 {*r
= _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
; return 0;}
538 #else /* def _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
539 {errno
= EINVAL
; return -1;}
540 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
541 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS
)
542 #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
543 {*r
= _CS_XBS5_LPBIG_OFFBIG_LIBS
; return 0;}
544 #else /* def _CS_XBS5_LPBIG_OFFBIG_LIBS */
545 {errno
= EINVAL
; return -1;}
546 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
547 if (x
== Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
)
548 #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
549 {*r
= _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
; return 0;}
550 #else /* def _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
551 {errno
= EINVAL
; return -1;}
552 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
555 errno
= EINVAL
; return -1;
558 int Mono_Posix_ToConfstrName (int x
, int *r
)
563 #ifdef _CS_GNU_LIBC_VERSION
564 if (x
== _CS_GNU_LIBC_VERSION
)
565 {*r
= Mono_Posix_ConfstrName__CS_GNU_LIBC_VERSION
; return 0;}
566 #endif /* ndef _CS_GNU_LIBC_VERSION */
567 #ifdef _CS_GNU_LIBPTHREAD_VERSION
568 if (x
== _CS_GNU_LIBPTHREAD_VERSION
)
569 {*r
= Mono_Posix_ConfstrName__CS_GNU_LIBPTHREAD_VERSION
; return 0;}
570 #endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
571 #ifdef _CS_LFS64_CFLAGS
572 if (x
== _CS_LFS64_CFLAGS
)
573 {*r
= Mono_Posix_ConfstrName__CS_LFS64_CFLAGS
; return 0;}
574 #endif /* ndef _CS_LFS64_CFLAGS */
575 #ifdef _CS_LFS64_LDFLAGS
576 if (x
== _CS_LFS64_LDFLAGS
)
577 {*r
= Mono_Posix_ConfstrName__CS_LFS64_LDFLAGS
; return 0;}
578 #endif /* ndef _CS_LFS64_LDFLAGS */
579 #ifdef _CS_LFS64_LIBS
580 if (x
== _CS_LFS64_LIBS
)
581 {*r
= Mono_Posix_ConfstrName__CS_LFS64_LIBS
; return 0;}
582 #endif /* ndef _CS_LFS64_LIBS */
583 #ifdef _CS_LFS64_LINTFLAGS
584 if (x
== _CS_LFS64_LINTFLAGS
)
585 {*r
= Mono_Posix_ConfstrName__CS_LFS64_LINTFLAGS
; return 0;}
586 #endif /* ndef _CS_LFS64_LINTFLAGS */
587 #ifdef _CS_LFS_CFLAGS
588 if (x
== _CS_LFS_CFLAGS
)
589 {*r
= Mono_Posix_ConfstrName__CS_LFS_CFLAGS
; return 0;}
590 #endif /* ndef _CS_LFS_CFLAGS */
591 #ifdef _CS_LFS_LDFLAGS
592 if (x
== _CS_LFS_LDFLAGS
)
593 {*r
= Mono_Posix_ConfstrName__CS_LFS_LDFLAGS
; return 0;}
594 #endif /* ndef _CS_LFS_LDFLAGS */
596 if (x
== _CS_LFS_LIBS
)
597 {*r
= Mono_Posix_ConfstrName__CS_LFS_LIBS
; return 0;}
598 #endif /* ndef _CS_LFS_LIBS */
599 #ifdef _CS_LFS_LINTFLAGS
600 if (x
== _CS_LFS_LINTFLAGS
)
601 {*r
= Mono_Posix_ConfstrName__CS_LFS_LINTFLAGS
; return 0;}
602 #endif /* ndef _CS_LFS_LINTFLAGS */
605 {*r
= Mono_Posix_ConfstrName__CS_PATH
; return 0;}
606 #endif /* ndef _CS_PATH */
607 #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
608 if (x
== _CS_POSIX_V6_ILP32_OFF32_CFLAGS
)
609 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_CFLAGS
; return 0;}
610 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
611 #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
612 if (x
== _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
)
613 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LDFLAGS
; return 0;}
614 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
615 #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
616 if (x
== _CS_POSIX_V6_ILP32_OFF32_LIBS
)
617 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LIBS
; return 0;}
618 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
619 #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
620 if (x
== _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
)
621 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
; return 0;}
622 #endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
623 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
624 if (x
== _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
)
625 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
; return 0;}
626 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
627 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
628 if (x
== _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
)
629 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
; return 0;}
630 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
631 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
632 if (x
== _CS_POSIX_V6_ILP32_OFFBIG_LIBS
)
633 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LIBS
; return 0;}
634 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
635 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
636 if (x
== _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
)
637 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
; return 0;}
638 #endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
639 #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
640 if (x
== _CS_POSIX_V6_LP64_OFF64_CFLAGS
)
641 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_CFLAGS
; return 0;}
642 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
643 #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
644 if (x
== _CS_POSIX_V6_LP64_OFF64_LDFLAGS
)
645 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LDFLAGS
; return 0;}
646 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
647 #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
648 if (x
== _CS_POSIX_V6_LP64_OFF64_LIBS
)
649 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LIBS
; return 0;}
650 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
651 #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
652 if (x
== _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
)
653 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LP64_OFF64_LINTFLAGS
; return 0;}
654 #endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
655 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
656 if (x
== _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
)
657 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
; return 0;}
658 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
659 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
660 if (x
== _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
)
661 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
; return 0;}
662 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
663 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
664 if (x
== _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
)
665 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LIBS
; return 0;}
666 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
667 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
668 if (x
== _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
)
669 {*r
= Mono_Posix_ConfstrName__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
; return 0;}
670 #endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
671 #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
672 if (x
== _CS_V6_WIDTH_RESTRICTED_ENVS
)
673 {*r
= Mono_Posix_ConfstrName__CS_V6_WIDTH_RESTRICTED_ENVS
; return 0;}
674 #endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
675 #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
676 if (x
== _CS_XBS5_ILP32_OFF32_CFLAGS
)
677 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_CFLAGS
; return 0;}
678 #endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
679 #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
680 if (x
== _CS_XBS5_ILP32_OFF32_LDFLAGS
)
681 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LDFLAGS
; return 0;}
682 #endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
683 #ifdef _CS_XBS5_ILP32_OFF32_LIBS
684 if (x
== _CS_XBS5_ILP32_OFF32_LIBS
)
685 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LIBS
; return 0;}
686 #endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
687 #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
688 if (x
== _CS_XBS5_ILP32_OFF32_LINTFLAGS
)
689 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFF32_LINTFLAGS
; return 0;}
690 #endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
691 #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
692 if (x
== _CS_XBS5_ILP32_OFFBIG_CFLAGS
)
693 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_CFLAGS
; return 0;}
694 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
695 #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
696 if (x
== _CS_XBS5_ILP32_OFFBIG_LDFLAGS
)
697 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LDFLAGS
; return 0;}
698 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
699 #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
700 if (x
== _CS_XBS5_ILP32_OFFBIG_LIBS
)
701 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LIBS
; return 0;}
702 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
703 #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
704 if (x
== _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
)
705 {*r
= Mono_Posix_ConfstrName__CS_XBS5_ILP32_OFFBIG_LINTFLAGS
; return 0;}
706 #endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
707 #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
708 if (x
== _CS_XBS5_LP64_OFF64_CFLAGS
)
709 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_CFLAGS
; return 0;}
710 #endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
711 #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
712 if (x
== _CS_XBS5_LP64_OFF64_LDFLAGS
)
713 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LDFLAGS
; return 0;}
714 #endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
715 #ifdef _CS_XBS5_LP64_OFF64_LIBS
716 if (x
== _CS_XBS5_LP64_OFF64_LIBS
)
717 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LIBS
; return 0;}
718 #endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
719 #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
720 if (x
== _CS_XBS5_LP64_OFF64_LINTFLAGS
)
721 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LP64_OFF64_LINTFLAGS
; return 0;}
722 #endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
723 #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
724 if (x
== _CS_XBS5_LPBIG_OFFBIG_CFLAGS
)
725 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_CFLAGS
; return 0;}
726 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
727 #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
728 if (x
== _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
)
729 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LDFLAGS
; return 0;}
730 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
731 #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
732 if (x
== _CS_XBS5_LPBIG_OFFBIG_LIBS
)
733 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LIBS
; return 0;}
734 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
735 #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
736 if (x
== _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
)
737 {*r
= Mono_Posix_ConfstrName__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
; return 0;}
738 #endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
739 errno
= EINVAL
; return -1;
742 int Mono_Posix_FromDirectoryNotifyFlags (int x
, int *r
)
745 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_ACCESS
) == Mono_Posix_DirectoryNotifyFlags_DN_ACCESS
)
748 #else /* def DN_ACCESS */
749 {errno
= EINVAL
; return -1;}
750 #endif /* ndef DN_ACCESS */
751 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB
) == Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB
)
754 #else /* def DN_ATTRIB */
755 {errno
= EINVAL
; return -1;}
756 #endif /* ndef DN_ATTRIB */
757 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_CREATE
) == Mono_Posix_DirectoryNotifyFlags_DN_CREATE
)
760 #else /* def DN_CREATE */
761 {errno
= EINVAL
; return -1;}
762 #endif /* ndef DN_CREATE */
763 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_DELETE
) == Mono_Posix_DirectoryNotifyFlags_DN_DELETE
)
766 #else /* def DN_DELETE */
767 {errno
= EINVAL
; return -1;}
768 #endif /* ndef DN_DELETE */
769 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_MODIFY
) == Mono_Posix_DirectoryNotifyFlags_DN_MODIFY
)
772 #else /* def DN_MODIFY */
773 {errno
= EINVAL
; return -1;}
774 #endif /* ndef DN_MODIFY */
775 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT
) == Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT
)
778 #else /* def DN_MULTISHOT */
779 {errno
= EINVAL
; return -1;}
780 #endif /* ndef DN_MULTISHOT */
781 if ((x
& Mono_Posix_DirectoryNotifyFlags_DN_RENAME
) == Mono_Posix_DirectoryNotifyFlags_DN_RENAME
)
784 #else /* def DN_RENAME */
785 {errno
= EINVAL
; return -1;}
786 #endif /* ndef DN_RENAME */
792 int Mono_Posix_ToDirectoryNotifyFlags (int x
, int *r
)
798 if ((x
& DN_ACCESS
) == DN_ACCESS
)
799 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_ACCESS
;
800 #endif /* ndef DN_ACCESS */
802 if ((x
& DN_ATTRIB
) == DN_ATTRIB
)
803 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB
;
804 #endif /* ndef DN_ATTRIB */
806 if ((x
& DN_CREATE
) == DN_CREATE
)
807 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_CREATE
;
808 #endif /* ndef DN_CREATE */
810 if ((x
& DN_DELETE
) == DN_DELETE
)
811 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_DELETE
;
812 #endif /* ndef DN_DELETE */
814 if ((x
& DN_MODIFY
) == DN_MODIFY
)
815 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_MODIFY
;
816 #endif /* ndef DN_MODIFY */
818 if ((x
& DN_MULTISHOT
) == DN_MULTISHOT
)
819 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT
;
820 #endif /* ndef DN_MULTISHOT */
822 if ((x
& DN_RENAME
) == DN_RENAME
)
823 *r
|= Mono_Posix_DirectoryNotifyFlags_DN_RENAME
;
824 #endif /* ndef DN_RENAME */
828 int Mono_Posix_FromErrno (int x
, int *r
)
831 if (x
== Mono_Posix_Errno_E2BIG
)
833 {*r
= E2BIG
; return 0;}
834 #else /* def E2BIG */
835 {errno
= EINVAL
; return -1;}
836 #endif /* ndef E2BIG */
837 if (x
== Mono_Posix_Errno_EACCES
)
839 {*r
= EACCES
; return 0;}
840 #else /* def EACCES */
841 {errno
= EINVAL
; return -1;}
842 #endif /* ndef EACCES */
843 if (x
== Mono_Posix_Errno_EADDRINUSE
)
845 {*r
= EADDRINUSE
; return 0;}
846 #else /* def EADDRINUSE */
847 {errno
= EINVAL
; return -1;}
848 #endif /* ndef EADDRINUSE */
849 if (x
== Mono_Posix_Errno_EADDRNOTAVAIL
)
851 {*r
= EADDRNOTAVAIL
; return 0;}
852 #else /* def EADDRNOTAVAIL */
853 {errno
= EINVAL
; return -1;}
854 #endif /* ndef EADDRNOTAVAIL */
855 if (x
== Mono_Posix_Errno_EADV
)
857 {*r
= EADV
; return 0;}
859 {errno
= EINVAL
; return -1;}
860 #endif /* ndef EADV */
861 if (x
== Mono_Posix_Errno_EAFNOSUPPORT
)
863 {*r
= EAFNOSUPPORT
; return 0;}
864 #else /* def EAFNOSUPPORT */
865 {errno
= EINVAL
; return -1;}
866 #endif /* ndef EAFNOSUPPORT */
867 if (x
== Mono_Posix_Errno_EAGAIN
)
869 {*r
= EAGAIN
; return 0;}
870 #else /* def EAGAIN */
871 {errno
= EINVAL
; return -1;}
872 #endif /* ndef EAGAIN */
873 if (x
== Mono_Posix_Errno_EALREADY
)
875 {*r
= EALREADY
; return 0;}
876 #else /* def EALREADY */
877 {errno
= EINVAL
; return -1;}
878 #endif /* ndef EALREADY */
879 if (x
== Mono_Posix_Errno_EBADE
)
881 {*r
= EBADE
; return 0;}
882 #else /* def EBADE */
883 {errno
= EINVAL
; return -1;}
884 #endif /* ndef EBADE */
885 if (x
== Mono_Posix_Errno_EBADF
)
887 {*r
= EBADF
; return 0;}
888 #else /* def EBADF */
889 {errno
= EINVAL
; return -1;}
890 #endif /* ndef EBADF */
891 if (x
== Mono_Posix_Errno_EBADFD
)
893 {*r
= EBADFD
; return 0;}
894 #else /* def EBADFD */
895 {errno
= EINVAL
; return -1;}
896 #endif /* ndef EBADFD */
897 if (x
== Mono_Posix_Errno_EBADMSG
)
899 {*r
= EBADMSG
; return 0;}
900 #else /* def EBADMSG */
901 {errno
= EINVAL
; return -1;}
902 #endif /* ndef EBADMSG */
903 if (x
== Mono_Posix_Errno_EBADR
)
905 {*r
= EBADR
; return 0;}
906 #else /* def EBADR */
907 {errno
= EINVAL
; return -1;}
908 #endif /* ndef EBADR */
909 if (x
== Mono_Posix_Errno_EBADRQC
)
911 {*r
= EBADRQC
; return 0;}
912 #else /* def EBADRQC */
913 {errno
= EINVAL
; return -1;}
914 #endif /* ndef EBADRQC */
915 if (x
== Mono_Posix_Errno_EBADSLT
)
917 {*r
= EBADSLT
; return 0;}
918 #else /* def EBADSLT */
919 {errno
= EINVAL
; return -1;}
920 #endif /* ndef EBADSLT */
921 if (x
== Mono_Posix_Errno_EBFONT
)
923 {*r
= EBFONT
; return 0;}
924 #else /* def EBFONT */
925 {errno
= EINVAL
; return -1;}
926 #endif /* ndef EBFONT */
927 if (x
== Mono_Posix_Errno_EBUSY
)
929 {*r
= EBUSY
; return 0;}
930 #else /* def EBUSY */
931 {errno
= EINVAL
; return -1;}
932 #endif /* ndef EBUSY */
933 if (x
== Mono_Posix_Errno_ECHILD
)
935 {*r
= ECHILD
; return 0;}
936 #else /* def ECHILD */
937 {errno
= EINVAL
; return -1;}
938 #endif /* ndef ECHILD */
939 if (x
== Mono_Posix_Errno_ECHRNG
)
941 {*r
= ECHRNG
; return 0;}
942 #else /* def ECHRNG */
943 {errno
= EINVAL
; return -1;}
944 #endif /* ndef ECHRNG */
945 if (x
== Mono_Posix_Errno_ECOMM
)
947 {*r
= ECOMM
; return 0;}
948 #else /* def ECOMM */
949 {errno
= EINVAL
; return -1;}
950 #endif /* ndef ECOMM */
951 if (x
== Mono_Posix_Errno_ECONNABORTED
)
953 {*r
= ECONNABORTED
; return 0;}
954 #else /* def ECONNABORTED */
955 {errno
= EINVAL
; return -1;}
956 #endif /* ndef ECONNABORTED */
957 if (x
== Mono_Posix_Errno_ECONNREFUSED
)
959 {*r
= ECONNREFUSED
; return 0;}
960 #else /* def ECONNREFUSED */
961 {errno
= EINVAL
; return -1;}
962 #endif /* ndef ECONNREFUSED */
963 if (x
== Mono_Posix_Errno_ECONNRESET
)
965 {*r
= ECONNRESET
; return 0;}
966 #else /* def ECONNRESET */
967 {errno
= EINVAL
; return -1;}
968 #endif /* ndef ECONNRESET */
969 if (x
== Mono_Posix_Errno_EDEADLK
)
971 {*r
= EDEADLK
; return 0;}
972 #else /* def EDEADLK */
973 {errno
= EINVAL
; return -1;}
974 #endif /* ndef EDEADLK */
975 if (x
== Mono_Posix_Errno_EDEADLOCK
)
977 {*r
= EDEADLOCK
; return 0;}
978 #else /* def EDEADLOCK */
979 {errno
= EINVAL
; return -1;}
980 #endif /* ndef EDEADLOCK */
981 if (x
== Mono_Posix_Errno_EDESTADDRREQ
)
983 {*r
= EDESTADDRREQ
; return 0;}
984 #else /* def EDESTADDRREQ */
985 {errno
= EINVAL
; return -1;}
986 #endif /* ndef EDESTADDRREQ */
987 if (x
== Mono_Posix_Errno_EDOM
)
989 {*r
= EDOM
; return 0;}
991 {errno
= EINVAL
; return -1;}
992 #endif /* ndef EDOM */
993 if (x
== Mono_Posix_Errno_EDOTDOT
)
995 {*r
= EDOTDOT
; return 0;}
996 #else /* def EDOTDOT */
997 {errno
= EINVAL
; return -1;}
998 #endif /* ndef EDOTDOT */
999 if (x
== Mono_Posix_Errno_EDQUOT
)
1001 {*r
= EDQUOT
; return 0;}
1002 #else /* def EDQUOT */
1003 {errno
= EINVAL
; return -1;}
1004 #endif /* ndef EDQUOT */
1005 if (x
== Mono_Posix_Errno_EEXIST
)
1007 {*r
= EEXIST
; return 0;}
1008 #else /* def EEXIST */
1009 {errno
= EINVAL
; return -1;}
1010 #endif /* ndef EEXIST */
1011 if (x
== Mono_Posix_Errno_EFAULT
)
1013 {*r
= EFAULT
; return 0;}
1014 #else /* def EFAULT */
1015 {errno
= EINVAL
; return -1;}
1016 #endif /* ndef EFAULT */
1017 if (x
== Mono_Posix_Errno_EFBIG
)
1019 {*r
= EFBIG
; return 0;}
1020 #else /* def EFBIG */
1021 {errno
= EINVAL
; return -1;}
1022 #endif /* ndef EFBIG */
1023 if (x
== Mono_Posix_Errno_EHOSTDOWN
)
1025 {*r
= EHOSTDOWN
; return 0;}
1026 #else /* def EHOSTDOWN */
1027 {errno
= EINVAL
; return -1;}
1028 #endif /* ndef EHOSTDOWN */
1029 if (x
== Mono_Posix_Errno_EHOSTUNREACH
)
1031 {*r
= EHOSTUNREACH
; return 0;}
1032 #else /* def EHOSTUNREACH */
1033 {errno
= EINVAL
; return -1;}
1034 #endif /* ndef EHOSTUNREACH */
1035 if (x
== Mono_Posix_Errno_EIDRM
)
1037 {*r
= EIDRM
; return 0;}
1038 #else /* def EIDRM */
1039 {errno
= EINVAL
; return -1;}
1040 #endif /* ndef EIDRM */
1041 if (x
== Mono_Posix_Errno_EILSEQ
)
1043 {*r
= EILSEQ
; return 0;}
1044 #else /* def EILSEQ */
1045 {errno
= EINVAL
; return -1;}
1046 #endif /* ndef EILSEQ */
1047 if (x
== Mono_Posix_Errno_EINPROGRESS
)
1049 {*r
= EINPROGRESS
; return 0;}
1050 #else /* def EINPROGRESS */
1051 {errno
= EINVAL
; return -1;}
1052 #endif /* ndef EINPROGRESS */
1053 if (x
== Mono_Posix_Errno_EINTR
)
1055 {*r
= EINTR
; return 0;}
1056 #else /* def EINTR */
1057 {errno
= EINVAL
; return -1;}
1058 #endif /* ndef EINTR */
1059 if (x
== Mono_Posix_Errno_EINVAL
)
1061 {*r
= EINVAL
; return 0;}
1062 #else /* def EINVAL */
1063 {errno
= EINVAL
; return -1;}
1064 #endif /* ndef EINVAL */
1065 if (x
== Mono_Posix_Errno_EIO
)
1067 {*r
= EIO
; return 0;}
1069 {errno
= EINVAL
; return -1;}
1070 #endif /* ndef EIO */
1071 if (x
== Mono_Posix_Errno_EISCONN
)
1073 {*r
= EISCONN
; return 0;}
1074 #else /* def EISCONN */
1075 {errno
= EINVAL
; return -1;}
1076 #endif /* ndef EISCONN */
1077 if (x
== Mono_Posix_Errno_EISDIR
)
1079 {*r
= EISDIR
; return 0;}
1080 #else /* def EISDIR */
1081 {errno
= EINVAL
; return -1;}
1082 #endif /* ndef EISDIR */
1083 if (x
== Mono_Posix_Errno_EISNAM
)
1085 {*r
= EISNAM
; return 0;}
1086 #else /* def EISNAM */
1087 {errno
= EINVAL
; return -1;}
1088 #endif /* ndef EISNAM */
1089 if (x
== Mono_Posix_Errno_EL2HLT
)
1091 {*r
= EL2HLT
; return 0;}
1092 #else /* def EL2HLT */
1093 {errno
= EINVAL
; return -1;}
1094 #endif /* ndef EL2HLT */
1095 if (x
== Mono_Posix_Errno_EL2NSYNC
)
1097 {*r
= EL2NSYNC
; return 0;}
1098 #else /* def EL2NSYNC */
1099 {errno
= EINVAL
; return -1;}
1100 #endif /* ndef EL2NSYNC */
1101 if (x
== Mono_Posix_Errno_EL3HLT
)
1103 {*r
= EL3HLT
; return 0;}
1104 #else /* def EL3HLT */
1105 {errno
= EINVAL
; return -1;}
1106 #endif /* ndef EL3HLT */
1107 if (x
== Mono_Posix_Errno_EL3RST
)
1109 {*r
= EL3RST
; return 0;}
1110 #else /* def EL3RST */
1111 {errno
= EINVAL
; return -1;}
1112 #endif /* ndef EL3RST */
1113 if (x
== Mono_Posix_Errno_ELIBACC
)
1115 {*r
= ELIBACC
; return 0;}
1116 #else /* def ELIBACC */
1117 {errno
= EINVAL
; return -1;}
1118 #endif /* ndef ELIBACC */
1119 if (x
== Mono_Posix_Errno_ELIBBAD
)
1121 {*r
= ELIBBAD
; return 0;}
1122 #else /* def ELIBBAD */
1123 {errno
= EINVAL
; return -1;}
1124 #endif /* ndef ELIBBAD */
1125 if (x
== Mono_Posix_Errno_ELIBEXEC
)
1127 {*r
= ELIBEXEC
; return 0;}
1128 #else /* def ELIBEXEC */
1129 {errno
= EINVAL
; return -1;}
1130 #endif /* ndef ELIBEXEC */
1131 if (x
== Mono_Posix_Errno_ELIBMAX
)
1133 {*r
= ELIBMAX
; return 0;}
1134 #else /* def ELIBMAX */
1135 {errno
= EINVAL
; return -1;}
1136 #endif /* ndef ELIBMAX */
1137 if (x
== Mono_Posix_Errno_ELIBSCN
)
1139 {*r
= ELIBSCN
; return 0;}
1140 #else /* def ELIBSCN */
1141 {errno
= EINVAL
; return -1;}
1142 #endif /* ndef ELIBSCN */
1143 if (x
== Mono_Posix_Errno_ELNRNG
)
1145 {*r
= ELNRNG
; return 0;}
1146 #else /* def ELNRNG */
1147 {errno
= EINVAL
; return -1;}
1148 #endif /* ndef ELNRNG */
1149 if (x
== Mono_Posix_Errno_ELOOP
)
1151 {*r
= ELOOP
; return 0;}
1152 #else /* def ELOOP */
1153 {errno
= EINVAL
; return -1;}
1154 #endif /* ndef ELOOP */
1155 if (x
== Mono_Posix_Errno_EMEDIUMTYPE
)
1157 {*r
= EMEDIUMTYPE
; return 0;}
1158 #else /* def EMEDIUMTYPE */
1159 {errno
= EINVAL
; return -1;}
1160 #endif /* ndef EMEDIUMTYPE */
1161 if (x
== Mono_Posix_Errno_EMFILE
)
1163 {*r
= EMFILE
; return 0;}
1164 #else /* def EMFILE */
1165 {errno
= EINVAL
; return -1;}
1166 #endif /* ndef EMFILE */
1167 if (x
== Mono_Posix_Errno_EMLINK
)
1169 {*r
= EMLINK
; return 0;}
1170 #else /* def EMLINK */
1171 {errno
= EINVAL
; return -1;}
1172 #endif /* ndef EMLINK */
1173 if (x
== Mono_Posix_Errno_EMSGSIZE
)
1175 {*r
= EMSGSIZE
; return 0;}
1176 #else /* def EMSGSIZE */
1177 {errno
= EINVAL
; return -1;}
1178 #endif /* ndef EMSGSIZE */
1179 if (x
== Mono_Posix_Errno_EMULTIHOP
)
1181 {*r
= EMULTIHOP
; return 0;}
1182 #else /* def EMULTIHOP */
1183 {errno
= EINVAL
; return -1;}
1184 #endif /* ndef EMULTIHOP */
1185 if (x
== Mono_Posix_Errno_ENAMETOOLONG
)
1187 {*r
= ENAMETOOLONG
; return 0;}
1188 #else /* def ENAMETOOLONG */
1189 {errno
= EINVAL
; return -1;}
1190 #endif /* ndef ENAMETOOLONG */
1191 if (x
== Mono_Posix_Errno_ENAVAIL
)
1193 {*r
= ENAVAIL
; return 0;}
1194 #else /* def ENAVAIL */
1195 {errno
= EINVAL
; return -1;}
1196 #endif /* ndef ENAVAIL */
1197 if (x
== Mono_Posix_Errno_ENETDOWN
)
1199 {*r
= ENETDOWN
; return 0;}
1200 #else /* def ENETDOWN */
1201 {errno
= EINVAL
; return -1;}
1202 #endif /* ndef ENETDOWN */
1203 if (x
== Mono_Posix_Errno_ENETRESET
)
1205 {*r
= ENETRESET
; return 0;}
1206 #else /* def ENETRESET */
1207 {errno
= EINVAL
; return -1;}
1208 #endif /* ndef ENETRESET */
1209 if (x
== Mono_Posix_Errno_ENETUNREACH
)
1211 {*r
= ENETUNREACH
; return 0;}
1212 #else /* def ENETUNREACH */
1213 {errno
= EINVAL
; return -1;}
1214 #endif /* ndef ENETUNREACH */
1215 if (x
== Mono_Posix_Errno_ENFILE
)
1217 {*r
= ENFILE
; return 0;}
1218 #else /* def ENFILE */
1219 {errno
= EINVAL
; return -1;}
1220 #endif /* ndef ENFILE */
1221 if (x
== Mono_Posix_Errno_ENOANO
)
1223 {*r
= ENOANO
; return 0;}
1224 #else /* def ENOANO */
1225 {errno
= EINVAL
; return -1;}
1226 #endif /* ndef ENOANO */
1227 if (x
== Mono_Posix_Errno_ENOBUFS
)
1229 {*r
= ENOBUFS
; return 0;}
1230 #else /* def ENOBUFS */
1231 {errno
= EINVAL
; return -1;}
1232 #endif /* ndef ENOBUFS */
1233 if (x
== Mono_Posix_Errno_ENOCSI
)
1235 {*r
= ENOCSI
; return 0;}
1236 #else /* def ENOCSI */
1237 {errno
= EINVAL
; return -1;}
1238 #endif /* ndef ENOCSI */
1239 if (x
== Mono_Posix_Errno_ENODATA
)
1241 {*r
= ENODATA
; return 0;}
1242 #else /* def ENODATA */
1243 {errno
= EINVAL
; return -1;}
1244 #endif /* ndef ENODATA */
1245 if (x
== Mono_Posix_Errno_ENODEV
)
1247 {*r
= ENODEV
; return 0;}
1248 #else /* def ENODEV */
1249 {errno
= EINVAL
; return -1;}
1250 #endif /* ndef ENODEV */
1251 if (x
== Mono_Posix_Errno_ENOENT
)
1253 {*r
= ENOENT
; return 0;}
1254 #else /* def ENOENT */
1255 {errno
= EINVAL
; return -1;}
1256 #endif /* ndef ENOENT */
1257 if (x
== Mono_Posix_Errno_ENOEXEC
)
1259 {*r
= ENOEXEC
; return 0;}
1260 #else /* def ENOEXEC */
1261 {errno
= EINVAL
; return -1;}
1262 #endif /* ndef ENOEXEC */
1263 if (x
== Mono_Posix_Errno_ENOLCK
)
1265 {*r
= ENOLCK
; return 0;}
1266 #else /* def ENOLCK */
1267 {errno
= EINVAL
; return -1;}
1268 #endif /* ndef ENOLCK */
1269 if (x
== Mono_Posix_Errno_ENOLINK
)
1271 {*r
= ENOLINK
; return 0;}
1272 #else /* def ENOLINK */
1273 {errno
= EINVAL
; return -1;}
1274 #endif /* ndef ENOLINK */
1275 if (x
== Mono_Posix_Errno_ENOMEDIUM
)
1277 {*r
= ENOMEDIUM
; return 0;}
1278 #else /* def ENOMEDIUM */
1279 {errno
= EINVAL
; return -1;}
1280 #endif /* ndef ENOMEDIUM */
1281 if (x
== Mono_Posix_Errno_ENOMEM
)
1283 {*r
= ENOMEM
; return 0;}
1284 #else /* def ENOMEM */
1285 {errno
= EINVAL
; return -1;}
1286 #endif /* ndef ENOMEM */
1287 if (x
== Mono_Posix_Errno_ENOMSG
)
1289 {*r
= ENOMSG
; return 0;}
1290 #else /* def ENOMSG */
1291 {errno
= EINVAL
; return -1;}
1292 #endif /* ndef ENOMSG */
1293 if (x
== Mono_Posix_Errno_ENONET
)
1295 {*r
= ENONET
; return 0;}
1296 #else /* def ENONET */
1297 {errno
= EINVAL
; return -1;}
1298 #endif /* ndef ENONET */
1299 if (x
== Mono_Posix_Errno_ENOPKG
)
1301 {*r
= ENOPKG
; return 0;}
1302 #else /* def ENOPKG */
1303 {errno
= EINVAL
; return -1;}
1304 #endif /* ndef ENOPKG */
1305 if (x
== Mono_Posix_Errno_ENOPROTOOPT
)
1307 {*r
= ENOPROTOOPT
; return 0;}
1308 #else /* def ENOPROTOOPT */
1309 {errno
= EINVAL
; return -1;}
1310 #endif /* ndef ENOPROTOOPT */
1311 if (x
== Mono_Posix_Errno_ENOSPC
)
1313 {*r
= ENOSPC
; return 0;}
1314 #else /* def ENOSPC */
1315 {errno
= EINVAL
; return -1;}
1316 #endif /* ndef ENOSPC */
1317 if (x
== Mono_Posix_Errno_ENOSR
)
1319 {*r
= ENOSR
; return 0;}
1320 #else /* def ENOSR */
1321 {errno
= EINVAL
; return -1;}
1322 #endif /* ndef ENOSR */
1323 if (x
== Mono_Posix_Errno_ENOSTR
)
1325 {*r
= ENOSTR
; return 0;}
1326 #else /* def ENOSTR */
1327 {errno
= EINVAL
; return -1;}
1328 #endif /* ndef ENOSTR */
1329 if (x
== Mono_Posix_Errno_ENOSYS
)
1331 {*r
= ENOSYS
; return 0;}
1332 #else /* def ENOSYS */
1333 {errno
= EINVAL
; return -1;}
1334 #endif /* ndef ENOSYS */
1335 if (x
== Mono_Posix_Errno_ENOTBLK
)
1337 {*r
= ENOTBLK
; return 0;}
1338 #else /* def ENOTBLK */
1339 {errno
= EINVAL
; return -1;}
1340 #endif /* ndef ENOTBLK */
1341 if (x
== Mono_Posix_Errno_ENOTCONN
)
1343 {*r
= ENOTCONN
; return 0;}
1344 #else /* def ENOTCONN */
1345 {errno
= EINVAL
; return -1;}
1346 #endif /* ndef ENOTCONN */
1347 if (x
== Mono_Posix_Errno_ENOTDIR
)
1349 {*r
= ENOTDIR
; return 0;}
1350 #else /* def ENOTDIR */
1351 {errno
= EINVAL
; return -1;}
1352 #endif /* ndef ENOTDIR */
1353 if (x
== Mono_Posix_Errno_ENOTEMPTY
)
1355 {*r
= ENOTEMPTY
; return 0;}
1356 #else /* def ENOTEMPTY */
1357 {errno
= EINVAL
; return -1;}
1358 #endif /* ndef ENOTEMPTY */
1359 if (x
== Mono_Posix_Errno_ENOTNAM
)
1361 {*r
= ENOTNAM
; return 0;}
1362 #else /* def ENOTNAM */
1363 {errno
= EINVAL
; return -1;}
1364 #endif /* ndef ENOTNAM */
1365 if (x
== Mono_Posix_Errno_ENOTSOCK
)
1367 {*r
= ENOTSOCK
; return 0;}
1368 #else /* def ENOTSOCK */
1369 {errno
= EINVAL
; return -1;}
1370 #endif /* ndef ENOTSOCK */
1371 if (x
== Mono_Posix_Errno_ENOTTY
)
1373 {*r
= ENOTTY
; return 0;}
1374 #else /* def ENOTTY */
1375 {errno
= EINVAL
; return -1;}
1376 #endif /* ndef ENOTTY */
1377 if (x
== Mono_Posix_Errno_ENOTUNIQ
)
1379 {*r
= ENOTUNIQ
; return 0;}
1380 #else /* def ENOTUNIQ */
1381 {errno
= EINVAL
; return -1;}
1382 #endif /* ndef ENOTUNIQ */
1383 if (x
== Mono_Posix_Errno_ENXIO
)
1385 {*r
= ENXIO
; return 0;}
1386 #else /* def ENXIO */
1387 {errno
= EINVAL
; return -1;}
1388 #endif /* ndef ENXIO */
1389 if (x
== Mono_Posix_Errno_EOPNOTSUPP
)
1391 {*r
= EOPNOTSUPP
; return 0;}
1392 #else /* def EOPNOTSUPP */
1393 {errno
= EINVAL
; return -1;}
1394 #endif /* ndef EOPNOTSUPP */
1395 if (x
== Mono_Posix_Errno_EOVERFLOW
)
1397 {*r
= EOVERFLOW
; return 0;}
1398 #else /* def EOVERFLOW */
1399 {errno
= EINVAL
; return -1;}
1400 #endif /* ndef EOVERFLOW */
1401 if (x
== Mono_Posix_Errno_EPERM
)
1403 {*r
= EPERM
; return 0;}
1404 #else /* def EPERM */
1405 {errno
= EINVAL
; return -1;}
1406 #endif /* ndef EPERM */
1407 if (x
== Mono_Posix_Errno_EPFNOSUPPORT
)
1409 {*r
= EPFNOSUPPORT
; return 0;}
1410 #else /* def EPFNOSUPPORT */
1411 {errno
= EINVAL
; return -1;}
1412 #endif /* ndef EPFNOSUPPORT */
1413 if (x
== Mono_Posix_Errno_EPIPE
)
1415 {*r
= EPIPE
; return 0;}
1416 #else /* def EPIPE */
1417 {errno
= EINVAL
; return -1;}
1418 #endif /* ndef EPIPE */
1419 if (x
== Mono_Posix_Errno_EPROTO
)
1421 {*r
= EPROTO
; return 0;}
1422 #else /* def EPROTO */
1423 {errno
= EINVAL
; return -1;}
1424 #endif /* ndef EPROTO */
1425 if (x
== Mono_Posix_Errno_EPROTONOSUPPORT
)
1426 #ifdef EPROTONOSUPPORT
1427 {*r
= EPROTONOSUPPORT
; return 0;}
1428 #else /* def EPROTONOSUPPORT */
1429 {errno
= EINVAL
; return -1;}
1430 #endif /* ndef EPROTONOSUPPORT */
1431 if (x
== Mono_Posix_Errno_EPROTOTYPE
)
1433 {*r
= EPROTOTYPE
; return 0;}
1434 #else /* def EPROTOTYPE */
1435 {errno
= EINVAL
; return -1;}
1436 #endif /* ndef EPROTOTYPE */
1437 if (x
== Mono_Posix_Errno_ERANGE
)
1439 {*r
= ERANGE
; return 0;}
1440 #else /* def ERANGE */
1441 {errno
= EINVAL
; return -1;}
1442 #endif /* ndef ERANGE */
1443 if (x
== Mono_Posix_Errno_EREMCHG
)
1445 {*r
= EREMCHG
; return 0;}
1446 #else /* def EREMCHG */
1447 {errno
= EINVAL
; return -1;}
1448 #endif /* ndef EREMCHG */
1449 if (x
== Mono_Posix_Errno_EREMOTE
)
1451 {*r
= EREMOTE
; return 0;}
1452 #else /* def EREMOTE */
1453 {errno
= EINVAL
; return -1;}
1454 #endif /* ndef EREMOTE */
1455 if (x
== Mono_Posix_Errno_EREMOTEIO
)
1457 {*r
= EREMOTEIO
; return 0;}
1458 #else /* def EREMOTEIO */
1459 {errno
= EINVAL
; return -1;}
1460 #endif /* ndef EREMOTEIO */
1461 if (x
== Mono_Posix_Errno_ERESTART
)
1463 {*r
= ERESTART
; return 0;}
1464 #else /* def ERESTART */
1465 {errno
= EINVAL
; return -1;}
1466 #endif /* ndef ERESTART */
1467 if (x
== Mono_Posix_Errno_EROFS
)
1469 {*r
= EROFS
; return 0;}
1470 #else /* def EROFS */
1471 {errno
= EINVAL
; return -1;}
1472 #endif /* ndef EROFS */
1473 if (x
== Mono_Posix_Errno_ESHUTDOWN
)
1475 {*r
= ESHUTDOWN
; return 0;}
1476 #else /* def ESHUTDOWN */
1477 {errno
= EINVAL
; return -1;}
1478 #endif /* ndef ESHUTDOWN */
1479 if (x
== Mono_Posix_Errno_ESOCKTNOSUPPORT
)
1480 #ifdef ESOCKTNOSUPPORT
1481 {*r
= ESOCKTNOSUPPORT
; return 0;}
1482 #else /* def ESOCKTNOSUPPORT */
1483 {errno
= EINVAL
; return -1;}
1484 #endif /* ndef ESOCKTNOSUPPORT */
1485 if (x
== Mono_Posix_Errno_ESPIPE
)
1487 {*r
= ESPIPE
; return 0;}
1488 #else /* def ESPIPE */
1489 {errno
= EINVAL
; return -1;}
1490 #endif /* ndef ESPIPE */
1491 if (x
== Mono_Posix_Errno_ESRCH
)
1493 {*r
= ESRCH
; return 0;}
1494 #else /* def ESRCH */
1495 {errno
= EINVAL
; return -1;}
1496 #endif /* ndef ESRCH */
1497 if (x
== Mono_Posix_Errno_ESRMNT
)
1499 {*r
= ESRMNT
; return 0;}
1500 #else /* def ESRMNT */
1501 {errno
= EINVAL
; return -1;}
1502 #endif /* ndef ESRMNT */
1503 if (x
== Mono_Posix_Errno_ESTALE
)
1505 {*r
= ESTALE
; return 0;}
1506 #else /* def ESTALE */
1507 {errno
= EINVAL
; return -1;}
1508 #endif /* ndef ESTALE */
1509 if (x
== Mono_Posix_Errno_ESTRPIPE
)
1511 {*r
= ESTRPIPE
; return 0;}
1512 #else /* def ESTRPIPE */
1513 {errno
= EINVAL
; return -1;}
1514 #endif /* ndef ESTRPIPE */
1515 if (x
== Mono_Posix_Errno_ETIME
)
1517 {*r
= ETIME
; return 0;}
1518 #else /* def ETIME */
1519 {errno
= EINVAL
; return -1;}
1520 #endif /* ndef ETIME */
1521 if (x
== Mono_Posix_Errno_ETIMEDOUT
)
1523 {*r
= ETIMEDOUT
; return 0;}
1524 #else /* def ETIMEDOUT */
1525 {errno
= EINVAL
; return -1;}
1526 #endif /* ndef ETIMEDOUT */
1527 if (x
== Mono_Posix_Errno_ETOOMANYREFS
)
1529 {*r
= ETOOMANYREFS
; return 0;}
1530 #else /* def ETOOMANYREFS */
1531 {errno
= EINVAL
; return -1;}
1532 #endif /* ndef ETOOMANYREFS */
1533 if (x
== Mono_Posix_Errno_ETXTBSY
)
1535 {*r
= ETXTBSY
; return 0;}
1536 #else /* def ETXTBSY */
1537 {errno
= EINVAL
; return -1;}
1538 #endif /* ndef ETXTBSY */
1539 if (x
== Mono_Posix_Errno_EUCLEAN
)
1541 {*r
= EUCLEAN
; return 0;}
1542 #else /* def EUCLEAN */
1543 {errno
= EINVAL
; return -1;}
1544 #endif /* ndef EUCLEAN */
1545 if (x
== Mono_Posix_Errno_EUNATCH
)
1547 {*r
= EUNATCH
; return 0;}
1548 #else /* def EUNATCH */
1549 {errno
= EINVAL
; return -1;}
1550 #endif /* ndef EUNATCH */
1551 if (x
== Mono_Posix_Errno_EUSERS
)
1553 {*r
= EUSERS
; return 0;}
1554 #else /* def EUSERS */
1555 {errno
= EINVAL
; return -1;}
1556 #endif /* ndef EUSERS */
1557 if (x
== Mono_Posix_Errno_EWOULDBLOCK
)
1559 {*r
= EWOULDBLOCK
; return 0;}
1560 #else /* def EWOULDBLOCK */
1561 {errno
= EINVAL
; return -1;}
1562 #endif /* ndef EWOULDBLOCK */
1563 if (x
== Mono_Posix_Errno_EXDEV
)
1565 {*r
= EXDEV
; return 0;}
1566 #else /* def EXDEV */
1567 {errno
= EINVAL
; return -1;}
1568 #endif /* ndef EXDEV */
1569 if (x
== Mono_Posix_Errno_EXFULL
)
1571 {*r
= EXFULL
; return 0;}
1572 #else /* def EXFULL */
1573 {errno
= EINVAL
; return -1;}
1574 #endif /* ndef EXFULL */
1577 errno
= EINVAL
; return -1;
1580 int Mono_Posix_ToErrno (int x
, int *r
)
1587 {*r
= Mono_Posix_Errno_E2BIG
; return 0;}
1588 #endif /* ndef E2BIG */
1591 {*r
= Mono_Posix_Errno_EACCES
; return 0;}
1592 #endif /* ndef EACCES */
1594 if (x
== EADDRINUSE
)
1595 {*r
= Mono_Posix_Errno_EADDRINUSE
; return 0;}
1596 #endif /* ndef EADDRINUSE */
1597 #ifdef EADDRNOTAVAIL
1598 if (x
== EADDRNOTAVAIL
)
1599 {*r
= Mono_Posix_Errno_EADDRNOTAVAIL
; return 0;}
1600 #endif /* ndef EADDRNOTAVAIL */
1603 {*r
= Mono_Posix_Errno_EADV
; return 0;}
1604 #endif /* ndef EADV */
1606 if (x
== EAFNOSUPPORT
)
1607 {*r
= Mono_Posix_Errno_EAFNOSUPPORT
; return 0;}
1608 #endif /* ndef EAFNOSUPPORT */
1611 {*r
= Mono_Posix_Errno_EAGAIN
; return 0;}
1612 #endif /* ndef EAGAIN */
1615 {*r
= Mono_Posix_Errno_EALREADY
; return 0;}
1616 #endif /* ndef EALREADY */
1619 {*r
= Mono_Posix_Errno_EBADE
; return 0;}
1620 #endif /* ndef EBADE */
1623 {*r
= Mono_Posix_Errno_EBADF
; return 0;}
1624 #endif /* ndef EBADF */
1627 {*r
= Mono_Posix_Errno_EBADFD
; return 0;}
1628 #endif /* ndef EBADFD */
1631 {*r
= Mono_Posix_Errno_EBADMSG
; return 0;}
1632 #endif /* ndef EBADMSG */
1635 {*r
= Mono_Posix_Errno_EBADR
; return 0;}
1636 #endif /* ndef EBADR */
1639 {*r
= Mono_Posix_Errno_EBADRQC
; return 0;}
1640 #endif /* ndef EBADRQC */
1643 {*r
= Mono_Posix_Errno_EBADSLT
; return 0;}
1644 #endif /* ndef EBADSLT */
1647 {*r
= Mono_Posix_Errno_EBFONT
; return 0;}
1648 #endif /* ndef EBFONT */
1651 {*r
= Mono_Posix_Errno_EBUSY
; return 0;}
1652 #endif /* ndef EBUSY */
1655 {*r
= Mono_Posix_Errno_ECHILD
; return 0;}
1656 #endif /* ndef ECHILD */
1659 {*r
= Mono_Posix_Errno_ECHRNG
; return 0;}
1660 #endif /* ndef ECHRNG */
1663 {*r
= Mono_Posix_Errno_ECOMM
; return 0;}
1664 #endif /* ndef ECOMM */
1666 if (x
== ECONNABORTED
)
1667 {*r
= Mono_Posix_Errno_ECONNABORTED
; return 0;}
1668 #endif /* ndef ECONNABORTED */
1670 if (x
== ECONNREFUSED
)
1671 {*r
= Mono_Posix_Errno_ECONNREFUSED
; return 0;}
1672 #endif /* ndef ECONNREFUSED */
1674 if (x
== ECONNRESET
)
1675 {*r
= Mono_Posix_Errno_ECONNRESET
; return 0;}
1676 #endif /* ndef ECONNRESET */
1679 {*r
= Mono_Posix_Errno_EDEADLK
; return 0;}
1680 #endif /* ndef EDEADLK */
1683 {*r
= Mono_Posix_Errno_EDEADLOCK
; return 0;}
1684 #endif /* ndef EDEADLOCK */
1686 if (x
== EDESTADDRREQ
)
1687 {*r
= Mono_Posix_Errno_EDESTADDRREQ
; return 0;}
1688 #endif /* ndef EDESTADDRREQ */
1691 {*r
= Mono_Posix_Errno_EDOM
; return 0;}
1692 #endif /* ndef EDOM */
1695 {*r
= Mono_Posix_Errno_EDOTDOT
; return 0;}
1696 #endif /* ndef EDOTDOT */
1699 {*r
= Mono_Posix_Errno_EDQUOT
; return 0;}
1700 #endif /* ndef EDQUOT */
1703 {*r
= Mono_Posix_Errno_EEXIST
; return 0;}
1704 #endif /* ndef EEXIST */
1707 {*r
= Mono_Posix_Errno_EFAULT
; return 0;}
1708 #endif /* ndef EFAULT */
1711 {*r
= Mono_Posix_Errno_EFBIG
; return 0;}
1712 #endif /* ndef EFBIG */
1715 {*r
= Mono_Posix_Errno_EHOSTDOWN
; return 0;}
1716 #endif /* ndef EHOSTDOWN */
1718 if (x
== EHOSTUNREACH
)
1719 {*r
= Mono_Posix_Errno_EHOSTUNREACH
; return 0;}
1720 #endif /* ndef EHOSTUNREACH */
1723 {*r
= Mono_Posix_Errno_EIDRM
; return 0;}
1724 #endif /* ndef EIDRM */
1727 {*r
= Mono_Posix_Errno_EILSEQ
; return 0;}
1728 #endif /* ndef EILSEQ */
1730 if (x
== EINPROGRESS
)
1731 {*r
= Mono_Posix_Errno_EINPROGRESS
; return 0;}
1732 #endif /* ndef EINPROGRESS */
1735 {*r
= Mono_Posix_Errno_EINTR
; return 0;}
1736 #endif /* ndef EINTR */
1739 {*r
= Mono_Posix_Errno_EINVAL
; return 0;}
1740 #endif /* ndef EINVAL */
1743 {*r
= Mono_Posix_Errno_EIO
; return 0;}
1744 #endif /* ndef EIO */
1747 {*r
= Mono_Posix_Errno_EISCONN
; return 0;}
1748 #endif /* ndef EISCONN */
1751 {*r
= Mono_Posix_Errno_EISDIR
; return 0;}
1752 #endif /* ndef EISDIR */
1755 {*r
= Mono_Posix_Errno_EISNAM
; return 0;}
1756 #endif /* ndef EISNAM */
1759 {*r
= Mono_Posix_Errno_EL2HLT
; return 0;}
1760 #endif /* ndef EL2HLT */
1763 {*r
= Mono_Posix_Errno_EL2NSYNC
; return 0;}
1764 #endif /* ndef EL2NSYNC */
1767 {*r
= Mono_Posix_Errno_EL3HLT
; return 0;}
1768 #endif /* ndef EL3HLT */
1771 {*r
= Mono_Posix_Errno_EL3RST
; return 0;}
1772 #endif /* ndef EL3RST */
1775 {*r
= Mono_Posix_Errno_ELIBACC
; return 0;}
1776 #endif /* ndef ELIBACC */
1779 {*r
= Mono_Posix_Errno_ELIBBAD
; return 0;}
1780 #endif /* ndef ELIBBAD */
1783 {*r
= Mono_Posix_Errno_ELIBEXEC
; return 0;}
1784 #endif /* ndef ELIBEXEC */
1787 {*r
= Mono_Posix_Errno_ELIBMAX
; return 0;}
1788 #endif /* ndef ELIBMAX */
1791 {*r
= Mono_Posix_Errno_ELIBSCN
; return 0;}
1792 #endif /* ndef ELIBSCN */
1795 {*r
= Mono_Posix_Errno_ELNRNG
; return 0;}
1796 #endif /* ndef ELNRNG */
1799 {*r
= Mono_Posix_Errno_ELOOP
; return 0;}
1800 #endif /* ndef ELOOP */
1802 if (x
== EMEDIUMTYPE
)
1803 {*r
= Mono_Posix_Errno_EMEDIUMTYPE
; return 0;}
1804 #endif /* ndef EMEDIUMTYPE */
1807 {*r
= Mono_Posix_Errno_EMFILE
; return 0;}
1808 #endif /* ndef EMFILE */
1811 {*r
= Mono_Posix_Errno_EMLINK
; return 0;}
1812 #endif /* ndef EMLINK */
1815 {*r
= Mono_Posix_Errno_EMSGSIZE
; return 0;}
1816 #endif /* ndef EMSGSIZE */
1819 {*r
= Mono_Posix_Errno_EMULTIHOP
; return 0;}
1820 #endif /* ndef EMULTIHOP */
1822 if (x
== ENAMETOOLONG
)
1823 {*r
= Mono_Posix_Errno_ENAMETOOLONG
; return 0;}
1824 #endif /* ndef ENAMETOOLONG */
1827 {*r
= Mono_Posix_Errno_ENAVAIL
; return 0;}
1828 #endif /* ndef ENAVAIL */
1831 {*r
= Mono_Posix_Errno_ENETDOWN
; return 0;}
1832 #endif /* ndef ENETDOWN */
1835 {*r
= Mono_Posix_Errno_ENETRESET
; return 0;}
1836 #endif /* ndef ENETRESET */
1838 if (x
== ENETUNREACH
)
1839 {*r
= Mono_Posix_Errno_ENETUNREACH
; return 0;}
1840 #endif /* ndef ENETUNREACH */
1843 {*r
= Mono_Posix_Errno_ENFILE
; return 0;}
1844 #endif /* ndef ENFILE */
1847 {*r
= Mono_Posix_Errno_ENOANO
; return 0;}
1848 #endif /* ndef ENOANO */
1851 {*r
= Mono_Posix_Errno_ENOBUFS
; return 0;}
1852 #endif /* ndef ENOBUFS */
1855 {*r
= Mono_Posix_Errno_ENOCSI
; return 0;}
1856 #endif /* ndef ENOCSI */
1859 {*r
= Mono_Posix_Errno_ENODATA
; return 0;}
1860 #endif /* ndef ENODATA */
1863 {*r
= Mono_Posix_Errno_ENODEV
; return 0;}
1864 #endif /* ndef ENODEV */
1867 {*r
= Mono_Posix_Errno_ENOENT
; return 0;}
1868 #endif /* ndef ENOENT */
1871 {*r
= Mono_Posix_Errno_ENOEXEC
; return 0;}
1872 #endif /* ndef ENOEXEC */
1875 {*r
= Mono_Posix_Errno_ENOLCK
; return 0;}
1876 #endif /* ndef ENOLCK */
1879 {*r
= Mono_Posix_Errno_ENOLINK
; return 0;}
1880 #endif /* ndef ENOLINK */
1883 {*r
= Mono_Posix_Errno_ENOMEDIUM
; return 0;}
1884 #endif /* ndef ENOMEDIUM */
1887 {*r
= Mono_Posix_Errno_ENOMEM
; return 0;}
1888 #endif /* ndef ENOMEM */
1891 {*r
= Mono_Posix_Errno_ENOMSG
; return 0;}
1892 #endif /* ndef ENOMSG */
1895 {*r
= Mono_Posix_Errno_ENONET
; return 0;}
1896 #endif /* ndef ENONET */
1899 {*r
= Mono_Posix_Errno_ENOPKG
; return 0;}
1900 #endif /* ndef ENOPKG */
1902 if (x
== ENOPROTOOPT
)
1903 {*r
= Mono_Posix_Errno_ENOPROTOOPT
; return 0;}
1904 #endif /* ndef ENOPROTOOPT */
1907 {*r
= Mono_Posix_Errno_ENOSPC
; return 0;}
1908 #endif /* ndef ENOSPC */
1911 {*r
= Mono_Posix_Errno_ENOSR
; return 0;}
1912 #endif /* ndef ENOSR */
1915 {*r
= Mono_Posix_Errno_ENOSTR
; return 0;}
1916 #endif /* ndef ENOSTR */
1919 {*r
= Mono_Posix_Errno_ENOSYS
; return 0;}
1920 #endif /* ndef ENOSYS */
1923 {*r
= Mono_Posix_Errno_ENOTBLK
; return 0;}
1924 #endif /* ndef ENOTBLK */
1927 {*r
= Mono_Posix_Errno_ENOTCONN
; return 0;}
1928 #endif /* ndef ENOTCONN */
1931 {*r
= Mono_Posix_Errno_ENOTDIR
; return 0;}
1932 #endif /* ndef ENOTDIR */
1935 {*r
= Mono_Posix_Errno_ENOTEMPTY
; return 0;}
1936 #endif /* ndef ENOTEMPTY */
1939 {*r
= Mono_Posix_Errno_ENOTNAM
; return 0;}
1940 #endif /* ndef ENOTNAM */
1943 {*r
= Mono_Posix_Errno_ENOTSOCK
; return 0;}
1944 #endif /* ndef ENOTSOCK */
1947 {*r
= Mono_Posix_Errno_ENOTTY
; return 0;}
1948 #endif /* ndef ENOTTY */
1951 {*r
= Mono_Posix_Errno_ENOTUNIQ
; return 0;}
1952 #endif /* ndef ENOTUNIQ */
1955 {*r
= Mono_Posix_Errno_ENXIO
; return 0;}
1956 #endif /* ndef ENXIO */
1958 if (x
== EOPNOTSUPP
)
1959 {*r
= Mono_Posix_Errno_EOPNOTSUPP
; return 0;}
1960 #endif /* ndef EOPNOTSUPP */
1963 {*r
= Mono_Posix_Errno_EOVERFLOW
; return 0;}
1964 #endif /* ndef EOVERFLOW */
1967 {*r
= Mono_Posix_Errno_EPERM
; return 0;}
1968 #endif /* ndef EPERM */
1970 if (x
== EPFNOSUPPORT
)
1971 {*r
= Mono_Posix_Errno_EPFNOSUPPORT
; return 0;}
1972 #endif /* ndef EPFNOSUPPORT */
1975 {*r
= Mono_Posix_Errno_EPIPE
; return 0;}
1976 #endif /* ndef EPIPE */
1979 {*r
= Mono_Posix_Errno_EPROTO
; return 0;}
1980 #endif /* ndef EPROTO */
1981 #ifdef EPROTONOSUPPORT
1982 if (x
== EPROTONOSUPPORT
)
1983 {*r
= Mono_Posix_Errno_EPROTONOSUPPORT
; return 0;}
1984 #endif /* ndef EPROTONOSUPPORT */
1986 if (x
== EPROTOTYPE
)
1987 {*r
= Mono_Posix_Errno_EPROTOTYPE
; return 0;}
1988 #endif /* ndef EPROTOTYPE */
1991 {*r
= Mono_Posix_Errno_ERANGE
; return 0;}
1992 #endif /* ndef ERANGE */
1995 {*r
= Mono_Posix_Errno_EREMCHG
; return 0;}
1996 #endif /* ndef EREMCHG */
1999 {*r
= Mono_Posix_Errno_EREMOTE
; return 0;}
2000 #endif /* ndef EREMOTE */
2003 {*r
= Mono_Posix_Errno_EREMOTEIO
; return 0;}
2004 #endif /* ndef EREMOTEIO */
2007 {*r
= Mono_Posix_Errno_ERESTART
; return 0;}
2008 #endif /* ndef ERESTART */
2011 {*r
= Mono_Posix_Errno_EROFS
; return 0;}
2012 #endif /* ndef EROFS */
2015 {*r
= Mono_Posix_Errno_ESHUTDOWN
; return 0;}
2016 #endif /* ndef ESHUTDOWN */
2017 #ifdef ESOCKTNOSUPPORT
2018 if (x
== ESOCKTNOSUPPORT
)
2019 {*r
= Mono_Posix_Errno_ESOCKTNOSUPPORT
; return 0;}
2020 #endif /* ndef ESOCKTNOSUPPORT */
2023 {*r
= Mono_Posix_Errno_ESPIPE
; return 0;}
2024 #endif /* ndef ESPIPE */
2027 {*r
= Mono_Posix_Errno_ESRCH
; return 0;}
2028 #endif /* ndef ESRCH */
2031 {*r
= Mono_Posix_Errno_ESRMNT
; return 0;}
2032 #endif /* ndef ESRMNT */
2035 {*r
= Mono_Posix_Errno_ESTALE
; return 0;}
2036 #endif /* ndef ESTALE */
2039 {*r
= Mono_Posix_Errno_ESTRPIPE
; return 0;}
2040 #endif /* ndef ESTRPIPE */
2043 {*r
= Mono_Posix_Errno_ETIME
; return 0;}
2044 #endif /* ndef ETIME */
2047 {*r
= Mono_Posix_Errno_ETIMEDOUT
; return 0;}
2048 #endif /* ndef ETIMEDOUT */
2050 if (x
== ETOOMANYREFS
)
2051 {*r
= Mono_Posix_Errno_ETOOMANYREFS
; return 0;}
2052 #endif /* ndef ETOOMANYREFS */
2055 {*r
= Mono_Posix_Errno_ETXTBSY
; return 0;}
2056 #endif /* ndef ETXTBSY */
2059 {*r
= Mono_Posix_Errno_EUCLEAN
; return 0;}
2060 #endif /* ndef EUCLEAN */
2063 {*r
= Mono_Posix_Errno_EUNATCH
; return 0;}
2064 #endif /* ndef EUNATCH */
2067 {*r
= Mono_Posix_Errno_EUSERS
; return 0;}
2068 #endif /* ndef EUSERS */
2070 if (x
== EWOULDBLOCK
)
2071 {*r
= Mono_Posix_Errno_EWOULDBLOCK
; return 0;}
2072 #endif /* ndef EWOULDBLOCK */
2075 {*r
= Mono_Posix_Errno_EXDEV
; return 0;}
2076 #endif /* ndef EXDEV */
2079 {*r
= Mono_Posix_Errno_EXFULL
; return 0;}
2080 #endif /* ndef EXFULL */
2081 errno
= EINVAL
; return -1;
2084 int Mono_Posix_FromFcntlCommand (int x
, int *r
)
2087 if (x
== Mono_Posix_FcntlCommand_F_DUPFD
)
2089 {*r
= F_DUPFD
; return 0;}
2090 #else /* def F_DUPFD */
2091 {errno
= EINVAL
; return -1;}
2092 #endif /* ndef F_DUPFD */
2093 if (x
== Mono_Posix_FcntlCommand_F_GETFD
)
2095 {*r
= F_GETFD
; return 0;}
2096 #else /* def F_GETFD */
2097 {errno
= EINVAL
; return -1;}
2098 #endif /* ndef F_GETFD */
2099 if (x
== Mono_Posix_FcntlCommand_F_GETFL
)
2101 {*r
= F_GETFL
; return 0;}
2102 #else /* def F_GETFL */
2103 {errno
= EINVAL
; return -1;}
2104 #endif /* ndef F_GETFL */
2105 if (x
== Mono_Posix_FcntlCommand_F_GETLEASE
)
2107 {*r
= F_GETLEASE
; return 0;}
2108 #else /* def F_GETLEASE */
2109 {errno
= EINVAL
; return -1;}
2110 #endif /* ndef F_GETLEASE */
2111 if (x
== Mono_Posix_FcntlCommand_F_GETLK
)
2113 {*r
= F_GETLK
; return 0;}
2114 #else /* def F_GETLK */
2115 {errno
= EINVAL
; return -1;}
2116 #endif /* ndef F_GETLK */
2117 if (x
== Mono_Posix_FcntlCommand_F_GETOWN
)
2119 {*r
= F_GETOWN
; return 0;}
2120 #else /* def F_GETOWN */
2121 {errno
= EINVAL
; return -1;}
2122 #endif /* ndef F_GETOWN */
2123 if (x
== Mono_Posix_FcntlCommand_F_GETSIG
)
2125 {*r
= F_GETSIG
; return 0;}
2126 #else /* def F_GETSIG */
2127 {errno
= EINVAL
; return -1;}
2128 #endif /* ndef F_GETSIG */
2129 if (x
== Mono_Posix_FcntlCommand_F_NOTIFY
)
2131 {*r
= F_NOTIFY
; return 0;}
2132 #else /* def F_NOTIFY */
2133 {errno
= EINVAL
; return -1;}
2134 #endif /* ndef F_NOTIFY */
2135 if (x
== Mono_Posix_FcntlCommand_F_SETFD
)
2137 {*r
= F_SETFD
; return 0;}
2138 #else /* def F_SETFD */
2139 {errno
= EINVAL
; return -1;}
2140 #endif /* ndef F_SETFD */
2141 if (x
== Mono_Posix_FcntlCommand_F_SETFL
)
2143 {*r
= F_SETFL
; return 0;}
2144 #else /* def F_SETFL */
2145 {errno
= EINVAL
; return -1;}
2146 #endif /* ndef F_SETFL */
2147 if (x
== Mono_Posix_FcntlCommand_F_SETLEASE
)
2149 {*r
= F_SETLEASE
; return 0;}
2150 #else /* def F_SETLEASE */
2151 {errno
= EINVAL
; return -1;}
2152 #endif /* ndef F_SETLEASE */
2153 if (x
== Mono_Posix_FcntlCommand_F_SETLK
)
2155 {*r
= F_SETLK
; return 0;}
2156 #else /* def F_SETLK */
2157 {errno
= EINVAL
; return -1;}
2158 #endif /* ndef F_SETLK */
2159 if (x
== Mono_Posix_FcntlCommand_F_SETLKW
)
2161 {*r
= F_SETLKW
; return 0;}
2162 #else /* def F_SETLKW */
2163 {errno
= EINVAL
; return -1;}
2164 #endif /* ndef F_SETLKW */
2165 if (x
== Mono_Posix_FcntlCommand_F_SETOWN
)
2167 {*r
= F_SETOWN
; return 0;}
2168 #else /* def F_SETOWN */
2169 {errno
= EINVAL
; return -1;}
2170 #endif /* ndef F_SETOWN */
2171 if (x
== Mono_Posix_FcntlCommand_F_SETSIG
)
2173 {*r
= F_SETSIG
; return 0;}
2174 #else /* def F_SETSIG */
2175 {errno
= EINVAL
; return -1;}
2176 #endif /* ndef F_SETSIG */
2179 errno
= EINVAL
; return -1;
2182 int Mono_Posix_ToFcntlCommand (int x
, int *r
)
2189 {*r
= Mono_Posix_FcntlCommand_F_DUPFD
; return 0;}
2190 #endif /* ndef F_DUPFD */
2193 {*r
= Mono_Posix_FcntlCommand_F_GETFD
; return 0;}
2194 #endif /* ndef F_GETFD */
2197 {*r
= Mono_Posix_FcntlCommand_F_GETFL
; return 0;}
2198 #endif /* ndef F_GETFL */
2200 if (x
== F_GETLEASE
)
2201 {*r
= Mono_Posix_FcntlCommand_F_GETLEASE
; return 0;}
2202 #endif /* ndef F_GETLEASE */
2205 {*r
= Mono_Posix_FcntlCommand_F_GETLK
; return 0;}
2206 #endif /* ndef F_GETLK */
2209 {*r
= Mono_Posix_FcntlCommand_F_GETOWN
; return 0;}
2210 #endif /* ndef F_GETOWN */
2213 {*r
= Mono_Posix_FcntlCommand_F_GETSIG
; return 0;}
2214 #endif /* ndef F_GETSIG */
2217 {*r
= Mono_Posix_FcntlCommand_F_NOTIFY
; return 0;}
2218 #endif /* ndef F_NOTIFY */
2221 {*r
= Mono_Posix_FcntlCommand_F_SETFD
; return 0;}
2222 #endif /* ndef F_SETFD */
2225 {*r
= Mono_Posix_FcntlCommand_F_SETFL
; return 0;}
2226 #endif /* ndef F_SETFL */
2228 if (x
== F_SETLEASE
)
2229 {*r
= Mono_Posix_FcntlCommand_F_SETLEASE
; return 0;}
2230 #endif /* ndef F_SETLEASE */
2233 {*r
= Mono_Posix_FcntlCommand_F_SETLK
; return 0;}
2234 #endif /* ndef F_SETLK */
2237 {*r
= Mono_Posix_FcntlCommand_F_SETLKW
; return 0;}
2238 #endif /* ndef F_SETLKW */
2241 {*r
= Mono_Posix_FcntlCommand_F_SETOWN
; return 0;}
2242 #endif /* ndef F_SETOWN */
2245 {*r
= Mono_Posix_FcntlCommand_F_SETSIG
; return 0;}
2246 #endif /* ndef F_SETSIG */
2247 errno
= EINVAL
; return -1;
2250 int Mono_Posix_FromFilePermissions (unsigned int x
, unsigned int *r
)
2253 if ((x
& Mono_Posix_FilePermissions_ACCESSPERMS
) == Mono_Posix_FilePermissions_ACCESSPERMS
)
2256 #else /* def ACCESSPERMS */
2257 {/* Ignoring Mono_Posix_FilePermissions_ACCESSPERMS, as it is constructed from other values */}
2258 #endif /* ndef ACCESSPERMS */
2259 if ((x
& Mono_Posix_FilePermissions_ALLPERMS
) == Mono_Posix_FilePermissions_ALLPERMS
)
2262 #else /* def ALLPERMS */
2263 {/* Ignoring Mono_Posix_FilePermissions_ALLPERMS, as it is constructed from other values */}
2264 #endif /* ndef ALLPERMS */
2265 if ((x
& Mono_Posix_FilePermissions_DEFFILEMODE
) == Mono_Posix_FilePermissions_DEFFILEMODE
)
2268 #else /* def DEFFILEMODE */
2269 {/* Ignoring Mono_Posix_FilePermissions_DEFFILEMODE, as it is constructed from other values */}
2270 #endif /* ndef DEFFILEMODE */
2271 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFBLK
)
2274 #else /* def S_IFBLK */
2275 {errno
= EINVAL
; return -1;}
2276 #endif /* ndef S_IFBLK */
2277 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFCHR
)
2280 #else /* def S_IFCHR */
2281 {errno
= EINVAL
; return -1;}
2282 #endif /* ndef S_IFCHR */
2283 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFDIR
)
2286 #else /* def S_IFDIR */
2287 {errno
= EINVAL
; return -1;}
2288 #endif /* ndef S_IFDIR */
2289 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFIFO
)
2292 #else /* def S_IFIFO */
2293 {errno
= EINVAL
; return -1;}
2294 #endif /* ndef S_IFIFO */
2295 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFLNK
)
2298 #else /* def S_IFLNK */
2299 {errno
= EINVAL
; return -1;}
2300 #endif /* ndef S_IFLNK */
2301 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFMT
)
2304 #else /* def S_IFMT */
2305 {/* Ignoring Mono_Posix_FilePermissions_S_IFMT, as it is constructed from other values */}
2306 #endif /* ndef S_IFMT */
2307 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFREG
)
2310 #else /* def S_IFREG */
2311 {errno
= EINVAL
; return -1;}
2312 #endif /* ndef S_IFREG */
2313 if ((x
& Mono_Posix_FilePermissions_S_IFMT
) == Mono_Posix_FilePermissions_S_IFSOCK
)
2316 #else /* def S_IFSOCK */
2317 {errno
= EINVAL
; return -1;}
2318 #endif /* ndef S_IFSOCK */
2319 if ((x
& Mono_Posix_FilePermissions_S_IRGRP
) == Mono_Posix_FilePermissions_S_IRGRP
)
2322 #else /* def S_IRGRP */
2323 {errno
= EINVAL
; return -1;}
2324 #endif /* ndef S_IRGRP */
2325 if ((x
& Mono_Posix_FilePermissions_S_IROTH
) == Mono_Posix_FilePermissions_S_IROTH
)
2328 #else /* def S_IROTH */
2329 {errno
= EINVAL
; return -1;}
2330 #endif /* ndef S_IROTH */
2331 if ((x
& Mono_Posix_FilePermissions_S_IRUSR
) == Mono_Posix_FilePermissions_S_IRUSR
)
2334 #else /* def S_IRUSR */
2335 {errno
= EINVAL
; return -1;}
2336 #endif /* ndef S_IRUSR */
2337 if ((x
& Mono_Posix_FilePermissions_S_IRWXG
) == Mono_Posix_FilePermissions_S_IRWXG
)
2340 #else /* def S_IRWXG */
2341 {/* Ignoring Mono_Posix_FilePermissions_S_IRWXG, as it is constructed from other values */}
2342 #endif /* ndef S_IRWXG */
2343 if ((x
& Mono_Posix_FilePermissions_S_IRWXO
) == Mono_Posix_FilePermissions_S_IRWXO
)
2346 #else /* def S_IRWXO */
2347 {/* Ignoring Mono_Posix_FilePermissions_S_IRWXO, as it is constructed from other values */}
2348 #endif /* ndef S_IRWXO */
2349 if ((x
& Mono_Posix_FilePermissions_S_IRWXU
) == Mono_Posix_FilePermissions_S_IRWXU
)
2352 #else /* def S_IRWXU */
2353 {/* Ignoring Mono_Posix_FilePermissions_S_IRWXU, as it is constructed from other values */}
2354 #endif /* ndef S_IRWXU */
2355 if ((x
& Mono_Posix_FilePermissions_S_ISGID
) == Mono_Posix_FilePermissions_S_ISGID
)
2358 #else /* def S_ISGID */
2359 {errno
= EINVAL
; return -1;}
2360 #endif /* ndef S_ISGID */
2361 if ((x
& Mono_Posix_FilePermissions_S_ISUID
) == Mono_Posix_FilePermissions_S_ISUID
)
2364 #else /* def S_ISUID */
2365 {errno
= EINVAL
; return -1;}
2366 #endif /* ndef S_ISUID */
2367 if ((x
& Mono_Posix_FilePermissions_S_ISVTX
) == Mono_Posix_FilePermissions_S_ISVTX
)
2370 #else /* def S_ISVTX */
2371 {errno
= EINVAL
; return -1;}
2372 #endif /* ndef S_ISVTX */
2373 if ((x
& Mono_Posix_FilePermissions_S_IWGRP
) == Mono_Posix_FilePermissions_S_IWGRP
)
2376 #else /* def S_IWGRP */
2377 {errno
= EINVAL
; return -1;}
2378 #endif /* ndef S_IWGRP */
2379 if ((x
& Mono_Posix_FilePermissions_S_IWOTH
) == Mono_Posix_FilePermissions_S_IWOTH
)
2382 #else /* def S_IWOTH */
2383 {errno
= EINVAL
; return -1;}
2384 #endif /* ndef S_IWOTH */
2385 if ((x
& Mono_Posix_FilePermissions_S_IWUSR
) == Mono_Posix_FilePermissions_S_IWUSR
)
2388 #else /* def S_IWUSR */
2389 {errno
= EINVAL
; return -1;}
2390 #endif /* ndef S_IWUSR */
2391 if ((x
& Mono_Posix_FilePermissions_S_IXGRP
) == Mono_Posix_FilePermissions_S_IXGRP
)
2394 #else /* def S_IXGRP */
2395 {errno
= EINVAL
; return -1;}
2396 #endif /* ndef S_IXGRP */
2397 if ((x
& Mono_Posix_FilePermissions_S_IXOTH
) == Mono_Posix_FilePermissions_S_IXOTH
)
2400 #else /* def S_IXOTH */
2401 {errno
= EINVAL
; return -1;}
2402 #endif /* ndef S_IXOTH */
2403 if ((x
& Mono_Posix_FilePermissions_S_IXUSR
) == Mono_Posix_FilePermissions_S_IXUSR
)
2406 #else /* def S_IXUSR */
2407 {errno
= EINVAL
; return -1;}
2408 #endif /* ndef S_IXUSR */
2414 int Mono_Posix_ToFilePermissions (unsigned int x
, unsigned int *r
)
2420 if ((x
& ACCESSPERMS
) == ACCESSPERMS
)
2421 *r
|= Mono_Posix_FilePermissions_ACCESSPERMS
;
2422 #endif /* ndef ACCESSPERMS */
2424 if ((x
& ALLPERMS
) == ALLPERMS
)
2425 *r
|= Mono_Posix_FilePermissions_ALLPERMS
;
2426 #endif /* ndef ALLPERMS */
2428 if ((x
& DEFFILEMODE
) == DEFFILEMODE
)
2429 *r
|= Mono_Posix_FilePermissions_DEFFILEMODE
;
2430 #endif /* ndef DEFFILEMODE */
2432 if ((x
& S_IFMT
) == S_IFBLK
)
2433 *r
|= Mono_Posix_FilePermissions_S_IFBLK
;
2434 #endif /* ndef S_IFBLK */
2436 if ((x
& S_IFMT
) == S_IFCHR
)
2437 *r
|= Mono_Posix_FilePermissions_S_IFCHR
;
2438 #endif /* ndef S_IFCHR */
2440 if ((x
& S_IFMT
) == S_IFDIR
)
2441 *r
|= Mono_Posix_FilePermissions_S_IFDIR
;
2442 #endif /* ndef S_IFDIR */
2444 if ((x
& S_IFMT
) == S_IFIFO
)
2445 *r
|= Mono_Posix_FilePermissions_S_IFIFO
;
2446 #endif /* ndef S_IFIFO */
2448 if ((x
& S_IFMT
) == S_IFLNK
)
2449 *r
|= Mono_Posix_FilePermissions_S_IFLNK
;
2450 #endif /* ndef S_IFLNK */
2452 if ((x
& S_IFMT
) == S_IFMT
)
2453 *r
|= Mono_Posix_FilePermissions_S_IFMT
;
2454 #endif /* ndef S_IFMT */
2456 if ((x
& S_IFMT
) == S_IFREG
)
2457 *r
|= Mono_Posix_FilePermissions_S_IFREG
;
2458 #endif /* ndef S_IFREG */
2460 if ((x
& S_IFMT
) == S_IFSOCK
)
2461 *r
|= Mono_Posix_FilePermissions_S_IFSOCK
;
2462 #endif /* ndef S_IFSOCK */
2464 if ((x
& S_IRGRP
) == S_IRGRP
)
2465 *r
|= Mono_Posix_FilePermissions_S_IRGRP
;
2466 #endif /* ndef S_IRGRP */
2468 if ((x
& S_IROTH
) == S_IROTH
)
2469 *r
|= Mono_Posix_FilePermissions_S_IROTH
;
2470 #endif /* ndef S_IROTH */
2472 if ((x
& S_IRUSR
) == S_IRUSR
)
2473 *r
|= Mono_Posix_FilePermissions_S_IRUSR
;
2474 #endif /* ndef S_IRUSR */
2476 if ((x
& S_IRWXG
) == S_IRWXG
)
2477 *r
|= Mono_Posix_FilePermissions_S_IRWXG
;
2478 #endif /* ndef S_IRWXG */
2480 if ((x
& S_IRWXO
) == S_IRWXO
)
2481 *r
|= Mono_Posix_FilePermissions_S_IRWXO
;
2482 #endif /* ndef S_IRWXO */
2484 if ((x
& S_IRWXU
) == S_IRWXU
)
2485 *r
|= Mono_Posix_FilePermissions_S_IRWXU
;
2486 #endif /* ndef S_IRWXU */
2488 if ((x
& S_ISGID
) == S_ISGID
)
2489 *r
|= Mono_Posix_FilePermissions_S_ISGID
;
2490 #endif /* ndef S_ISGID */
2492 if ((x
& S_ISUID
) == S_ISUID
)
2493 *r
|= Mono_Posix_FilePermissions_S_ISUID
;
2494 #endif /* ndef S_ISUID */
2496 if ((x
& S_ISVTX
) == S_ISVTX
)
2497 *r
|= Mono_Posix_FilePermissions_S_ISVTX
;
2498 #endif /* ndef S_ISVTX */
2500 if ((x
& S_IWGRP
) == S_IWGRP
)
2501 *r
|= Mono_Posix_FilePermissions_S_IWGRP
;
2502 #endif /* ndef S_IWGRP */
2504 if ((x
& S_IWOTH
) == S_IWOTH
)
2505 *r
|= Mono_Posix_FilePermissions_S_IWOTH
;
2506 #endif /* ndef S_IWOTH */
2508 if ((x
& S_IWUSR
) == S_IWUSR
)
2509 *r
|= Mono_Posix_FilePermissions_S_IWUSR
;
2510 #endif /* ndef S_IWUSR */
2512 if ((x
& S_IXGRP
) == S_IXGRP
)
2513 *r
|= Mono_Posix_FilePermissions_S_IXGRP
;
2514 #endif /* ndef S_IXGRP */
2516 if ((x
& S_IXOTH
) == S_IXOTH
)
2517 *r
|= Mono_Posix_FilePermissions_S_IXOTH
;
2518 #endif /* ndef S_IXOTH */
2520 if ((x
& S_IXUSR
) == S_IXUSR
)
2521 *r
|= Mono_Posix_FilePermissions_S_IXUSR
;
2522 #endif /* ndef S_IXUSR */
2526 int Mono_Posix_FromLockType (short x
, short *r
)
2529 if (x
== Mono_Posix_LockType_F_RDLCK
)
2531 {*r
= F_RDLCK
; return 0;}
2532 #else /* def F_RDLCK */
2533 {errno
= EINVAL
; return -1;}
2534 #endif /* ndef F_RDLCK */
2535 if (x
== Mono_Posix_LockType_F_UNLCK
)
2537 {*r
= F_UNLCK
; return 0;}
2538 #else /* def F_UNLCK */
2539 {errno
= EINVAL
; return -1;}
2540 #endif /* ndef F_UNLCK */
2541 if (x
== Mono_Posix_LockType_F_WRLCK
)
2543 {*r
= F_WRLCK
; return 0;}
2544 #else /* def F_WRLCK */
2545 {errno
= EINVAL
; return -1;}
2546 #endif /* ndef F_WRLCK */
2549 errno
= EINVAL
; return -1;
2552 int Mono_Posix_ToLockType (short x
, short *r
)
2559 {*r
= Mono_Posix_LockType_F_RDLCK
; return 0;}
2560 #endif /* ndef F_RDLCK */
2563 {*r
= Mono_Posix_LockType_F_UNLCK
; return 0;}
2564 #endif /* ndef F_UNLCK */
2567 {*r
= Mono_Posix_LockType_F_WRLCK
; return 0;}
2568 #endif /* ndef F_WRLCK */
2569 errno
= EINVAL
; return -1;
2572 int Mono_Posix_FromLockfCommand (int x
, int *r
)
2575 if (x
== Mono_Posix_LockfCommand_F_LOCK
)
2577 {*r
= F_LOCK
; return 0;}
2578 #else /* def F_LOCK */
2579 {errno
= EINVAL
; return -1;}
2580 #endif /* ndef F_LOCK */
2581 if (x
== Mono_Posix_LockfCommand_F_TEST
)
2583 {*r
= F_TEST
; return 0;}
2584 #else /* def F_TEST */
2585 {errno
= EINVAL
; return -1;}
2586 #endif /* ndef F_TEST */
2587 if (x
== Mono_Posix_LockfCommand_F_TLOCK
)
2589 {*r
= F_TLOCK
; return 0;}
2590 #else /* def F_TLOCK */
2591 {errno
= EINVAL
; return -1;}
2592 #endif /* ndef F_TLOCK */
2593 if (x
== Mono_Posix_LockfCommand_F_ULOCK
)
2595 {*r
= F_ULOCK
; return 0;}
2596 #else /* def F_ULOCK */
2597 {errno
= EINVAL
; return -1;}
2598 #endif /* ndef F_ULOCK */
2601 errno
= EINVAL
; return -1;
2604 int Mono_Posix_ToLockfCommand (int x
, int *r
)
2611 {*r
= Mono_Posix_LockfCommand_F_LOCK
; return 0;}
2612 #endif /* ndef F_LOCK */
2615 {*r
= Mono_Posix_LockfCommand_F_TEST
; return 0;}
2616 #endif /* ndef F_TEST */
2619 {*r
= Mono_Posix_LockfCommand_F_TLOCK
; return 0;}
2620 #endif /* ndef F_TLOCK */
2623 {*r
= Mono_Posix_LockfCommand_F_ULOCK
; return 0;}
2624 #endif /* ndef F_ULOCK */
2625 errno
= EINVAL
; return -1;
2628 int Mono_Posix_FromMlockallFlags (int x
, int *r
)
2631 if ((x
& Mono_Posix_MlockallFlags_MCL_CURRENT
) == Mono_Posix_MlockallFlags_MCL_CURRENT
)
2634 #else /* def MCL_CURRENT */
2635 {errno
= EINVAL
; return -1;}
2636 #endif /* ndef MCL_CURRENT */
2637 if ((x
& Mono_Posix_MlockallFlags_MCL_FUTURE
) == Mono_Posix_MlockallFlags_MCL_FUTURE
)
2640 #else /* def MCL_FUTURE */
2641 {errno
= EINVAL
; return -1;}
2642 #endif /* ndef MCL_FUTURE */
2648 int Mono_Posix_ToMlockallFlags (int x
, int *r
)
2654 if ((x
& MCL_CURRENT
) == MCL_CURRENT
)
2655 *r
|= Mono_Posix_MlockallFlags_MCL_CURRENT
;
2656 #endif /* ndef MCL_CURRENT */
2658 if ((x
& MCL_FUTURE
) == MCL_FUTURE
)
2659 *r
|= Mono_Posix_MlockallFlags_MCL_FUTURE
;
2660 #endif /* ndef MCL_FUTURE */
2664 int Mono_Posix_FromMmapFlags (int x
, int *r
)
2667 if ((x
& Mono_Posix_MmapFlags_MAP_ANON
) == Mono_Posix_MmapFlags_MAP_ANON
)
2670 #else /* def MAP_ANON */
2671 {errno
= EINVAL
; return -1;}
2672 #endif /* ndef MAP_ANON */
2673 if ((x
& Mono_Posix_MmapFlags_MAP_ANONYMOUS
) == Mono_Posix_MmapFlags_MAP_ANONYMOUS
)
2674 #ifdef MAP_ANONYMOUS
2675 *r
|= MAP_ANONYMOUS
;
2676 #else /* def MAP_ANONYMOUS */
2677 {errno
= EINVAL
; return -1;}
2678 #endif /* ndef MAP_ANONYMOUS */
2679 if ((x
& Mono_Posix_MmapFlags_MAP_DENYWRITE
) == Mono_Posix_MmapFlags_MAP_DENYWRITE
)
2680 #ifdef MAP_DENYWRITE
2681 *r
|= MAP_DENYWRITE
;
2682 #else /* def MAP_DENYWRITE */
2683 {errno
= EINVAL
; return -1;}
2684 #endif /* ndef MAP_DENYWRITE */
2685 if ((x
& Mono_Posix_MmapFlags_MAP_EXECUTABLE
) == Mono_Posix_MmapFlags_MAP_EXECUTABLE
)
2686 #ifdef MAP_EXECUTABLE
2687 *r
|= MAP_EXECUTABLE
;
2688 #else /* def MAP_EXECUTABLE */
2689 {errno
= EINVAL
; return -1;}
2690 #endif /* ndef MAP_EXECUTABLE */
2691 if ((x
& Mono_Posix_MmapFlags_MAP_FILE
) == Mono_Posix_MmapFlags_MAP_FILE
)
2694 #else /* def MAP_FILE */
2695 {errno
= EINVAL
; return -1;}
2696 #endif /* ndef MAP_FILE */
2697 if ((x
& Mono_Posix_MmapFlags_MAP_FIXED
) == Mono_Posix_MmapFlags_MAP_FIXED
)
2700 #else /* def MAP_FIXED */
2701 {errno
= EINVAL
; return -1;}
2702 #endif /* ndef MAP_FIXED */
2703 if ((x
& Mono_Posix_MmapFlags_MAP_GROWSDOWN
) == Mono_Posix_MmapFlags_MAP_GROWSDOWN
)
2704 #ifdef MAP_GROWSDOWN
2705 *r
|= MAP_GROWSDOWN
;
2706 #else /* def MAP_GROWSDOWN */
2707 {errno
= EINVAL
; return -1;}
2708 #endif /* ndef MAP_GROWSDOWN */
2709 if ((x
& Mono_Posix_MmapFlags_MAP_LOCKED
) == Mono_Posix_MmapFlags_MAP_LOCKED
)
2712 #else /* def MAP_LOCKED */
2713 {errno
= EINVAL
; return -1;}
2714 #endif /* ndef MAP_LOCKED */
2715 if ((x
& Mono_Posix_MmapFlags_MAP_NONBLOCK
) == Mono_Posix_MmapFlags_MAP_NONBLOCK
)
2718 #else /* def MAP_NONBLOCK */
2719 {errno
= EINVAL
; return -1;}
2720 #endif /* ndef MAP_NONBLOCK */
2721 if ((x
& Mono_Posix_MmapFlags_MAP_NORESERVE
) == Mono_Posix_MmapFlags_MAP_NORESERVE
)
2722 #ifdef MAP_NORESERVE
2723 *r
|= MAP_NORESERVE
;
2724 #else /* def MAP_NORESERVE */
2725 {errno
= EINVAL
; return -1;}
2726 #endif /* ndef MAP_NORESERVE */
2727 if ((x
& Mono_Posix_MmapFlags_MAP_POPULATE
) == Mono_Posix_MmapFlags_MAP_POPULATE
)
2730 #else /* def MAP_POPULATE */
2731 {errno
= EINVAL
; return -1;}
2732 #endif /* ndef MAP_POPULATE */
2733 if ((x
& Mono_Posix_MmapFlags_MAP_PRIVATE
) == Mono_Posix_MmapFlags_MAP_PRIVATE
)
2736 #else /* def MAP_PRIVATE */
2737 {errno
= EINVAL
; return -1;}
2738 #endif /* ndef MAP_PRIVATE */
2739 if ((x
& Mono_Posix_MmapFlags_MAP_SHARED
) == Mono_Posix_MmapFlags_MAP_SHARED
)
2742 #else /* def MAP_SHARED */
2743 {errno
= EINVAL
; return -1;}
2744 #endif /* ndef MAP_SHARED */
2745 if ((x
& Mono_Posix_MmapFlags_MAP_TYPE
) == Mono_Posix_MmapFlags_MAP_TYPE
)
2748 #else /* def MAP_TYPE */
2749 {errno
= EINVAL
; return -1;}
2750 #endif /* ndef MAP_TYPE */
2756 int Mono_Posix_ToMmapFlags (int x
, int *r
)
2762 if ((x
& MAP_ANON
) == MAP_ANON
)
2763 *r
|= Mono_Posix_MmapFlags_MAP_ANON
;
2764 #endif /* ndef MAP_ANON */
2765 #ifdef MAP_ANONYMOUS
2766 if ((x
& MAP_ANONYMOUS
) == MAP_ANONYMOUS
)
2767 *r
|= Mono_Posix_MmapFlags_MAP_ANONYMOUS
;
2768 #endif /* ndef MAP_ANONYMOUS */
2769 #ifdef MAP_DENYWRITE
2770 if ((x
& MAP_DENYWRITE
) == MAP_DENYWRITE
)
2771 *r
|= Mono_Posix_MmapFlags_MAP_DENYWRITE
;
2772 #endif /* ndef MAP_DENYWRITE */
2773 #ifdef MAP_EXECUTABLE
2774 if ((x
& MAP_EXECUTABLE
) == MAP_EXECUTABLE
)
2775 *r
|= Mono_Posix_MmapFlags_MAP_EXECUTABLE
;
2776 #endif /* ndef MAP_EXECUTABLE */
2778 if ((x
& MAP_FILE
) == MAP_FILE
)
2779 *r
|= Mono_Posix_MmapFlags_MAP_FILE
;
2780 #endif /* ndef MAP_FILE */
2782 if ((x
& MAP_FIXED
) == MAP_FIXED
)
2783 *r
|= Mono_Posix_MmapFlags_MAP_FIXED
;
2784 #endif /* ndef MAP_FIXED */
2785 #ifdef MAP_GROWSDOWN
2786 if ((x
& MAP_GROWSDOWN
) == MAP_GROWSDOWN
)
2787 *r
|= Mono_Posix_MmapFlags_MAP_GROWSDOWN
;
2788 #endif /* ndef MAP_GROWSDOWN */
2790 if ((x
& MAP_LOCKED
) == MAP_LOCKED
)
2791 *r
|= Mono_Posix_MmapFlags_MAP_LOCKED
;
2792 #endif /* ndef MAP_LOCKED */
2794 if ((x
& MAP_NONBLOCK
) == MAP_NONBLOCK
)
2795 *r
|= Mono_Posix_MmapFlags_MAP_NONBLOCK
;
2796 #endif /* ndef MAP_NONBLOCK */
2797 #ifdef MAP_NORESERVE
2798 if ((x
& MAP_NORESERVE
) == MAP_NORESERVE
)
2799 *r
|= Mono_Posix_MmapFlags_MAP_NORESERVE
;
2800 #endif /* ndef MAP_NORESERVE */
2802 if ((x
& MAP_POPULATE
) == MAP_POPULATE
)
2803 *r
|= Mono_Posix_MmapFlags_MAP_POPULATE
;
2804 #endif /* ndef MAP_POPULATE */
2806 if ((x
& MAP_PRIVATE
) == MAP_PRIVATE
)
2807 *r
|= Mono_Posix_MmapFlags_MAP_PRIVATE
;
2808 #endif /* ndef MAP_PRIVATE */
2810 if ((x
& MAP_SHARED
) == MAP_SHARED
)
2811 *r
|= Mono_Posix_MmapFlags_MAP_SHARED
;
2812 #endif /* ndef MAP_SHARED */
2814 if ((x
& MAP_TYPE
) == MAP_TYPE
)
2815 *r
|= Mono_Posix_MmapFlags_MAP_TYPE
;
2816 #endif /* ndef MAP_TYPE */
2820 int Mono_Posix_FromMmapProts (int x
, int *r
)
2823 if ((x
& Mono_Posix_MmapProts_PROT_EXEC
) == Mono_Posix_MmapProts_PROT_EXEC
)
2826 #else /* def PROT_EXEC */
2827 {errno
= EINVAL
; return -1;}
2828 #endif /* ndef PROT_EXEC */
2829 if ((x
& Mono_Posix_MmapProts_PROT_GROWSDOWN
) == Mono_Posix_MmapProts_PROT_GROWSDOWN
)
2830 #ifdef PROT_GROWSDOWN
2831 *r
|= PROT_GROWSDOWN
;
2832 #else /* def PROT_GROWSDOWN */
2833 {errno
= EINVAL
; return -1;}
2834 #endif /* ndef PROT_GROWSDOWN */
2835 if ((x
& Mono_Posix_MmapProts_PROT_GROWSUP
) == Mono_Posix_MmapProts_PROT_GROWSUP
)
2838 #else /* def PROT_GROWSUP */
2839 {errno
= EINVAL
; return -1;}
2840 #endif /* ndef PROT_GROWSUP */
2841 if ((x
& Mono_Posix_MmapProts_PROT_NONE
) == Mono_Posix_MmapProts_PROT_NONE
)
2844 #else /* def PROT_NONE */
2845 {errno
= EINVAL
; return -1;}
2846 #endif /* ndef PROT_NONE */
2847 if ((x
& Mono_Posix_MmapProts_PROT_READ
) == Mono_Posix_MmapProts_PROT_READ
)
2850 #else /* def PROT_READ */
2851 {errno
= EINVAL
; return -1;}
2852 #endif /* ndef PROT_READ */
2853 if ((x
& Mono_Posix_MmapProts_PROT_WRITE
) == Mono_Posix_MmapProts_PROT_WRITE
)
2856 #else /* def PROT_WRITE */
2857 {errno
= EINVAL
; return -1;}
2858 #endif /* ndef PROT_WRITE */
2864 int Mono_Posix_ToMmapProts (int x
, int *r
)
2870 if ((x
& PROT_EXEC
) == PROT_EXEC
)
2871 *r
|= Mono_Posix_MmapProts_PROT_EXEC
;
2872 #endif /* ndef PROT_EXEC */
2873 #ifdef PROT_GROWSDOWN
2874 if ((x
& PROT_GROWSDOWN
) == PROT_GROWSDOWN
)
2875 *r
|= Mono_Posix_MmapProts_PROT_GROWSDOWN
;
2876 #endif /* ndef PROT_GROWSDOWN */
2878 if ((x
& PROT_GROWSUP
) == PROT_GROWSUP
)
2879 *r
|= Mono_Posix_MmapProts_PROT_GROWSUP
;
2880 #endif /* ndef PROT_GROWSUP */
2882 if ((x
& PROT_NONE
) == PROT_NONE
)
2883 *r
|= Mono_Posix_MmapProts_PROT_NONE
;
2884 #endif /* ndef PROT_NONE */
2886 if ((x
& PROT_READ
) == PROT_READ
)
2887 *r
|= Mono_Posix_MmapProts_PROT_READ
;
2888 #endif /* ndef PROT_READ */
2890 if ((x
& PROT_WRITE
) == PROT_WRITE
)
2891 *r
|= Mono_Posix_MmapProts_PROT_WRITE
;
2892 #endif /* ndef PROT_WRITE */
2896 int Mono_Posix_FromMountFlags (guint64 x
, guint64
*r
)
2899 if ((x
& Mono_Posix_MountFlags_ST_APPEND
) == Mono_Posix_MountFlags_ST_APPEND
)
2902 #else /* def ST_APPEND */
2903 {errno
= EINVAL
; return -1;}
2904 #endif /* ndef ST_APPEND */
2905 if ((x
& Mono_Posix_MountFlags_ST_BIND
) == Mono_Posix_MountFlags_ST_BIND
)
2908 #else /* def ST_BIND */
2909 {errno
= EINVAL
; return -1;}
2910 #endif /* ndef ST_BIND */
2911 if ((x
& Mono_Posix_MountFlags_ST_IMMUTABLE
) == Mono_Posix_MountFlags_ST_IMMUTABLE
)
2914 #else /* def ST_IMMUTABLE */
2915 {errno
= EINVAL
; return -1;}
2916 #endif /* ndef ST_IMMUTABLE */
2917 if ((x
& Mono_Posix_MountFlags_ST_MANDLOCK
) == Mono_Posix_MountFlags_ST_MANDLOCK
)
2920 #else /* def ST_MANDLOCK */
2921 {errno
= EINVAL
; return -1;}
2922 #endif /* ndef ST_MANDLOCK */
2923 if ((x
& Mono_Posix_MountFlags_ST_NOATIME
) == Mono_Posix_MountFlags_ST_NOATIME
)
2926 #else /* def ST_NOATIME */
2927 {errno
= EINVAL
; return -1;}
2928 #endif /* ndef ST_NOATIME */
2929 if ((x
& Mono_Posix_MountFlags_ST_NODEV
) == Mono_Posix_MountFlags_ST_NODEV
)
2932 #else /* def ST_NODEV */
2933 {errno
= EINVAL
; return -1;}
2934 #endif /* ndef ST_NODEV */
2935 if ((x
& Mono_Posix_MountFlags_ST_NODIRATIME
) == Mono_Posix_MountFlags_ST_NODIRATIME
)
2936 #ifdef ST_NODIRATIME
2937 *r
|= ST_NODIRATIME
;
2938 #else /* def ST_NODIRATIME */
2939 {errno
= EINVAL
; return -1;}
2940 #endif /* ndef ST_NODIRATIME */
2941 if ((x
& Mono_Posix_MountFlags_ST_NOEXEC
) == Mono_Posix_MountFlags_ST_NOEXEC
)
2944 #else /* def ST_NOEXEC */
2945 {errno
= EINVAL
; return -1;}
2946 #endif /* ndef ST_NOEXEC */
2947 if ((x
& Mono_Posix_MountFlags_ST_NOSUID
) == Mono_Posix_MountFlags_ST_NOSUID
)
2950 #else /* def ST_NOSUID */
2951 {errno
= EINVAL
; return -1;}
2952 #endif /* ndef ST_NOSUID */
2953 if ((x
& Mono_Posix_MountFlags_ST_RDONLY
) == Mono_Posix_MountFlags_ST_RDONLY
)
2956 #else /* def ST_RDONLY */
2957 {errno
= EINVAL
; return -1;}
2958 #endif /* ndef ST_RDONLY */
2959 if ((x
& Mono_Posix_MountFlags_ST_REMOUNT
) == Mono_Posix_MountFlags_ST_REMOUNT
)
2962 #else /* def ST_REMOUNT */
2963 {errno
= EINVAL
; return -1;}
2964 #endif /* ndef ST_REMOUNT */
2965 if ((x
& Mono_Posix_MountFlags_ST_SYNCHRONOUS
) == Mono_Posix_MountFlags_ST_SYNCHRONOUS
)
2966 #ifdef ST_SYNCHRONOUS
2967 *r
|= ST_SYNCHRONOUS
;
2968 #else /* def ST_SYNCHRONOUS */
2969 {errno
= EINVAL
; return -1;}
2970 #endif /* ndef ST_SYNCHRONOUS */
2971 if ((x
& Mono_Posix_MountFlags_ST_WRITE
) == Mono_Posix_MountFlags_ST_WRITE
)
2974 #else /* def ST_WRITE */
2975 {errno
= EINVAL
; return -1;}
2976 #endif /* ndef ST_WRITE */
2982 int Mono_Posix_ToMountFlags (guint64 x
, guint64
*r
)
2988 if ((x
& ST_APPEND
) == ST_APPEND
)
2989 *r
|= Mono_Posix_MountFlags_ST_APPEND
;
2990 #endif /* ndef ST_APPEND */
2992 if ((x
& ST_BIND
) == ST_BIND
)
2993 *r
|= Mono_Posix_MountFlags_ST_BIND
;
2994 #endif /* ndef ST_BIND */
2996 if ((x
& ST_IMMUTABLE
) == ST_IMMUTABLE
)
2997 *r
|= Mono_Posix_MountFlags_ST_IMMUTABLE
;
2998 #endif /* ndef ST_IMMUTABLE */
3000 if ((x
& ST_MANDLOCK
) == ST_MANDLOCK
)
3001 *r
|= Mono_Posix_MountFlags_ST_MANDLOCK
;
3002 #endif /* ndef ST_MANDLOCK */
3004 if ((x
& ST_NOATIME
) == ST_NOATIME
)
3005 *r
|= Mono_Posix_MountFlags_ST_NOATIME
;
3006 #endif /* ndef ST_NOATIME */
3008 if ((x
& ST_NODEV
) == ST_NODEV
)
3009 *r
|= Mono_Posix_MountFlags_ST_NODEV
;
3010 #endif /* ndef ST_NODEV */
3011 #ifdef ST_NODIRATIME
3012 if ((x
& ST_NODIRATIME
) == ST_NODIRATIME
)
3013 *r
|= Mono_Posix_MountFlags_ST_NODIRATIME
;
3014 #endif /* ndef ST_NODIRATIME */
3016 if ((x
& ST_NOEXEC
) == ST_NOEXEC
)
3017 *r
|= Mono_Posix_MountFlags_ST_NOEXEC
;
3018 #endif /* ndef ST_NOEXEC */
3020 if ((x
& ST_NOSUID
) == ST_NOSUID
)
3021 *r
|= Mono_Posix_MountFlags_ST_NOSUID
;
3022 #endif /* ndef ST_NOSUID */
3024 if ((x
& ST_RDONLY
) == ST_RDONLY
)
3025 *r
|= Mono_Posix_MountFlags_ST_RDONLY
;
3026 #endif /* ndef ST_RDONLY */
3028 if ((x
& ST_REMOUNT
) == ST_REMOUNT
)
3029 *r
|= Mono_Posix_MountFlags_ST_REMOUNT
;
3030 #endif /* ndef ST_REMOUNT */
3031 #ifdef ST_SYNCHRONOUS
3032 if ((x
& ST_SYNCHRONOUS
) == ST_SYNCHRONOUS
)
3033 *r
|= Mono_Posix_MountFlags_ST_SYNCHRONOUS
;
3034 #endif /* ndef ST_SYNCHRONOUS */
3036 if ((x
& ST_WRITE
) == ST_WRITE
)
3037 *r
|= Mono_Posix_MountFlags_ST_WRITE
;
3038 #endif /* ndef ST_WRITE */
3042 int Mono_Posix_FromMremapFlags (guint64 x
, guint64
*r
)
3045 if ((x
& Mono_Posix_MremapFlags_MREMAP_MAYMOVE
) == Mono_Posix_MremapFlags_MREMAP_MAYMOVE
)
3046 #ifdef MREMAP_MAYMOVE
3047 *r
|= MREMAP_MAYMOVE
;
3048 #else /* def MREMAP_MAYMOVE */
3049 {errno
= EINVAL
; return -1;}
3050 #endif /* ndef MREMAP_MAYMOVE */
3056 int Mono_Posix_ToMremapFlags (guint64 x
, guint64
*r
)
3061 #ifdef MREMAP_MAYMOVE
3062 if ((x
& MREMAP_MAYMOVE
) == MREMAP_MAYMOVE
)
3063 *r
|= Mono_Posix_MremapFlags_MREMAP_MAYMOVE
;
3064 #endif /* ndef MREMAP_MAYMOVE */
3068 int Mono_Posix_FromMsyncFlags (int x
, int *r
)
3071 if ((x
& Mono_Posix_MsyncFlags_MS_ASYNC
) == Mono_Posix_MsyncFlags_MS_ASYNC
)
3074 #else /* def MS_ASYNC */
3075 {errno
= EINVAL
; return -1;}
3076 #endif /* ndef MS_ASYNC */
3077 if ((x
& Mono_Posix_MsyncFlags_MS_INVALIDATE
) == Mono_Posix_MsyncFlags_MS_INVALIDATE
)
3078 #ifdef MS_INVALIDATE
3079 *r
|= MS_INVALIDATE
;
3080 #else /* def MS_INVALIDATE */
3081 {errno
= EINVAL
; return -1;}
3082 #endif /* ndef MS_INVALIDATE */
3083 if ((x
& Mono_Posix_MsyncFlags_MS_SYNC
) == Mono_Posix_MsyncFlags_MS_SYNC
)
3086 #else /* def MS_SYNC */
3087 {errno
= EINVAL
; return -1;}
3088 #endif /* ndef MS_SYNC */
3094 int Mono_Posix_ToMsyncFlags (int x
, int *r
)
3100 if ((x
& MS_ASYNC
) == MS_ASYNC
)
3101 *r
|= Mono_Posix_MsyncFlags_MS_ASYNC
;
3102 #endif /* ndef MS_ASYNC */
3103 #ifdef MS_INVALIDATE
3104 if ((x
& MS_INVALIDATE
) == MS_INVALIDATE
)
3105 *r
|= Mono_Posix_MsyncFlags_MS_INVALIDATE
;
3106 #endif /* ndef MS_INVALIDATE */
3108 if ((x
& MS_SYNC
) == MS_SYNC
)
3109 *r
|= Mono_Posix_MsyncFlags_MS_SYNC
;
3110 #endif /* ndef MS_SYNC */
3114 int Mono_Posix_FromOpenFlags (int x
, int *r
)
3117 if ((x
& Mono_Posix_OpenFlags_O_APPEND
) == Mono_Posix_OpenFlags_O_APPEND
)
3120 #else /* def O_APPEND */
3121 {errno
= EINVAL
; return -1;}
3122 #endif /* ndef O_APPEND */
3123 if ((x
& Mono_Posix_OpenFlags_O_ASYNC
) == Mono_Posix_OpenFlags_O_ASYNC
)
3126 #else /* def O_ASYNC */
3127 {errno
= EINVAL
; return -1;}
3128 #endif /* ndef O_ASYNC */
3129 if ((x
& Mono_Posix_OpenFlags_O_CREAT
) == Mono_Posix_OpenFlags_O_CREAT
)
3132 #else /* def O_CREAT */
3133 {errno
= EINVAL
; return -1;}
3134 #endif /* ndef O_CREAT */
3135 if ((x
& Mono_Posix_OpenFlags_O_DIRECT
) == Mono_Posix_OpenFlags_O_DIRECT
)
3138 #else /* def O_DIRECT */
3139 {errno
= EINVAL
; return -1;}
3140 #endif /* ndef O_DIRECT */
3141 if ((x
& Mono_Posix_OpenFlags_O_DIRECTORY
) == Mono_Posix_OpenFlags_O_DIRECTORY
)
3144 #else /* def O_DIRECTORY */
3145 {errno
= EINVAL
; return -1;}
3146 #endif /* ndef O_DIRECTORY */
3147 if ((x
& Mono_Posix_OpenFlags_O_EXCL
) == Mono_Posix_OpenFlags_O_EXCL
)
3150 #else /* def O_EXCL */
3151 {errno
= EINVAL
; return -1;}
3152 #endif /* ndef O_EXCL */
3153 if ((x
& Mono_Posix_OpenFlags_O_LARGEFILE
) == Mono_Posix_OpenFlags_O_LARGEFILE
)
3156 #else /* def O_LARGEFILE */
3157 {errno
= EINVAL
; return -1;}
3158 #endif /* ndef O_LARGEFILE */
3159 if ((x
& Mono_Posix_OpenFlags_O_NOCTTY
) == Mono_Posix_OpenFlags_O_NOCTTY
)
3162 #else /* def O_NOCTTY */
3163 {errno
= EINVAL
; return -1;}
3164 #endif /* ndef O_NOCTTY */
3165 if ((x
& Mono_Posix_OpenFlags_O_NOFOLLOW
) == Mono_Posix_OpenFlags_O_NOFOLLOW
)
3168 #else /* def O_NOFOLLOW */
3169 {errno
= EINVAL
; return -1;}
3170 #endif /* ndef O_NOFOLLOW */
3171 if ((x
& Mono_Posix_OpenFlags_O_NONBLOCK
) == Mono_Posix_OpenFlags_O_NONBLOCK
)
3174 #else /* def O_NONBLOCK */
3175 {errno
= EINVAL
; return -1;}
3176 #endif /* ndef O_NONBLOCK */
3177 if ((x
& Mono_Posix_OpenFlags_O_RDONLY
) == Mono_Posix_OpenFlags_O_RDONLY
)
3180 #else /* def O_RDONLY */
3181 {errno
= EINVAL
; return -1;}
3182 #endif /* ndef O_RDONLY */
3183 if ((x
& Mono_Posix_OpenFlags_O_RDWR
) == Mono_Posix_OpenFlags_O_RDWR
)
3186 #else /* def O_RDWR */
3187 {errno
= EINVAL
; return -1;}
3188 #endif /* ndef O_RDWR */
3189 if ((x
& Mono_Posix_OpenFlags_O_SYNC
) == Mono_Posix_OpenFlags_O_SYNC
)
3192 #else /* def O_SYNC */
3193 {errno
= EINVAL
; return -1;}
3194 #endif /* ndef O_SYNC */
3195 if ((x
& Mono_Posix_OpenFlags_O_TRUNC
) == Mono_Posix_OpenFlags_O_TRUNC
)
3198 #else /* def O_TRUNC */
3199 {errno
= EINVAL
; return -1;}
3200 #endif /* ndef O_TRUNC */
3201 if ((x
& Mono_Posix_OpenFlags_O_WRONLY
) == Mono_Posix_OpenFlags_O_WRONLY
)
3204 #else /* def O_WRONLY */
3205 {errno
= EINVAL
; return -1;}
3206 #endif /* ndef O_WRONLY */
3212 int Mono_Posix_ToOpenFlags (int x
, int *r
)
3218 if ((x
& O_APPEND
) == O_APPEND
)
3219 *r
|= Mono_Posix_OpenFlags_O_APPEND
;
3220 #endif /* ndef O_APPEND */
3222 if ((x
& O_ASYNC
) == O_ASYNC
)
3223 *r
|= Mono_Posix_OpenFlags_O_ASYNC
;
3224 #endif /* ndef O_ASYNC */
3226 if ((x
& O_CREAT
) == O_CREAT
)
3227 *r
|= Mono_Posix_OpenFlags_O_CREAT
;
3228 #endif /* ndef O_CREAT */
3230 if ((x
& O_DIRECT
) == O_DIRECT
)
3231 *r
|= Mono_Posix_OpenFlags_O_DIRECT
;
3232 #endif /* ndef O_DIRECT */
3234 if ((x
& O_DIRECTORY
) == O_DIRECTORY
)
3235 *r
|= Mono_Posix_OpenFlags_O_DIRECTORY
;
3236 #endif /* ndef O_DIRECTORY */
3238 if ((x
& O_EXCL
) == O_EXCL
)
3239 *r
|= Mono_Posix_OpenFlags_O_EXCL
;
3240 #endif /* ndef O_EXCL */
3242 if ((x
& O_LARGEFILE
) == O_LARGEFILE
)
3243 *r
|= Mono_Posix_OpenFlags_O_LARGEFILE
;
3244 #endif /* ndef O_LARGEFILE */
3246 if ((x
& O_NOCTTY
) == O_NOCTTY
)
3247 *r
|= Mono_Posix_OpenFlags_O_NOCTTY
;
3248 #endif /* ndef O_NOCTTY */
3250 if ((x
& O_NOFOLLOW
) == O_NOFOLLOW
)
3251 *r
|= Mono_Posix_OpenFlags_O_NOFOLLOW
;
3252 #endif /* ndef O_NOFOLLOW */
3254 if ((x
& O_NONBLOCK
) == O_NONBLOCK
)
3255 *r
|= Mono_Posix_OpenFlags_O_NONBLOCK
;
3256 #endif /* ndef O_NONBLOCK */
3258 if ((x
& O_RDONLY
) == O_RDONLY
)
3259 *r
|= Mono_Posix_OpenFlags_O_RDONLY
;
3260 #endif /* ndef O_RDONLY */
3262 if ((x
& O_RDWR
) == O_RDWR
)
3263 *r
|= Mono_Posix_OpenFlags_O_RDWR
;
3264 #endif /* ndef O_RDWR */
3266 if ((x
& O_SYNC
) == O_SYNC
)
3267 *r
|= Mono_Posix_OpenFlags_O_SYNC
;
3268 #endif /* ndef O_SYNC */
3270 if ((x
& O_TRUNC
) == O_TRUNC
)
3271 *r
|= Mono_Posix_OpenFlags_O_TRUNC
;
3272 #endif /* ndef O_TRUNC */
3274 if ((x
& O_WRONLY
) == O_WRONLY
)
3275 *r
|= Mono_Posix_OpenFlags_O_WRONLY
;
3276 #endif /* ndef O_WRONLY */
3280 int Mono_Posix_FromPathconfName (int x
, int *r
)
3283 if (x
== Mono_Posix_PathconfName__PC_2_SYMLINKS
)
3284 #ifdef _PC_2_SYMLINKS
3285 {*r
= _PC_2_SYMLINKS
; return 0;}
3286 #else /* def _PC_2_SYMLINKS */
3287 {errno
= EINVAL
; return -1;}
3288 #endif /* ndef _PC_2_SYMLINKS */
3289 if (x
== Mono_Posix_PathconfName__PC_ALLOC_SIZE_MIN
)
3290 #ifdef _PC_ALLOC_SIZE_MIN
3291 {*r
= _PC_ALLOC_SIZE_MIN
; return 0;}
3292 #else /* def _PC_ALLOC_SIZE_MIN */
3293 {errno
= EINVAL
; return -1;}
3294 #endif /* ndef _PC_ALLOC_SIZE_MIN */
3295 if (x
== Mono_Posix_PathconfName__PC_ASYNC_IO
)
3297 {*r
= _PC_ASYNC_IO
; return 0;}
3298 #else /* def _PC_ASYNC_IO */
3299 {errno
= EINVAL
; return -1;}
3300 #endif /* ndef _PC_ASYNC_IO */
3301 if (x
== Mono_Posix_PathconfName__PC_CHOWN_RESTRICTED
)
3302 #ifdef _PC_CHOWN_RESTRICTED
3303 {*r
= _PC_CHOWN_RESTRICTED
; return 0;}
3304 #else /* def _PC_CHOWN_RESTRICTED */
3305 {errno
= EINVAL
; return -1;}
3306 #endif /* ndef _PC_CHOWN_RESTRICTED */
3307 if (x
== Mono_Posix_PathconfName__PC_FILESIZEBITS
)
3308 #ifdef _PC_FILESIZEBITS
3309 {*r
= _PC_FILESIZEBITS
; return 0;}
3310 #else /* def _PC_FILESIZEBITS */
3311 {errno
= EINVAL
; return -1;}
3312 #endif /* ndef _PC_FILESIZEBITS */
3313 if (x
== Mono_Posix_PathconfName__PC_LINK_MAX
)
3315 {*r
= _PC_LINK_MAX
; return 0;}
3316 #else /* def _PC_LINK_MAX */
3317 {errno
= EINVAL
; return -1;}
3318 #endif /* ndef _PC_LINK_MAX */
3319 if (x
== Mono_Posix_PathconfName__PC_MAX_CANON
)
3320 #ifdef _PC_MAX_CANON
3321 {*r
= _PC_MAX_CANON
; return 0;}
3322 #else /* def _PC_MAX_CANON */
3323 {errno
= EINVAL
; return -1;}
3324 #endif /* ndef _PC_MAX_CANON */
3325 if (x
== Mono_Posix_PathconfName__PC_MAX_INPUT
)
3326 #ifdef _PC_MAX_INPUT
3327 {*r
= _PC_MAX_INPUT
; return 0;}
3328 #else /* def _PC_MAX_INPUT */
3329 {errno
= EINVAL
; return -1;}
3330 #endif /* ndef _PC_MAX_INPUT */
3331 if (x
== Mono_Posix_PathconfName__PC_NAME_MAX
)
3333 {*r
= _PC_NAME_MAX
; return 0;}
3334 #else /* def _PC_NAME_MAX */
3335 {errno
= EINVAL
; return -1;}
3336 #endif /* ndef _PC_NAME_MAX */
3337 if (x
== Mono_Posix_PathconfName__PC_NO_TRUNC
)
3339 {*r
= _PC_NO_TRUNC
; return 0;}
3340 #else /* def _PC_NO_TRUNC */
3341 {errno
= EINVAL
; return -1;}
3342 #endif /* ndef _PC_NO_TRUNC */
3343 if (x
== Mono_Posix_PathconfName__PC_PATH_MAX
)
3345 {*r
= _PC_PATH_MAX
; return 0;}
3346 #else /* def _PC_PATH_MAX */
3347 {errno
= EINVAL
; return -1;}
3348 #endif /* ndef _PC_PATH_MAX */
3349 if (x
== Mono_Posix_PathconfName__PC_PIPE_BUF
)
3351 {*r
= _PC_PIPE_BUF
; return 0;}
3352 #else /* def _PC_PIPE_BUF */
3353 {errno
= EINVAL
; return -1;}
3354 #endif /* ndef _PC_PIPE_BUF */
3355 if (x
== Mono_Posix_PathconfName__PC_PRIO_IO
)
3357 {*r
= _PC_PRIO_IO
; return 0;}
3358 #else /* def _PC_PRIO_IO */
3359 {errno
= EINVAL
; return -1;}
3360 #endif /* ndef _PC_PRIO_IO */
3361 if (x
== Mono_Posix_PathconfName__PC_REC_INCR_XFER_SIZE
)
3362 #ifdef _PC_REC_INCR_XFER_SIZE
3363 {*r
= _PC_REC_INCR_XFER_SIZE
; return 0;}
3364 #else /* def _PC_REC_INCR_XFER_SIZE */
3365 {errno
= EINVAL
; return -1;}
3366 #endif /* ndef _PC_REC_INCR_XFER_SIZE */
3367 if (x
== Mono_Posix_PathconfName__PC_REC_MAX_XFER_SIZE
)
3368 #ifdef _PC_REC_MAX_XFER_SIZE
3369 {*r
= _PC_REC_MAX_XFER_SIZE
; return 0;}
3370 #else /* def _PC_REC_MAX_XFER_SIZE */
3371 {errno
= EINVAL
; return -1;}
3372 #endif /* ndef _PC_REC_MAX_XFER_SIZE */
3373 if (x
== Mono_Posix_PathconfName__PC_REC_MIN_XFER_SIZE
)
3374 #ifdef _PC_REC_MIN_XFER_SIZE
3375 {*r
= _PC_REC_MIN_XFER_SIZE
; return 0;}
3376 #else /* def _PC_REC_MIN_XFER_SIZE */
3377 {errno
= EINVAL
; return -1;}
3378 #endif /* ndef _PC_REC_MIN_XFER_SIZE */
3379 if (x
== Mono_Posix_PathconfName__PC_REC_XFER_ALIGN
)
3380 #ifdef _PC_REC_XFER_ALIGN
3381 {*r
= _PC_REC_XFER_ALIGN
; return 0;}
3382 #else /* def _PC_REC_XFER_ALIGN */
3383 {errno
= EINVAL
; return -1;}
3384 #endif /* ndef _PC_REC_XFER_ALIGN */
3385 if (x
== Mono_Posix_PathconfName__PC_SOCK_MAXBUF
)
3386 #ifdef _PC_SOCK_MAXBUF
3387 {*r
= _PC_SOCK_MAXBUF
; return 0;}
3388 #else /* def _PC_SOCK_MAXBUF */
3389 {errno
= EINVAL
; return -1;}
3390 #endif /* ndef _PC_SOCK_MAXBUF */
3391 if (x
== Mono_Posix_PathconfName__PC_SYMLINK_MAX
)
3392 #ifdef _PC_SYMLINK_MAX
3393 {*r
= _PC_SYMLINK_MAX
; return 0;}
3394 #else /* def _PC_SYMLINK_MAX */
3395 {errno
= EINVAL
; return -1;}
3396 #endif /* ndef _PC_SYMLINK_MAX */
3397 if (x
== Mono_Posix_PathconfName__PC_SYNC_IO
)
3399 {*r
= _PC_SYNC_IO
; return 0;}
3400 #else /* def _PC_SYNC_IO */
3401 {errno
= EINVAL
; return -1;}
3402 #endif /* ndef _PC_SYNC_IO */
3403 if (x
== Mono_Posix_PathconfName__PC_VDISABLE
)
3405 {*r
= _PC_VDISABLE
; return 0;}
3406 #else /* def _PC_VDISABLE */
3407 {errno
= EINVAL
; return -1;}
3408 #endif /* ndef _PC_VDISABLE */
3411 errno
= EINVAL
; return -1;
3414 int Mono_Posix_ToPathconfName (int x
, int *r
)
3419 #ifdef _PC_2_SYMLINKS
3420 if (x
== _PC_2_SYMLINKS
)
3421 {*r
= Mono_Posix_PathconfName__PC_2_SYMLINKS
; return 0;}
3422 #endif /* ndef _PC_2_SYMLINKS */
3423 #ifdef _PC_ALLOC_SIZE_MIN
3424 if (x
== _PC_ALLOC_SIZE_MIN
)
3425 {*r
= Mono_Posix_PathconfName__PC_ALLOC_SIZE_MIN
; return 0;}
3426 #endif /* ndef _PC_ALLOC_SIZE_MIN */
3428 if (x
== _PC_ASYNC_IO
)
3429 {*r
= Mono_Posix_PathconfName__PC_ASYNC_IO
; return 0;}
3430 #endif /* ndef _PC_ASYNC_IO */
3431 #ifdef _PC_CHOWN_RESTRICTED
3432 if (x
== _PC_CHOWN_RESTRICTED
)
3433 {*r
= Mono_Posix_PathconfName__PC_CHOWN_RESTRICTED
; return 0;}
3434 #endif /* ndef _PC_CHOWN_RESTRICTED */
3435 #ifdef _PC_FILESIZEBITS
3436 if (x
== _PC_FILESIZEBITS
)
3437 {*r
= Mono_Posix_PathconfName__PC_FILESIZEBITS
; return 0;}
3438 #endif /* ndef _PC_FILESIZEBITS */
3440 if (x
== _PC_LINK_MAX
)
3441 {*r
= Mono_Posix_PathconfName__PC_LINK_MAX
; return 0;}
3442 #endif /* ndef _PC_LINK_MAX */
3443 #ifdef _PC_MAX_CANON
3444 if (x
== _PC_MAX_CANON
)
3445 {*r
= Mono_Posix_PathconfName__PC_MAX_CANON
; return 0;}
3446 #endif /* ndef _PC_MAX_CANON */
3447 #ifdef _PC_MAX_INPUT
3448 if (x
== _PC_MAX_INPUT
)
3449 {*r
= Mono_Posix_PathconfName__PC_MAX_INPUT
; return 0;}
3450 #endif /* ndef _PC_MAX_INPUT */
3452 if (x
== _PC_NAME_MAX
)
3453 {*r
= Mono_Posix_PathconfName__PC_NAME_MAX
; return 0;}
3454 #endif /* ndef _PC_NAME_MAX */
3456 if (x
== _PC_NO_TRUNC
)
3457 {*r
= Mono_Posix_PathconfName__PC_NO_TRUNC
; return 0;}
3458 #endif /* ndef _PC_NO_TRUNC */
3460 if (x
== _PC_PATH_MAX
)
3461 {*r
= Mono_Posix_PathconfName__PC_PATH_MAX
; return 0;}
3462 #endif /* ndef _PC_PATH_MAX */
3464 if (x
== _PC_PIPE_BUF
)
3465 {*r
= Mono_Posix_PathconfName__PC_PIPE_BUF
; return 0;}
3466 #endif /* ndef _PC_PIPE_BUF */
3468 if (x
== _PC_PRIO_IO
)
3469 {*r
= Mono_Posix_PathconfName__PC_PRIO_IO
; return 0;}
3470 #endif /* ndef _PC_PRIO_IO */
3471 #ifdef _PC_REC_INCR_XFER_SIZE
3472 if (x
== _PC_REC_INCR_XFER_SIZE
)
3473 {*r
= Mono_Posix_PathconfName__PC_REC_INCR_XFER_SIZE
; return 0;}
3474 #endif /* ndef _PC_REC_INCR_XFER_SIZE */
3475 #ifdef _PC_REC_MAX_XFER_SIZE
3476 if (x
== _PC_REC_MAX_XFER_SIZE
)
3477 {*r
= Mono_Posix_PathconfName__PC_REC_MAX_XFER_SIZE
; return 0;}
3478 #endif /* ndef _PC_REC_MAX_XFER_SIZE */
3479 #ifdef _PC_REC_MIN_XFER_SIZE
3480 if (x
== _PC_REC_MIN_XFER_SIZE
)
3481 {*r
= Mono_Posix_PathconfName__PC_REC_MIN_XFER_SIZE
; return 0;}
3482 #endif /* ndef _PC_REC_MIN_XFER_SIZE */
3483 #ifdef _PC_REC_XFER_ALIGN
3484 if (x
== _PC_REC_XFER_ALIGN
)
3485 {*r
= Mono_Posix_PathconfName__PC_REC_XFER_ALIGN
; return 0;}
3486 #endif /* ndef _PC_REC_XFER_ALIGN */
3487 #ifdef _PC_SOCK_MAXBUF
3488 if (x
== _PC_SOCK_MAXBUF
)
3489 {*r
= Mono_Posix_PathconfName__PC_SOCK_MAXBUF
; return 0;}
3490 #endif /* ndef _PC_SOCK_MAXBUF */
3491 #ifdef _PC_SYMLINK_MAX
3492 if (x
== _PC_SYMLINK_MAX
)
3493 {*r
= Mono_Posix_PathconfName__PC_SYMLINK_MAX
; return 0;}
3494 #endif /* ndef _PC_SYMLINK_MAX */
3496 if (x
== _PC_SYNC_IO
)
3497 {*r
= Mono_Posix_PathconfName__PC_SYNC_IO
; return 0;}
3498 #endif /* ndef _PC_SYNC_IO */
3500 if (x
== _PC_VDISABLE
)
3501 {*r
= Mono_Posix_PathconfName__PC_VDISABLE
; return 0;}
3502 #endif /* ndef _PC_VDISABLE */
3503 errno
= EINVAL
; return -1;
3506 int Mono_Posix_FromPollEvents (short x
, short *r
)
3509 if ((x
& Mono_Posix_PollEvents_POLLERR
) == Mono_Posix_PollEvents_POLLERR
)
3512 #else /* def POLLERR */
3513 {errno
= EINVAL
; return -1;}
3514 #endif /* ndef POLLERR */
3515 if ((x
& Mono_Posix_PollEvents_POLLHUP
) == Mono_Posix_PollEvents_POLLHUP
)
3518 #else /* def POLLHUP */
3519 {errno
= EINVAL
; return -1;}
3520 #endif /* ndef POLLHUP */
3521 if ((x
& Mono_Posix_PollEvents_POLLIN
) == Mono_Posix_PollEvents_POLLIN
)
3524 #else /* def POLLIN */
3525 {errno
= EINVAL
; return -1;}
3526 #endif /* ndef POLLIN */
3527 if ((x
& Mono_Posix_PollEvents_POLLNVAL
) == Mono_Posix_PollEvents_POLLNVAL
)
3530 #else /* def POLLNVAL */
3531 {errno
= EINVAL
; return -1;}
3532 #endif /* ndef POLLNVAL */
3533 if ((x
& Mono_Posix_PollEvents_POLLOUT
) == Mono_Posix_PollEvents_POLLOUT
)
3536 #else /* def POLLOUT */
3537 {errno
= EINVAL
; return -1;}
3538 #endif /* ndef POLLOUT */
3539 if ((x
& Mono_Posix_PollEvents_POLLPRI
) == Mono_Posix_PollEvents_POLLPRI
)
3542 #else /* def POLLPRI */
3543 {errno
= EINVAL
; return -1;}
3544 #endif /* ndef POLLPRI */
3545 if ((x
& Mono_Posix_PollEvents_POLLRDBAND
) == Mono_Posix_PollEvents_POLLRDBAND
)
3548 #else /* def POLLRDBAND */
3549 {errno
= EINVAL
; return -1;}
3550 #endif /* ndef POLLRDBAND */
3551 if ((x
& Mono_Posix_PollEvents_POLLRDNORM
) == Mono_Posix_PollEvents_POLLRDNORM
)
3554 #else /* def POLLRDNORM */
3555 {errno
= EINVAL
; return -1;}
3556 #endif /* ndef POLLRDNORM */
3557 if ((x
& Mono_Posix_PollEvents_POLLWRBAND
) == Mono_Posix_PollEvents_POLLWRBAND
)
3560 #else /* def POLLWRBAND */
3561 {errno
= EINVAL
; return -1;}
3562 #endif /* ndef POLLWRBAND */
3563 if ((x
& Mono_Posix_PollEvents_POLLWRNORM
) == Mono_Posix_PollEvents_POLLWRNORM
)
3566 #else /* def POLLWRNORM */
3567 {errno
= EINVAL
; return -1;}
3568 #endif /* ndef POLLWRNORM */
3574 int Mono_Posix_ToPollEvents (short x
, short *r
)
3580 if ((x
& POLLERR
) == POLLERR
)
3581 *r
|= Mono_Posix_PollEvents_POLLERR
;
3582 #endif /* ndef POLLERR */
3584 if ((x
& POLLHUP
) == POLLHUP
)
3585 *r
|= Mono_Posix_PollEvents_POLLHUP
;
3586 #endif /* ndef POLLHUP */
3588 if ((x
& POLLIN
) == POLLIN
)
3589 *r
|= Mono_Posix_PollEvents_POLLIN
;
3590 #endif /* ndef POLLIN */
3592 if ((x
& POLLNVAL
) == POLLNVAL
)
3593 *r
|= Mono_Posix_PollEvents_POLLNVAL
;
3594 #endif /* ndef POLLNVAL */
3596 if ((x
& POLLOUT
) == POLLOUT
)
3597 *r
|= Mono_Posix_PollEvents_POLLOUT
;
3598 #endif /* ndef POLLOUT */
3600 if ((x
& POLLPRI
) == POLLPRI
)
3601 *r
|= Mono_Posix_PollEvents_POLLPRI
;
3602 #endif /* ndef POLLPRI */
3604 if ((x
& POLLRDBAND
) == POLLRDBAND
)
3605 *r
|= Mono_Posix_PollEvents_POLLRDBAND
;
3606 #endif /* ndef POLLRDBAND */
3608 if ((x
& POLLRDNORM
) == POLLRDNORM
)
3609 *r
|= Mono_Posix_PollEvents_POLLRDNORM
;
3610 #endif /* ndef POLLRDNORM */
3612 if ((x
& POLLWRBAND
) == POLLWRBAND
)
3613 *r
|= Mono_Posix_PollEvents_POLLWRBAND
;
3614 #endif /* ndef POLLWRBAND */
3616 if ((x
& POLLWRNORM
) == POLLWRNORM
)
3617 *r
|= Mono_Posix_PollEvents_POLLWRNORM
;
3618 #endif /* ndef POLLWRNORM */
3622 #ifdef HAVE_STRUCT_POLLFD
3624 Mono_Posix_FromPollfd (struct Mono_Posix_Pollfd
*from
, struct pollfd
*to
)
3626 _cnm_return_val_if_overflow (int, from
->fd
, -1);
3628 memset (to
, 0, sizeof(*to
));
3631 if (Mono_Posix_FromPollEvents (from
->events
, &to
->events
) != 0) {
3634 if (Mono_Posix_FromPollEvents (from
->revents
, &to
->revents
) != 0) {
3640 #endif /* ndef HAVE_STRUCT_POLLFD */
3643 #ifdef HAVE_STRUCT_POLLFD
3645 Mono_Posix_ToPollfd (struct pollfd
*from
, struct Mono_Posix_Pollfd
*to
)
3647 _cnm_return_val_if_overflow (int, from
->fd
, -1);
3649 memset (to
, 0, sizeof(*to
));
3652 if (Mono_Posix_ToPollEvents (from
->events
, &to
->events
) != 0) {
3655 if (Mono_Posix_ToPollEvents (from
->revents
, &to
->revents
) != 0) {
3661 #endif /* ndef HAVE_STRUCT_POLLFD */
3664 int Mono_Posix_FromPosixFadviseAdvice (int x
, int *r
)
3667 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED
)
3668 #ifdef POSIX_FADV_DONTNEED
3669 {*r
= POSIX_FADV_DONTNEED
; return 0;}
3670 #else /* def POSIX_FADV_DONTNEED */
3671 {errno
= EINVAL
; return -1;}
3672 #endif /* ndef POSIX_FADV_DONTNEED */
3673 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE
)
3674 #ifdef POSIX_FADV_NOREUSE
3675 {*r
= POSIX_FADV_NOREUSE
; return 0;}
3676 #else /* def POSIX_FADV_NOREUSE */
3677 {errno
= EINVAL
; return -1;}
3678 #endif /* ndef POSIX_FADV_NOREUSE */
3679 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL
)
3680 #ifdef POSIX_FADV_NORMAL
3681 {*r
= POSIX_FADV_NORMAL
; return 0;}
3682 #else /* def POSIX_FADV_NORMAL */
3683 {errno
= EINVAL
; return -1;}
3684 #endif /* ndef POSIX_FADV_NORMAL */
3685 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM
)
3686 #ifdef POSIX_FADV_RANDOM
3687 {*r
= POSIX_FADV_RANDOM
; return 0;}
3688 #else /* def POSIX_FADV_RANDOM */
3689 {errno
= EINVAL
; return -1;}
3690 #endif /* ndef POSIX_FADV_RANDOM */
3691 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL
)
3692 #ifdef POSIX_FADV_SEQUENTIAL
3693 {*r
= POSIX_FADV_SEQUENTIAL
; return 0;}
3694 #else /* def POSIX_FADV_SEQUENTIAL */
3695 {errno
= EINVAL
; return -1;}
3696 #endif /* ndef POSIX_FADV_SEQUENTIAL */
3697 if (x
== Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED
)
3698 #ifdef POSIX_FADV_WILLNEED
3699 {*r
= POSIX_FADV_WILLNEED
; return 0;}
3700 #else /* def POSIX_FADV_WILLNEED */
3701 {errno
= EINVAL
; return -1;}
3702 #endif /* ndef POSIX_FADV_WILLNEED */
3705 errno
= EINVAL
; return -1;
3708 int Mono_Posix_ToPosixFadviseAdvice (int x
, int *r
)
3713 #ifdef POSIX_FADV_DONTNEED
3714 if (x
== POSIX_FADV_DONTNEED
)
3715 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED
; return 0;}
3716 #endif /* ndef POSIX_FADV_DONTNEED */
3717 #ifdef POSIX_FADV_NOREUSE
3718 if (x
== POSIX_FADV_NOREUSE
)
3719 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE
; return 0;}
3720 #endif /* ndef POSIX_FADV_NOREUSE */
3721 #ifdef POSIX_FADV_NORMAL
3722 if (x
== POSIX_FADV_NORMAL
)
3723 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL
; return 0;}
3724 #endif /* ndef POSIX_FADV_NORMAL */
3725 #ifdef POSIX_FADV_RANDOM
3726 if (x
== POSIX_FADV_RANDOM
)
3727 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM
; return 0;}
3728 #endif /* ndef POSIX_FADV_RANDOM */
3729 #ifdef POSIX_FADV_SEQUENTIAL
3730 if (x
== POSIX_FADV_SEQUENTIAL
)
3731 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL
; return 0;}
3732 #endif /* ndef POSIX_FADV_SEQUENTIAL */
3733 #ifdef POSIX_FADV_WILLNEED
3734 if (x
== POSIX_FADV_WILLNEED
)
3735 {*r
= Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED
; return 0;}
3736 #endif /* ndef POSIX_FADV_WILLNEED */
3737 errno
= EINVAL
; return -1;
3740 int Mono_Posix_FromPosixMadviseAdvice (int x
, int *r
)
3743 if (x
== Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED
)
3744 #ifdef POSIX_MADV_DONTNEED
3745 {*r
= POSIX_MADV_DONTNEED
; return 0;}
3746 #else /* def POSIX_MADV_DONTNEED */
3747 {errno
= EINVAL
; return -1;}
3748 #endif /* ndef POSIX_MADV_DONTNEED */
3749 if (x
== Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL
)
3750 #ifdef POSIX_MADV_NORMAL
3751 {*r
= POSIX_MADV_NORMAL
; return 0;}
3752 #else /* def POSIX_MADV_NORMAL */
3753 {errno
= EINVAL
; return -1;}
3754 #endif /* ndef POSIX_MADV_NORMAL */
3755 if (x
== Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM
)
3756 #ifdef POSIX_MADV_RANDOM
3757 {*r
= POSIX_MADV_RANDOM
; return 0;}
3758 #else /* def POSIX_MADV_RANDOM */
3759 {errno
= EINVAL
; return -1;}
3760 #endif /* ndef POSIX_MADV_RANDOM */
3761 if (x
== Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL
)
3762 #ifdef POSIX_MADV_SEQUENTIAL
3763 {*r
= POSIX_MADV_SEQUENTIAL
; return 0;}
3764 #else /* def POSIX_MADV_SEQUENTIAL */
3765 {errno
= EINVAL
; return -1;}
3766 #endif /* ndef POSIX_MADV_SEQUENTIAL */
3767 if (x
== Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED
)
3768 #ifdef POSIX_MADV_WILLNEED
3769 {*r
= POSIX_MADV_WILLNEED
; return 0;}
3770 #else /* def POSIX_MADV_WILLNEED */
3771 {errno
= EINVAL
; return -1;}
3772 #endif /* ndef POSIX_MADV_WILLNEED */
3775 errno
= EINVAL
; return -1;
3778 int Mono_Posix_ToPosixMadviseAdvice (int x
, int *r
)
3783 #ifdef POSIX_MADV_DONTNEED
3784 if (x
== POSIX_MADV_DONTNEED
)
3785 {*r
= Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED
; return 0;}
3786 #endif /* ndef POSIX_MADV_DONTNEED */
3787 #ifdef POSIX_MADV_NORMAL
3788 if (x
== POSIX_MADV_NORMAL
)
3789 {*r
= Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL
; return 0;}
3790 #endif /* ndef POSIX_MADV_NORMAL */
3791 #ifdef POSIX_MADV_RANDOM
3792 if (x
== POSIX_MADV_RANDOM
)
3793 {*r
= Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM
; return 0;}
3794 #endif /* ndef POSIX_MADV_RANDOM */
3795 #ifdef POSIX_MADV_SEQUENTIAL
3796 if (x
== POSIX_MADV_SEQUENTIAL
)
3797 {*r
= Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL
; return 0;}
3798 #endif /* ndef POSIX_MADV_SEQUENTIAL */
3799 #ifdef POSIX_MADV_WILLNEED
3800 if (x
== POSIX_MADV_WILLNEED
)
3801 {*r
= Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED
; return 0;}
3802 #endif /* ndef POSIX_MADV_WILLNEED */
3803 errno
= EINVAL
; return -1;
3806 int Mono_Posix_FromSeekFlags (short x
, short *r
)
3809 if (x
== Mono_Posix_SeekFlags_L_INCR
)
3811 {*r
= L_INCR
; return 0;}
3812 #else /* def L_INCR */
3813 {errno
= EINVAL
; return -1;}
3814 #endif /* ndef L_INCR */
3815 if (x
== Mono_Posix_SeekFlags_L_SET
)
3817 {*r
= L_SET
; return 0;}
3818 #else /* def L_SET */
3819 {errno
= EINVAL
; return -1;}
3820 #endif /* ndef L_SET */
3821 if (x
== Mono_Posix_SeekFlags_L_XTND
)
3823 {*r
= L_XTND
; return 0;}
3824 #else /* def L_XTND */
3825 {errno
= EINVAL
; return -1;}
3826 #endif /* ndef L_XTND */
3827 if (x
== Mono_Posix_SeekFlags_SEEK_CUR
)
3829 {*r
= SEEK_CUR
; return 0;}
3830 #else /* def SEEK_CUR */
3831 {errno
= EINVAL
; return -1;}
3832 #endif /* ndef SEEK_CUR */
3833 if (x
== Mono_Posix_SeekFlags_SEEK_END
)
3835 {*r
= SEEK_END
; return 0;}
3836 #else /* def SEEK_END */
3837 {errno
= EINVAL
; return -1;}
3838 #endif /* ndef SEEK_END */
3839 if (x
== Mono_Posix_SeekFlags_SEEK_SET
)
3841 {*r
= SEEK_SET
; return 0;}
3842 #else /* def SEEK_SET */
3843 {errno
= EINVAL
; return -1;}
3844 #endif /* ndef SEEK_SET */
3847 errno
= EINVAL
; return -1;
3850 int Mono_Posix_ToSeekFlags (short x
, short *r
)
3857 {*r
= Mono_Posix_SeekFlags_L_INCR
; return 0;}
3858 #endif /* ndef L_INCR */
3861 {*r
= Mono_Posix_SeekFlags_L_SET
; return 0;}
3862 #endif /* ndef L_SET */
3865 {*r
= Mono_Posix_SeekFlags_L_XTND
; return 0;}
3866 #endif /* ndef L_XTND */
3869 {*r
= Mono_Posix_SeekFlags_SEEK_CUR
; return 0;}
3870 #endif /* ndef SEEK_CUR */
3873 {*r
= Mono_Posix_SeekFlags_SEEK_END
; return 0;}
3874 #endif /* ndef SEEK_END */
3877 {*r
= Mono_Posix_SeekFlags_SEEK_SET
; return 0;}
3878 #endif /* ndef SEEK_SET */
3879 errno
= EINVAL
; return -1;
3882 int Mono_Posix_FromSignum (int x
, int *r
)
3885 if (x
== Mono_Posix_Signum_SIGABRT
)
3887 {*r
= SIGABRT
; return 0;}
3888 #else /* def SIGABRT */
3889 {errno
= EINVAL
; return -1;}
3890 #endif /* ndef SIGABRT */
3891 if (x
== Mono_Posix_Signum_SIGALRM
)
3893 {*r
= SIGALRM
; return 0;}
3894 #else /* def SIGALRM */
3895 {errno
= EINVAL
; return -1;}
3896 #endif /* ndef SIGALRM */
3897 if (x
== Mono_Posix_Signum_SIGBUS
)
3899 {*r
= SIGBUS
; return 0;}
3900 #else /* def SIGBUS */
3901 {errno
= EINVAL
; return -1;}
3902 #endif /* ndef SIGBUS */
3903 if (x
== Mono_Posix_Signum_SIGCHLD
)
3905 {*r
= SIGCHLD
; return 0;}
3906 #else /* def SIGCHLD */
3907 {errno
= EINVAL
; return -1;}
3908 #endif /* ndef SIGCHLD */
3909 if (x
== Mono_Posix_Signum_SIGCLD
)
3911 {*r
= SIGCLD
; return 0;}
3912 #else /* def SIGCLD */
3913 {errno
= EINVAL
; return -1;}
3914 #endif /* ndef SIGCLD */
3915 if (x
== Mono_Posix_Signum_SIGCONT
)
3917 {*r
= SIGCONT
; return 0;}
3918 #else /* def SIGCONT */
3919 {errno
= EINVAL
; return -1;}
3920 #endif /* ndef SIGCONT */
3921 if (x
== Mono_Posix_Signum_SIGFPE
)
3923 {*r
= SIGFPE
; return 0;}
3924 #else /* def SIGFPE */
3925 {errno
= EINVAL
; return -1;}
3926 #endif /* ndef SIGFPE */
3927 if (x
== Mono_Posix_Signum_SIGHUP
)
3929 {*r
= SIGHUP
; return 0;}
3930 #else /* def SIGHUP */
3931 {errno
= EINVAL
; return -1;}
3932 #endif /* ndef SIGHUP */
3933 if (x
== Mono_Posix_Signum_SIGILL
)
3935 {*r
= SIGILL
; return 0;}
3936 #else /* def SIGILL */
3937 {errno
= EINVAL
; return -1;}
3938 #endif /* ndef SIGILL */
3939 if (x
== Mono_Posix_Signum_SIGINT
)
3941 {*r
= SIGINT
; return 0;}
3942 #else /* def SIGINT */
3943 {errno
= EINVAL
; return -1;}
3944 #endif /* ndef SIGINT */
3945 if (x
== Mono_Posix_Signum_SIGIO
)
3947 {*r
= SIGIO
; return 0;}
3948 #else /* def SIGIO */
3949 {errno
= EINVAL
; return -1;}
3950 #endif /* ndef SIGIO */
3951 if (x
== Mono_Posix_Signum_SIGIOT
)
3953 {*r
= SIGIOT
; return 0;}
3954 #else /* def SIGIOT */
3955 {errno
= EINVAL
; return -1;}
3956 #endif /* ndef SIGIOT */
3957 if (x
== Mono_Posix_Signum_SIGKILL
)
3959 {*r
= SIGKILL
; return 0;}
3960 #else /* def SIGKILL */
3961 {errno
= EINVAL
; return -1;}
3962 #endif /* ndef SIGKILL */
3963 if (x
== Mono_Posix_Signum_SIGPIPE
)
3965 {*r
= SIGPIPE
; return 0;}
3966 #else /* def SIGPIPE */
3967 {errno
= EINVAL
; return -1;}
3968 #endif /* ndef SIGPIPE */
3969 if (x
== Mono_Posix_Signum_SIGPOLL
)
3971 {*r
= SIGPOLL
; return 0;}
3972 #else /* def SIGPOLL */
3973 {errno
= EINVAL
; return -1;}
3974 #endif /* ndef SIGPOLL */
3975 if (x
== Mono_Posix_Signum_SIGPROF
)
3977 {*r
= SIGPROF
; return 0;}
3978 #else /* def SIGPROF */
3979 {errno
= EINVAL
; return -1;}
3980 #endif /* ndef SIGPROF */
3981 if (x
== Mono_Posix_Signum_SIGPWR
)
3983 {*r
= SIGPWR
; return 0;}
3984 #else /* def SIGPWR */
3985 {errno
= EINVAL
; return -1;}
3986 #endif /* ndef SIGPWR */
3987 if (x
== Mono_Posix_Signum_SIGQUIT
)
3989 {*r
= SIGQUIT
; return 0;}
3990 #else /* def SIGQUIT */
3991 {errno
= EINVAL
; return -1;}
3992 #endif /* ndef SIGQUIT */
3993 if (x
== Mono_Posix_Signum_SIGSEGV
)
3995 {*r
= SIGSEGV
; return 0;}
3996 #else /* def SIGSEGV */
3997 {errno
= EINVAL
; return -1;}
3998 #endif /* ndef SIGSEGV */
3999 if (x
== Mono_Posix_Signum_SIGSTKFLT
)
4001 {*r
= SIGSTKFLT
; return 0;}
4002 #else /* def SIGSTKFLT */
4003 {errno
= EINVAL
; return -1;}
4004 #endif /* ndef SIGSTKFLT */
4005 if (x
== Mono_Posix_Signum_SIGSTOP
)
4007 {*r
= SIGSTOP
; return 0;}
4008 #else /* def SIGSTOP */
4009 {errno
= EINVAL
; return -1;}
4010 #endif /* ndef SIGSTOP */
4011 if (x
== Mono_Posix_Signum_SIGSYS
)
4013 {*r
= SIGSYS
; return 0;}
4014 #else /* def SIGSYS */
4015 {errno
= EINVAL
; return -1;}
4016 #endif /* ndef SIGSYS */
4017 if (x
== Mono_Posix_Signum_SIGTERM
)
4019 {*r
= SIGTERM
; return 0;}
4020 #else /* def SIGTERM */
4021 {errno
= EINVAL
; return -1;}
4022 #endif /* ndef SIGTERM */
4023 if (x
== Mono_Posix_Signum_SIGTRAP
)
4025 {*r
= SIGTRAP
; return 0;}
4026 #else /* def SIGTRAP */
4027 {errno
= EINVAL
; return -1;}
4028 #endif /* ndef SIGTRAP */
4029 if (x
== Mono_Posix_Signum_SIGTSTP
)
4031 {*r
= SIGTSTP
; return 0;}
4032 #else /* def SIGTSTP */
4033 {errno
= EINVAL
; return -1;}
4034 #endif /* ndef SIGTSTP */
4035 if (x
== Mono_Posix_Signum_SIGTTIN
)
4037 {*r
= SIGTTIN
; return 0;}
4038 #else /* def SIGTTIN */
4039 {errno
= EINVAL
; return -1;}
4040 #endif /* ndef SIGTTIN */
4041 if (x
== Mono_Posix_Signum_SIGTTOU
)
4043 {*r
= SIGTTOU
; return 0;}
4044 #else /* def SIGTTOU */
4045 {errno
= EINVAL
; return -1;}
4046 #endif /* ndef SIGTTOU */
4047 if (x
== Mono_Posix_Signum_SIGUNUSED
)
4049 {*r
= SIGUNUSED
; return 0;}
4050 #else /* def SIGUNUSED */
4051 {errno
= EINVAL
; return -1;}
4052 #endif /* ndef SIGUNUSED */
4053 if (x
== Mono_Posix_Signum_SIGURG
)
4055 {*r
= SIGURG
; return 0;}
4056 #else /* def SIGURG */
4057 {errno
= EINVAL
; return -1;}
4058 #endif /* ndef SIGURG */
4059 if (x
== Mono_Posix_Signum_SIGUSR1
)
4061 {*r
= SIGUSR1
; return 0;}
4062 #else /* def SIGUSR1 */
4063 {errno
= EINVAL
; return -1;}
4064 #endif /* ndef SIGUSR1 */
4065 if (x
== Mono_Posix_Signum_SIGUSR2
)
4067 {*r
= SIGUSR2
; return 0;}
4068 #else /* def SIGUSR2 */
4069 {errno
= EINVAL
; return -1;}
4070 #endif /* ndef SIGUSR2 */
4071 if (x
== Mono_Posix_Signum_SIGVTALRM
)
4073 {*r
= SIGVTALRM
; return 0;}
4074 #else /* def SIGVTALRM */
4075 {errno
= EINVAL
; return -1;}
4076 #endif /* ndef SIGVTALRM */
4077 if (x
== Mono_Posix_Signum_SIGWINCH
)
4079 {*r
= SIGWINCH
; return 0;}
4080 #else /* def SIGWINCH */
4081 {errno
= EINVAL
; return -1;}
4082 #endif /* ndef SIGWINCH */
4083 if (x
== Mono_Posix_Signum_SIGXCPU
)
4085 {*r
= SIGXCPU
; return 0;}
4086 #else /* def SIGXCPU */
4087 {errno
= EINVAL
; return -1;}
4088 #endif /* ndef SIGXCPU */
4089 if (x
== Mono_Posix_Signum_SIGXFSZ
)
4091 {*r
= SIGXFSZ
; return 0;}
4092 #else /* def SIGXFSZ */
4093 {errno
= EINVAL
; return -1;}
4094 #endif /* ndef SIGXFSZ */
4097 errno
= EINVAL
; return -1;
4100 int Mono_Posix_ToSignum (int x
, int *r
)
4107 {*r
= Mono_Posix_Signum_SIGABRT
; return 0;}
4108 #endif /* ndef SIGABRT */
4111 {*r
= Mono_Posix_Signum_SIGALRM
; return 0;}
4112 #endif /* ndef SIGALRM */
4115 {*r
= Mono_Posix_Signum_SIGBUS
; return 0;}
4116 #endif /* ndef SIGBUS */
4119 {*r
= Mono_Posix_Signum_SIGCHLD
; return 0;}
4120 #endif /* ndef SIGCHLD */
4123 {*r
= Mono_Posix_Signum_SIGCLD
; return 0;}
4124 #endif /* ndef SIGCLD */
4127 {*r
= Mono_Posix_Signum_SIGCONT
; return 0;}
4128 #endif /* ndef SIGCONT */
4131 {*r
= Mono_Posix_Signum_SIGFPE
; return 0;}
4132 #endif /* ndef SIGFPE */
4135 {*r
= Mono_Posix_Signum_SIGHUP
; return 0;}
4136 #endif /* ndef SIGHUP */
4139 {*r
= Mono_Posix_Signum_SIGILL
; return 0;}
4140 #endif /* ndef SIGILL */
4143 {*r
= Mono_Posix_Signum_SIGINT
; return 0;}
4144 #endif /* ndef SIGINT */
4147 {*r
= Mono_Posix_Signum_SIGIO
; return 0;}
4148 #endif /* ndef SIGIO */
4151 {*r
= Mono_Posix_Signum_SIGIOT
; return 0;}
4152 #endif /* ndef SIGIOT */
4155 {*r
= Mono_Posix_Signum_SIGKILL
; return 0;}
4156 #endif /* ndef SIGKILL */
4159 {*r
= Mono_Posix_Signum_SIGPIPE
; return 0;}
4160 #endif /* ndef SIGPIPE */
4163 {*r
= Mono_Posix_Signum_SIGPOLL
; return 0;}
4164 #endif /* ndef SIGPOLL */
4167 {*r
= Mono_Posix_Signum_SIGPROF
; return 0;}
4168 #endif /* ndef SIGPROF */
4171 {*r
= Mono_Posix_Signum_SIGPWR
; return 0;}
4172 #endif /* ndef SIGPWR */
4175 {*r
= Mono_Posix_Signum_SIGQUIT
; return 0;}
4176 #endif /* ndef SIGQUIT */
4179 {*r
= Mono_Posix_Signum_SIGSEGV
; return 0;}
4180 #endif /* ndef SIGSEGV */
4183 {*r
= Mono_Posix_Signum_SIGSTKFLT
; return 0;}
4184 #endif /* ndef SIGSTKFLT */
4187 {*r
= Mono_Posix_Signum_SIGSTOP
; return 0;}
4188 #endif /* ndef SIGSTOP */
4191 {*r
= Mono_Posix_Signum_SIGSYS
; return 0;}
4192 #endif /* ndef SIGSYS */
4195 {*r
= Mono_Posix_Signum_SIGTERM
; return 0;}
4196 #endif /* ndef SIGTERM */
4199 {*r
= Mono_Posix_Signum_SIGTRAP
; return 0;}
4200 #endif /* ndef SIGTRAP */
4203 {*r
= Mono_Posix_Signum_SIGTSTP
; return 0;}
4204 #endif /* ndef SIGTSTP */
4207 {*r
= Mono_Posix_Signum_SIGTTIN
; return 0;}
4208 #endif /* ndef SIGTTIN */
4211 {*r
= Mono_Posix_Signum_SIGTTOU
; return 0;}
4212 #endif /* ndef SIGTTOU */
4215 {*r
= Mono_Posix_Signum_SIGUNUSED
; return 0;}
4216 #endif /* ndef SIGUNUSED */
4219 {*r
= Mono_Posix_Signum_SIGURG
; return 0;}
4220 #endif /* ndef SIGURG */
4223 {*r
= Mono_Posix_Signum_SIGUSR1
; return 0;}
4224 #endif /* ndef SIGUSR1 */
4227 {*r
= Mono_Posix_Signum_SIGUSR2
; return 0;}
4228 #endif /* ndef SIGUSR2 */
4231 {*r
= Mono_Posix_Signum_SIGVTALRM
; return 0;}
4232 #endif /* ndef SIGVTALRM */
4235 {*r
= Mono_Posix_Signum_SIGWINCH
; return 0;}
4236 #endif /* ndef SIGWINCH */
4239 {*r
= Mono_Posix_Signum_SIGXCPU
; return 0;}
4240 #endif /* ndef SIGXCPU */
4243 {*r
= Mono_Posix_Signum_SIGXFSZ
; return 0;}
4244 #endif /* ndef SIGXFSZ */
4245 errno
= EINVAL
; return -1;
4248 #ifdef HAVE_STRUCT_STAT
4250 Mono_Posix_FromStat (struct Mono_Posix_Stat
*from
, struct stat
*to
)
4252 _cnm_return_val_if_overflow (dev_t
, from
->st_dev
, -1);
4253 _cnm_return_val_if_overflow (ino_t
, from
->st_ino
, -1);
4254 _cnm_return_val_if_overflow (nlink_t
, from
->st_nlink
, -1);
4255 _cnm_return_val_if_overflow (uid_t
, from
->st_uid
, -1);
4256 _cnm_return_val_if_overflow (gid_t
, from
->st_gid
, -1);
4257 _cnm_return_val_if_overflow (dev_t
, from
->st_rdev
, -1);
4258 _cnm_return_val_if_overflow (off_t
, from
->st_size
, -1);
4259 _cnm_return_val_if_overflow (blksize_t
, from
->st_blksize
, -1);
4260 _cnm_return_val_if_overflow (blkcnt_t
, from
->st_blocks
, -1);
4261 _cnm_return_val_if_overflow (time_t, from
->st_atime_
, -1);
4262 _cnm_return_val_if_overflow (time_t, from
->st_mtime_
, -1);
4263 _cnm_return_val_if_overflow (time_t, from
->st_ctime_
, -1);
4265 memset (to
, 0, sizeof(*to
));
4267 to
->st_dev
= from
->st_dev
;
4268 to
->st_ino
= from
->st_ino
;
4269 if (Mono_Posix_FromFilePermissions (from
->st_mode
, &to
->st_mode
) != 0) {
4272 to
->st_nlink
= from
->st_nlink
;
4273 to
->st_uid
= from
->st_uid
;
4274 to
->st_gid
= from
->st_gid
;
4275 to
->st_rdev
= from
->st_rdev
;
4276 to
->st_size
= from
->st_size
;
4277 to
->st_blksize
= from
->st_blksize
;
4278 to
->st_blocks
= from
->st_blocks
;
4279 to
->st_atime
= from
->st_atime_
;
4280 to
->st_mtime
= from
->st_mtime_
;
4281 to
->st_ctime
= from
->st_ctime_
;
4285 #endif /* ndef HAVE_STRUCT_STAT */
4288 #ifdef HAVE_STRUCT_STAT
4290 Mono_Posix_ToStat (struct stat
*from
, struct Mono_Posix_Stat
*to
)
4292 _cnm_return_val_if_overflow (guint64
, from
->st_dev
, -1);
4293 _cnm_return_val_if_overflow (guint64
, from
->st_ino
, -1);
4294 _cnm_return_val_if_overflow (guint64
, from
->st_nlink
, -1);
4295 _cnm_return_val_if_overflow (unsigned int, from
->st_uid
, -1);
4296 _cnm_return_val_if_overflow (unsigned int, from
->st_gid
, -1);
4297 _cnm_return_val_if_overflow (guint64
, from
->st_rdev
, -1);
4298 _cnm_return_val_if_overflow (gint64
, from
->st_size
, -1);
4299 _cnm_return_val_if_overflow (gint64
, from
->st_blksize
, -1);
4300 _cnm_return_val_if_overflow (gint64
, from
->st_blocks
, -1);
4301 _cnm_return_val_if_overflow (gint64
, from
->st_atime
, -1);
4302 _cnm_return_val_if_overflow (gint64
, from
->st_mtime
, -1);
4303 _cnm_return_val_if_overflow (gint64
, from
->st_ctime
, -1);
4305 memset (to
, 0, sizeof(*to
));
4307 to
->st_dev
= from
->st_dev
;
4308 to
->st_ino
= from
->st_ino
;
4309 if (Mono_Posix_ToFilePermissions (from
->st_mode
, &to
->st_mode
) != 0) {
4312 to
->st_nlink
= from
->st_nlink
;
4313 to
->st_uid
= from
->st_uid
;
4314 to
->st_gid
= from
->st_gid
;
4315 to
->st_rdev
= from
->st_rdev
;
4316 to
->st_size
= from
->st_size
;
4317 to
->st_blksize
= from
->st_blksize
;
4318 to
->st_blocks
= from
->st_blocks
;
4319 to
->st_atime_
= from
->st_atime
;
4320 to
->st_mtime_
= from
->st_mtime
;
4321 to
->st_ctime_
= from
->st_ctime
;
4325 #endif /* ndef HAVE_STRUCT_STAT */
4328 int Mono_Posix_FromSysconfName (int x
, int *r
)
4331 if (x
== Mono_Posix_SysconfName__SC_2_CHAR_TERM
)
4332 #ifdef _SC_2_CHAR_TERM
4333 {*r
= _SC_2_CHAR_TERM
; return 0;}
4334 #else /* def _SC_2_CHAR_TERM */
4335 {errno
= EINVAL
; return -1;}
4336 #endif /* ndef _SC_2_CHAR_TERM */
4337 if (x
== Mono_Posix_SysconfName__SC_2_C_BIND
)
4339 {*r
= _SC_2_C_BIND
; return 0;}
4340 #else /* def _SC_2_C_BIND */
4341 {errno
= EINVAL
; return -1;}
4342 #endif /* ndef _SC_2_C_BIND */
4343 if (x
== Mono_Posix_SysconfName__SC_2_C_DEV
)
4345 {*r
= _SC_2_C_DEV
; return 0;}
4346 #else /* def _SC_2_C_DEV */
4347 {errno
= EINVAL
; return -1;}
4348 #endif /* ndef _SC_2_C_DEV */
4349 if (x
== Mono_Posix_SysconfName__SC_2_C_VERSION
)
4350 #ifdef _SC_2_C_VERSION
4351 {*r
= _SC_2_C_VERSION
; return 0;}
4352 #else /* def _SC_2_C_VERSION */
4353 {errno
= EINVAL
; return -1;}
4354 #endif /* ndef _SC_2_C_VERSION */
4355 if (x
== Mono_Posix_SysconfName__SC_2_FORT_DEV
)
4356 #ifdef _SC_2_FORT_DEV
4357 {*r
= _SC_2_FORT_DEV
; return 0;}
4358 #else /* def _SC_2_FORT_DEV */
4359 {errno
= EINVAL
; return -1;}
4360 #endif /* ndef _SC_2_FORT_DEV */
4361 if (x
== Mono_Posix_SysconfName__SC_2_FORT_RUN
)
4362 #ifdef _SC_2_FORT_RUN
4363 {*r
= _SC_2_FORT_RUN
; return 0;}
4364 #else /* def _SC_2_FORT_RUN */
4365 {errno
= EINVAL
; return -1;}
4366 #endif /* ndef _SC_2_FORT_RUN */
4367 if (x
== Mono_Posix_SysconfName__SC_2_LOCALEDEF
)
4368 #ifdef _SC_2_LOCALEDEF
4369 {*r
= _SC_2_LOCALEDEF
; return 0;}
4370 #else /* def _SC_2_LOCALEDEF */
4371 {errno
= EINVAL
; return -1;}
4372 #endif /* ndef _SC_2_LOCALEDEF */
4373 if (x
== Mono_Posix_SysconfName__SC_2_PBS
)
4375 {*r
= _SC_2_PBS
; return 0;}
4376 #else /* def _SC_2_PBS */
4377 {errno
= EINVAL
; return -1;}
4378 #endif /* ndef _SC_2_PBS */
4379 if (x
== Mono_Posix_SysconfName__SC_2_PBS_ACCOUNTING
)
4380 #ifdef _SC_2_PBS_ACCOUNTING
4381 {*r
= _SC_2_PBS_ACCOUNTING
; return 0;}
4382 #else /* def _SC_2_PBS_ACCOUNTING */
4383 {errno
= EINVAL
; return -1;}
4384 #endif /* ndef _SC_2_PBS_ACCOUNTING */
4385 if (x
== Mono_Posix_SysconfName__SC_2_PBS_CHECKPOINT
)
4386 #ifdef _SC_2_PBS_CHECKPOINT
4387 {*r
= _SC_2_PBS_CHECKPOINT
; return 0;}
4388 #else /* def _SC_2_PBS_CHECKPOINT */
4389 {errno
= EINVAL
; return -1;}
4390 #endif /* ndef _SC_2_PBS_CHECKPOINT */
4391 if (x
== Mono_Posix_SysconfName__SC_2_PBS_LOCATE
)
4392 #ifdef _SC_2_PBS_LOCATE
4393 {*r
= _SC_2_PBS_LOCATE
; return 0;}
4394 #else /* def _SC_2_PBS_LOCATE */
4395 {errno
= EINVAL
; return -1;}
4396 #endif /* ndef _SC_2_PBS_LOCATE */
4397 if (x
== Mono_Posix_SysconfName__SC_2_PBS_MESSAGE
)
4398 #ifdef _SC_2_PBS_MESSAGE
4399 {*r
= _SC_2_PBS_MESSAGE
; return 0;}
4400 #else /* def _SC_2_PBS_MESSAGE */
4401 {errno
= EINVAL
; return -1;}
4402 #endif /* ndef _SC_2_PBS_MESSAGE */
4403 if (x
== Mono_Posix_SysconfName__SC_2_PBS_TRACK
)
4404 #ifdef _SC_2_PBS_TRACK
4405 {*r
= _SC_2_PBS_TRACK
; return 0;}
4406 #else /* def _SC_2_PBS_TRACK */
4407 {errno
= EINVAL
; return -1;}
4408 #endif /* ndef _SC_2_PBS_TRACK */
4409 if (x
== Mono_Posix_SysconfName__SC_2_SW_DEV
)
4411 {*r
= _SC_2_SW_DEV
; return 0;}
4412 #else /* def _SC_2_SW_DEV */
4413 {errno
= EINVAL
; return -1;}
4414 #endif /* ndef _SC_2_SW_DEV */
4415 if (x
== Mono_Posix_SysconfName__SC_2_UPE
)
4417 {*r
= _SC_2_UPE
; return 0;}
4418 #else /* def _SC_2_UPE */
4419 {errno
= EINVAL
; return -1;}
4420 #endif /* ndef _SC_2_UPE */
4421 if (x
== Mono_Posix_SysconfName__SC_2_VERSION
)
4422 #ifdef _SC_2_VERSION
4423 {*r
= _SC_2_VERSION
; return 0;}
4424 #else /* def _SC_2_VERSION */
4425 {errno
= EINVAL
; return -1;}
4426 #endif /* ndef _SC_2_VERSION */
4427 if (x
== Mono_Posix_SysconfName__SC_ADVISORY_INFO
)
4428 #ifdef _SC_ADVISORY_INFO
4429 {*r
= _SC_ADVISORY_INFO
; return 0;}
4430 #else /* def _SC_ADVISORY_INFO */
4431 {errno
= EINVAL
; return -1;}
4432 #endif /* ndef _SC_ADVISORY_INFO */
4433 if (x
== Mono_Posix_SysconfName__SC_AIO_LISTIO_MAX
)
4434 #ifdef _SC_AIO_LISTIO_MAX
4435 {*r
= _SC_AIO_LISTIO_MAX
; return 0;}
4436 #else /* def _SC_AIO_LISTIO_MAX */
4437 {errno
= EINVAL
; return -1;}
4438 #endif /* ndef _SC_AIO_LISTIO_MAX */
4439 if (x
== Mono_Posix_SysconfName__SC_AIO_MAX
)
4441 {*r
= _SC_AIO_MAX
; return 0;}
4442 #else /* def _SC_AIO_MAX */
4443 {errno
= EINVAL
; return -1;}
4444 #endif /* ndef _SC_AIO_MAX */
4445 if (x
== Mono_Posix_SysconfName__SC_AIO_PRIO_DELTA_MAX
)
4446 #ifdef _SC_AIO_PRIO_DELTA_MAX
4447 {*r
= _SC_AIO_PRIO_DELTA_MAX
; return 0;}
4448 #else /* def _SC_AIO_PRIO_DELTA_MAX */
4449 {errno
= EINVAL
; return -1;}
4450 #endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
4451 if (x
== Mono_Posix_SysconfName__SC_ARG_MAX
)
4453 {*r
= _SC_ARG_MAX
; return 0;}
4454 #else /* def _SC_ARG_MAX */
4455 {errno
= EINVAL
; return -1;}
4456 #endif /* ndef _SC_ARG_MAX */
4457 if (x
== Mono_Posix_SysconfName__SC_ASYNCHRONOUS_IO
)
4458 #ifdef _SC_ASYNCHRONOUS_IO
4459 {*r
= _SC_ASYNCHRONOUS_IO
; return 0;}
4460 #else /* def _SC_ASYNCHRONOUS_IO */
4461 {errno
= EINVAL
; return -1;}
4462 #endif /* ndef _SC_ASYNCHRONOUS_IO */
4463 if (x
== Mono_Posix_SysconfName__SC_ATEXIT_MAX
)
4464 #ifdef _SC_ATEXIT_MAX
4465 {*r
= _SC_ATEXIT_MAX
; return 0;}
4466 #else /* def _SC_ATEXIT_MAX */
4467 {errno
= EINVAL
; return -1;}
4468 #endif /* ndef _SC_ATEXIT_MAX */
4469 if (x
== Mono_Posix_SysconfName__SC_AVPHYS_PAGES
)
4470 #ifdef _SC_AVPHYS_PAGES
4471 {*r
= _SC_AVPHYS_PAGES
; return 0;}
4472 #else /* def _SC_AVPHYS_PAGES */
4473 {errno
= EINVAL
; return -1;}
4474 #endif /* ndef _SC_AVPHYS_PAGES */
4475 if (x
== Mono_Posix_SysconfName__SC_BARRIERS
)
4477 {*r
= _SC_BARRIERS
; return 0;}
4478 #else /* def _SC_BARRIERS */
4479 {errno
= EINVAL
; return -1;}
4480 #endif /* ndef _SC_BARRIERS */
4481 if (x
== Mono_Posix_SysconfName__SC_BASE
)
4483 {*r
= _SC_BASE
; return 0;}
4484 #else /* def _SC_BASE */
4485 {errno
= EINVAL
; return -1;}
4486 #endif /* ndef _SC_BASE */
4487 if (x
== Mono_Posix_SysconfName__SC_BC_BASE_MAX
)
4488 #ifdef _SC_BC_BASE_MAX
4489 {*r
= _SC_BC_BASE_MAX
; return 0;}
4490 #else /* def _SC_BC_BASE_MAX */
4491 {errno
= EINVAL
; return -1;}
4492 #endif /* ndef _SC_BC_BASE_MAX */
4493 if (x
== Mono_Posix_SysconfName__SC_BC_DIM_MAX
)
4494 #ifdef _SC_BC_DIM_MAX
4495 {*r
= _SC_BC_DIM_MAX
; return 0;}
4496 #else /* def _SC_BC_DIM_MAX */
4497 {errno
= EINVAL
; return -1;}
4498 #endif /* ndef _SC_BC_DIM_MAX */
4499 if (x
== Mono_Posix_SysconfName__SC_BC_SCALE_MAX
)
4500 #ifdef _SC_BC_SCALE_MAX
4501 {*r
= _SC_BC_SCALE_MAX
; return 0;}
4502 #else /* def _SC_BC_SCALE_MAX */
4503 {errno
= EINVAL
; return -1;}
4504 #endif /* ndef _SC_BC_SCALE_MAX */
4505 if (x
== Mono_Posix_SysconfName__SC_BC_STRING_MAX
)
4506 #ifdef _SC_BC_STRING_MAX
4507 {*r
= _SC_BC_STRING_MAX
; return 0;}
4508 #else /* def _SC_BC_STRING_MAX */
4509 {errno
= EINVAL
; return -1;}
4510 #endif /* ndef _SC_BC_STRING_MAX */
4511 if (x
== Mono_Posix_SysconfName__SC_CHARCLASS_NAME_MAX
)
4512 #ifdef _SC_CHARCLASS_NAME_MAX
4513 {*r
= _SC_CHARCLASS_NAME_MAX
; return 0;}
4514 #else /* def _SC_CHARCLASS_NAME_MAX */
4515 {errno
= EINVAL
; return -1;}
4516 #endif /* ndef _SC_CHARCLASS_NAME_MAX */
4517 if (x
== Mono_Posix_SysconfName__SC_CHAR_BIT
)
4519 {*r
= _SC_CHAR_BIT
; return 0;}
4520 #else /* def _SC_CHAR_BIT */
4521 {errno
= EINVAL
; return -1;}
4522 #endif /* ndef _SC_CHAR_BIT */
4523 if (x
== Mono_Posix_SysconfName__SC_CHAR_MAX
)
4525 {*r
= _SC_CHAR_MAX
; return 0;}
4526 #else /* def _SC_CHAR_MAX */
4527 {errno
= EINVAL
; return -1;}
4528 #endif /* ndef _SC_CHAR_MAX */
4529 if (x
== Mono_Posix_SysconfName__SC_CHAR_MIN
)
4531 {*r
= _SC_CHAR_MIN
; return 0;}
4532 #else /* def _SC_CHAR_MIN */
4533 {errno
= EINVAL
; return -1;}
4534 #endif /* ndef _SC_CHAR_MIN */
4535 if (x
== Mono_Posix_SysconfName__SC_CHILD_MAX
)
4536 #ifdef _SC_CHILD_MAX
4537 {*r
= _SC_CHILD_MAX
; return 0;}
4538 #else /* def _SC_CHILD_MAX */
4539 {errno
= EINVAL
; return -1;}
4540 #endif /* ndef _SC_CHILD_MAX */
4541 if (x
== Mono_Posix_SysconfName__SC_CLK_TCK
)
4543 {*r
= _SC_CLK_TCK
; return 0;}
4544 #else /* def _SC_CLK_TCK */
4545 {errno
= EINVAL
; return -1;}
4546 #endif /* ndef _SC_CLK_TCK */
4547 if (x
== Mono_Posix_SysconfName__SC_CLOCK_SELECTION
)
4548 #ifdef _SC_CLOCK_SELECTION
4549 {*r
= _SC_CLOCK_SELECTION
; return 0;}
4550 #else /* def _SC_CLOCK_SELECTION */
4551 {errno
= EINVAL
; return -1;}
4552 #endif /* ndef _SC_CLOCK_SELECTION */
4553 if (x
== Mono_Posix_SysconfName__SC_COLL_WEIGHTS_MAX
)
4554 #ifdef _SC_COLL_WEIGHTS_MAX
4555 {*r
= _SC_COLL_WEIGHTS_MAX
; return 0;}
4556 #else /* def _SC_COLL_WEIGHTS_MAX */
4557 {errno
= EINVAL
; return -1;}
4558 #endif /* ndef _SC_COLL_WEIGHTS_MAX */
4559 if (x
== Mono_Posix_SysconfName__SC_CPUTIME
)
4561 {*r
= _SC_CPUTIME
; return 0;}
4562 #else /* def _SC_CPUTIME */
4563 {errno
= EINVAL
; return -1;}
4564 #endif /* ndef _SC_CPUTIME */
4565 if (x
== Mono_Posix_SysconfName__SC_C_LANG_SUPPORT
)
4566 #ifdef _SC_C_LANG_SUPPORT
4567 {*r
= _SC_C_LANG_SUPPORT
; return 0;}
4568 #else /* def _SC_C_LANG_SUPPORT */
4569 {errno
= EINVAL
; return -1;}
4570 #endif /* ndef _SC_C_LANG_SUPPORT */
4571 if (x
== Mono_Posix_SysconfName__SC_C_LANG_SUPPORT_R
)
4572 #ifdef _SC_C_LANG_SUPPORT_R
4573 {*r
= _SC_C_LANG_SUPPORT_R
; return 0;}
4574 #else /* def _SC_C_LANG_SUPPORT_R */
4575 {errno
= EINVAL
; return -1;}
4576 #endif /* ndef _SC_C_LANG_SUPPORT_R */
4577 if (x
== Mono_Posix_SysconfName__SC_DELAYTIMER_MAX
)
4578 #ifdef _SC_DELAYTIMER_MAX
4579 {*r
= _SC_DELAYTIMER_MAX
; return 0;}
4580 #else /* def _SC_DELAYTIMER_MAX */
4581 {errno
= EINVAL
; return -1;}
4582 #endif /* ndef _SC_DELAYTIMER_MAX */
4583 if (x
== Mono_Posix_SysconfName__SC_DEVICE_IO
)
4584 #ifdef _SC_DEVICE_IO
4585 {*r
= _SC_DEVICE_IO
; return 0;}
4586 #else /* def _SC_DEVICE_IO */
4587 {errno
= EINVAL
; return -1;}
4588 #endif /* ndef _SC_DEVICE_IO */
4589 if (x
== Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC
)
4590 #ifdef _SC_DEVICE_SPECIFIC
4591 {*r
= _SC_DEVICE_SPECIFIC
; return 0;}
4592 #else /* def _SC_DEVICE_SPECIFIC */
4593 {errno
= EINVAL
; return -1;}
4594 #endif /* ndef _SC_DEVICE_SPECIFIC */
4595 if (x
== Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC_R
)
4596 #ifdef _SC_DEVICE_SPECIFIC_R
4597 {*r
= _SC_DEVICE_SPECIFIC_R
; return 0;}
4598 #else /* def _SC_DEVICE_SPECIFIC_R */
4599 {errno
= EINVAL
; return -1;}
4600 #endif /* ndef _SC_DEVICE_SPECIFIC_R */
4601 if (x
== Mono_Posix_SysconfName__SC_EQUIV_CLASS_MAX
)
4602 #ifdef _SC_EQUIV_CLASS_MAX
4603 {*r
= _SC_EQUIV_CLASS_MAX
; return 0;}
4604 #else /* def _SC_EQUIV_CLASS_MAX */
4605 {errno
= EINVAL
; return -1;}
4606 #endif /* ndef _SC_EQUIV_CLASS_MAX */
4607 if (x
== Mono_Posix_SysconfName__SC_EXPR_NEST_MAX
)
4608 #ifdef _SC_EXPR_NEST_MAX
4609 {*r
= _SC_EXPR_NEST_MAX
; return 0;}
4610 #else /* def _SC_EXPR_NEST_MAX */
4611 {errno
= EINVAL
; return -1;}
4612 #endif /* ndef _SC_EXPR_NEST_MAX */
4613 if (x
== Mono_Posix_SysconfName__SC_FD_MGMT
)
4615 {*r
= _SC_FD_MGMT
; return 0;}
4616 #else /* def _SC_FD_MGMT */
4617 {errno
= EINVAL
; return -1;}
4618 #endif /* ndef _SC_FD_MGMT */
4619 if (x
== Mono_Posix_SysconfName__SC_FIFO
)
4621 {*r
= _SC_FIFO
; return 0;}
4622 #else /* def _SC_FIFO */
4623 {errno
= EINVAL
; return -1;}
4624 #endif /* ndef _SC_FIFO */
4625 if (x
== Mono_Posix_SysconfName__SC_FILE_ATTRIBUTES
)
4626 #ifdef _SC_FILE_ATTRIBUTES
4627 {*r
= _SC_FILE_ATTRIBUTES
; return 0;}
4628 #else /* def _SC_FILE_ATTRIBUTES */
4629 {errno
= EINVAL
; return -1;}
4630 #endif /* ndef _SC_FILE_ATTRIBUTES */
4631 if (x
== Mono_Posix_SysconfName__SC_FILE_LOCKING
)
4632 #ifdef _SC_FILE_LOCKING
4633 {*r
= _SC_FILE_LOCKING
; return 0;}
4634 #else /* def _SC_FILE_LOCKING */
4635 {errno
= EINVAL
; return -1;}
4636 #endif /* ndef _SC_FILE_LOCKING */
4637 if (x
== Mono_Posix_SysconfName__SC_FILE_SYSTEM
)
4638 #ifdef _SC_FILE_SYSTEM
4639 {*r
= _SC_FILE_SYSTEM
; return 0;}
4640 #else /* def _SC_FILE_SYSTEM */
4641 {errno
= EINVAL
; return -1;}
4642 #endif /* ndef _SC_FILE_SYSTEM */
4643 if (x
== Mono_Posix_SysconfName__SC_FSYNC
)
4645 {*r
= _SC_FSYNC
; return 0;}
4646 #else /* def _SC_FSYNC */
4647 {errno
= EINVAL
; return -1;}
4648 #endif /* ndef _SC_FSYNC */
4649 if (x
== Mono_Posix_SysconfName__SC_GETGR_R_SIZE_MAX
)
4650 #ifdef _SC_GETGR_R_SIZE_MAX
4651 {*r
= _SC_GETGR_R_SIZE_MAX
; return 0;}
4652 #else /* def _SC_GETGR_R_SIZE_MAX */
4653 {errno
= EINVAL
; return -1;}
4654 #endif /* ndef _SC_GETGR_R_SIZE_MAX */
4655 if (x
== Mono_Posix_SysconfName__SC_GETPW_R_SIZE_MAX
)
4656 #ifdef _SC_GETPW_R_SIZE_MAX
4657 {*r
= _SC_GETPW_R_SIZE_MAX
; return 0;}
4658 #else /* def _SC_GETPW_R_SIZE_MAX */
4659 {errno
= EINVAL
; return -1;}
4660 #endif /* ndef _SC_GETPW_R_SIZE_MAX */
4661 if (x
== Mono_Posix_SysconfName__SC_HOST_NAME_MAX
)
4662 #ifdef _SC_HOST_NAME_MAX
4663 {*r
= _SC_HOST_NAME_MAX
; return 0;}
4664 #else /* def _SC_HOST_NAME_MAX */
4665 {errno
= EINVAL
; return -1;}
4666 #endif /* ndef _SC_HOST_NAME_MAX */
4667 if (x
== Mono_Posix_SysconfName__SC_INT_MAX
)
4669 {*r
= _SC_INT_MAX
; return 0;}
4670 #else /* def _SC_INT_MAX */
4671 {errno
= EINVAL
; return -1;}
4672 #endif /* ndef _SC_INT_MAX */
4673 if (x
== Mono_Posix_SysconfName__SC_INT_MIN
)
4675 {*r
= _SC_INT_MIN
; return 0;}
4676 #else /* def _SC_INT_MIN */
4677 {errno
= EINVAL
; return -1;}
4678 #endif /* ndef _SC_INT_MIN */
4679 if (x
== Mono_Posix_SysconfName__SC_IOV_MAX
)
4681 {*r
= _SC_IOV_MAX
; return 0;}
4682 #else /* def _SC_IOV_MAX */
4683 {errno
= EINVAL
; return -1;}
4684 #endif /* ndef _SC_IOV_MAX */
4685 if (x
== Mono_Posix_SysconfName__SC_JOB_CONTROL
)
4686 #ifdef _SC_JOB_CONTROL
4687 {*r
= _SC_JOB_CONTROL
; return 0;}
4688 #else /* def _SC_JOB_CONTROL */
4689 {errno
= EINVAL
; return -1;}
4690 #endif /* ndef _SC_JOB_CONTROL */
4691 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_ASSOC
)
4692 #ifdef _SC_LEVEL1_DCACHE_ASSOC
4693 {*r
= _SC_LEVEL1_DCACHE_ASSOC
; return 0;}
4694 #else /* def _SC_LEVEL1_DCACHE_ASSOC */
4695 {errno
= EINVAL
; return -1;}
4696 #endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
4697 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_LINESIZE
)
4698 #ifdef _SC_LEVEL1_DCACHE_LINESIZE
4699 {*r
= _SC_LEVEL1_DCACHE_LINESIZE
; return 0;}
4700 #else /* def _SC_LEVEL1_DCACHE_LINESIZE */
4701 {errno
= EINVAL
; return -1;}
4702 #endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
4703 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_SIZE
)
4704 #ifdef _SC_LEVEL1_DCACHE_SIZE
4705 {*r
= _SC_LEVEL1_DCACHE_SIZE
; return 0;}
4706 #else /* def _SC_LEVEL1_DCACHE_SIZE */
4707 {errno
= EINVAL
; return -1;}
4708 #endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
4709 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_ASSOC
)
4710 #ifdef _SC_LEVEL1_ICACHE_ASSOC
4711 {*r
= _SC_LEVEL1_ICACHE_ASSOC
; return 0;}
4712 #else /* def _SC_LEVEL1_ICACHE_ASSOC */
4713 {errno
= EINVAL
; return -1;}
4714 #endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
4715 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_LINESIZE
)
4716 #ifdef _SC_LEVEL1_ICACHE_LINESIZE
4717 {*r
= _SC_LEVEL1_ICACHE_LINESIZE
; return 0;}
4718 #else /* def _SC_LEVEL1_ICACHE_LINESIZE */
4719 {errno
= EINVAL
; return -1;}
4720 #endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
4721 if (x
== Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_SIZE
)
4722 #ifdef _SC_LEVEL1_ICACHE_SIZE
4723 {*r
= _SC_LEVEL1_ICACHE_SIZE
; return 0;}
4724 #else /* def _SC_LEVEL1_ICACHE_SIZE */
4725 {errno
= EINVAL
; return -1;}
4726 #endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
4727 if (x
== Mono_Posix_SysconfName__SC_LEVEL2_CACHE_ASSOC
)
4728 #ifdef _SC_LEVEL2_CACHE_ASSOC
4729 {*r
= _SC_LEVEL2_CACHE_ASSOC
; return 0;}
4730 #else /* def _SC_LEVEL2_CACHE_ASSOC */
4731 {errno
= EINVAL
; return -1;}
4732 #endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
4733 if (x
== Mono_Posix_SysconfName__SC_LEVEL2_CACHE_LINESIZE
)
4734 #ifdef _SC_LEVEL2_CACHE_LINESIZE
4735 {*r
= _SC_LEVEL2_CACHE_LINESIZE
; return 0;}
4736 #else /* def _SC_LEVEL2_CACHE_LINESIZE */
4737 {errno
= EINVAL
; return -1;}
4738 #endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
4739 if (x
== Mono_Posix_SysconfName__SC_LEVEL2_CACHE_SIZE
)
4740 #ifdef _SC_LEVEL2_CACHE_SIZE
4741 {*r
= _SC_LEVEL2_CACHE_SIZE
; return 0;}
4742 #else /* def _SC_LEVEL2_CACHE_SIZE */
4743 {errno
= EINVAL
; return -1;}
4744 #endif /* ndef _SC_LEVEL2_CACHE_SIZE */
4745 if (x
== Mono_Posix_SysconfName__SC_LEVEL3_CACHE_ASSOC
)
4746 #ifdef _SC_LEVEL3_CACHE_ASSOC
4747 {*r
= _SC_LEVEL3_CACHE_ASSOC
; return 0;}
4748 #else /* def _SC_LEVEL3_CACHE_ASSOC */
4749 {errno
= EINVAL
; return -1;}
4750 #endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
4751 if (x
== Mono_Posix_SysconfName__SC_LEVEL3_CACHE_LINESIZE
)
4752 #ifdef _SC_LEVEL3_CACHE_LINESIZE
4753 {*r
= _SC_LEVEL3_CACHE_LINESIZE
; return 0;}
4754 #else /* def _SC_LEVEL3_CACHE_LINESIZE */
4755 {errno
= EINVAL
; return -1;}
4756 #endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
4757 if (x
== Mono_Posix_SysconfName__SC_LEVEL3_CACHE_SIZE
)
4758 #ifdef _SC_LEVEL3_CACHE_SIZE
4759 {*r
= _SC_LEVEL3_CACHE_SIZE
; return 0;}
4760 #else /* def _SC_LEVEL3_CACHE_SIZE */
4761 {errno
= EINVAL
; return -1;}
4762 #endif /* ndef _SC_LEVEL3_CACHE_SIZE */
4763 if (x
== Mono_Posix_SysconfName__SC_LEVEL4_CACHE_ASSOC
)
4764 #ifdef _SC_LEVEL4_CACHE_ASSOC
4765 {*r
= _SC_LEVEL4_CACHE_ASSOC
; return 0;}
4766 #else /* def _SC_LEVEL4_CACHE_ASSOC */
4767 {errno
= EINVAL
; return -1;}
4768 #endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
4769 if (x
== Mono_Posix_SysconfName__SC_LEVEL4_CACHE_LINESIZE
)
4770 #ifdef _SC_LEVEL4_CACHE_LINESIZE
4771 {*r
= _SC_LEVEL4_CACHE_LINESIZE
; return 0;}
4772 #else /* def _SC_LEVEL4_CACHE_LINESIZE */
4773 {errno
= EINVAL
; return -1;}
4774 #endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
4775 if (x
== Mono_Posix_SysconfName__SC_LEVEL4_CACHE_SIZE
)
4776 #ifdef _SC_LEVEL4_CACHE_SIZE
4777 {*r
= _SC_LEVEL4_CACHE_SIZE
; return 0;}
4778 #else /* def _SC_LEVEL4_CACHE_SIZE */
4779 {errno
= EINVAL
; return -1;}
4780 #endif /* ndef _SC_LEVEL4_CACHE_SIZE */
4781 if (x
== Mono_Posix_SysconfName__SC_LINE_MAX
)
4783 {*r
= _SC_LINE_MAX
; return 0;}
4784 #else /* def _SC_LINE_MAX */
4785 {errno
= EINVAL
; return -1;}
4786 #endif /* ndef _SC_LINE_MAX */
4787 if (x
== Mono_Posix_SysconfName__SC_LOGIN_NAME_MAX
)
4788 #ifdef _SC_LOGIN_NAME_MAX
4789 {*r
= _SC_LOGIN_NAME_MAX
; return 0;}
4790 #else /* def _SC_LOGIN_NAME_MAX */
4791 {errno
= EINVAL
; return -1;}
4792 #endif /* ndef _SC_LOGIN_NAME_MAX */
4793 if (x
== Mono_Posix_SysconfName__SC_LONG_BIT
)
4795 {*r
= _SC_LONG_BIT
; return 0;}
4796 #else /* def _SC_LONG_BIT */
4797 {errno
= EINVAL
; return -1;}
4798 #endif /* ndef _SC_LONG_BIT */
4799 if (x
== Mono_Posix_SysconfName__SC_MAPPED_FILES
)
4800 #ifdef _SC_MAPPED_FILES
4801 {*r
= _SC_MAPPED_FILES
; return 0;}
4802 #else /* def _SC_MAPPED_FILES */
4803 {errno
= EINVAL
; return -1;}
4804 #endif /* ndef _SC_MAPPED_FILES */
4805 if (x
== Mono_Posix_SysconfName__SC_MB_LEN_MAX
)
4806 #ifdef _SC_MB_LEN_MAX
4807 {*r
= _SC_MB_LEN_MAX
; return 0;}
4808 #else /* def _SC_MB_LEN_MAX */
4809 {errno
= EINVAL
; return -1;}
4810 #endif /* ndef _SC_MB_LEN_MAX */
4811 if (x
== Mono_Posix_SysconfName__SC_MEMLOCK
)
4813 {*r
= _SC_MEMLOCK
; return 0;}
4814 #else /* def _SC_MEMLOCK */
4815 {errno
= EINVAL
; return -1;}
4816 #endif /* ndef _SC_MEMLOCK */
4817 if (x
== Mono_Posix_SysconfName__SC_MEMLOCK_RANGE
)
4818 #ifdef _SC_MEMLOCK_RANGE
4819 {*r
= _SC_MEMLOCK_RANGE
; return 0;}
4820 #else /* def _SC_MEMLOCK_RANGE */
4821 {errno
= EINVAL
; return -1;}
4822 #endif /* ndef _SC_MEMLOCK_RANGE */
4823 if (x
== Mono_Posix_SysconfName__SC_MEMORY_PROTECTION
)
4824 #ifdef _SC_MEMORY_PROTECTION
4825 {*r
= _SC_MEMORY_PROTECTION
; return 0;}
4826 #else /* def _SC_MEMORY_PROTECTION */
4827 {errno
= EINVAL
; return -1;}
4828 #endif /* ndef _SC_MEMORY_PROTECTION */
4829 if (x
== Mono_Posix_SysconfName__SC_MESSAGE_PASSING
)
4830 #ifdef _SC_MESSAGE_PASSING
4831 {*r
= _SC_MESSAGE_PASSING
; return 0;}
4832 #else /* def _SC_MESSAGE_PASSING */
4833 {errno
= EINVAL
; return -1;}
4834 #endif /* ndef _SC_MESSAGE_PASSING */
4835 if (x
== Mono_Posix_SysconfName__SC_MONOTONIC_CLOCK
)
4836 #ifdef _SC_MONOTONIC_CLOCK
4837 {*r
= _SC_MONOTONIC_CLOCK
; return 0;}
4838 #else /* def _SC_MONOTONIC_CLOCK */
4839 {errno
= EINVAL
; return -1;}
4840 #endif /* ndef _SC_MONOTONIC_CLOCK */
4841 if (x
== Mono_Posix_SysconfName__SC_MQ_OPEN_MAX
)
4842 #ifdef _SC_MQ_OPEN_MAX
4843 {*r
= _SC_MQ_OPEN_MAX
; return 0;}
4844 #else /* def _SC_MQ_OPEN_MAX */
4845 {errno
= EINVAL
; return -1;}
4846 #endif /* ndef _SC_MQ_OPEN_MAX */
4847 if (x
== Mono_Posix_SysconfName__SC_MQ_PRIO_MAX
)
4848 #ifdef _SC_MQ_PRIO_MAX
4849 {*r
= _SC_MQ_PRIO_MAX
; return 0;}
4850 #else /* def _SC_MQ_PRIO_MAX */
4851 {errno
= EINVAL
; return -1;}
4852 #endif /* ndef _SC_MQ_PRIO_MAX */
4853 if (x
== Mono_Posix_SysconfName__SC_MULTI_PROCESS
)
4854 #ifdef _SC_MULTI_PROCESS
4855 {*r
= _SC_MULTI_PROCESS
; return 0;}
4856 #else /* def _SC_MULTI_PROCESS */
4857 {errno
= EINVAL
; return -1;}
4858 #endif /* ndef _SC_MULTI_PROCESS */
4859 if (x
== Mono_Posix_SysconfName__SC_NETWORKING
)
4860 #ifdef _SC_NETWORKING
4861 {*r
= _SC_NETWORKING
; return 0;}
4862 #else /* def _SC_NETWORKING */
4863 {errno
= EINVAL
; return -1;}
4864 #endif /* ndef _SC_NETWORKING */
4865 if (x
== Mono_Posix_SysconfName__SC_NGROUPS_MAX
)
4866 #ifdef _SC_NGROUPS_MAX
4867 {*r
= _SC_NGROUPS_MAX
; return 0;}
4868 #else /* def _SC_NGROUPS_MAX */
4869 {errno
= EINVAL
; return -1;}
4870 #endif /* ndef _SC_NGROUPS_MAX */
4871 if (x
== Mono_Posix_SysconfName__SC_NL_ARGMAX
)
4872 #ifdef _SC_NL_ARGMAX
4873 {*r
= _SC_NL_ARGMAX
; return 0;}
4874 #else /* def _SC_NL_ARGMAX */
4875 {errno
= EINVAL
; return -1;}
4876 #endif /* ndef _SC_NL_ARGMAX */
4877 if (x
== Mono_Posix_SysconfName__SC_NL_LANGMAX
)
4878 #ifdef _SC_NL_LANGMAX
4879 {*r
= _SC_NL_LANGMAX
; return 0;}
4880 #else /* def _SC_NL_LANGMAX */
4881 {errno
= EINVAL
; return -1;}
4882 #endif /* ndef _SC_NL_LANGMAX */
4883 if (x
== Mono_Posix_SysconfName__SC_NL_MSGMAX
)
4884 #ifdef _SC_NL_MSGMAX
4885 {*r
= _SC_NL_MSGMAX
; return 0;}
4886 #else /* def _SC_NL_MSGMAX */
4887 {errno
= EINVAL
; return -1;}
4888 #endif /* ndef _SC_NL_MSGMAX */
4889 if (x
== Mono_Posix_SysconfName__SC_NL_NMAX
)
4891 {*r
= _SC_NL_NMAX
; return 0;}
4892 #else /* def _SC_NL_NMAX */
4893 {errno
= EINVAL
; return -1;}
4894 #endif /* ndef _SC_NL_NMAX */
4895 if (x
== Mono_Posix_SysconfName__SC_NL_SETMAX
)
4896 #ifdef _SC_NL_SETMAX
4897 {*r
= _SC_NL_SETMAX
; return 0;}
4898 #else /* def _SC_NL_SETMAX */
4899 {errno
= EINVAL
; return -1;}
4900 #endif /* ndef _SC_NL_SETMAX */
4901 if (x
== Mono_Posix_SysconfName__SC_NL_TEXTMAX
)
4902 #ifdef _SC_NL_TEXTMAX
4903 {*r
= _SC_NL_TEXTMAX
; return 0;}
4904 #else /* def _SC_NL_TEXTMAX */
4905 {errno
= EINVAL
; return -1;}
4906 #endif /* ndef _SC_NL_TEXTMAX */
4907 if (x
== Mono_Posix_SysconfName__SC_NPROCESSORS_CONF
)
4908 #ifdef _SC_NPROCESSORS_CONF
4909 {*r
= _SC_NPROCESSORS_CONF
; return 0;}
4910 #else /* def _SC_NPROCESSORS_CONF */
4911 {errno
= EINVAL
; return -1;}
4912 #endif /* ndef _SC_NPROCESSORS_CONF */
4913 if (x
== Mono_Posix_SysconfName__SC_NPROCESSORS_ONLN
)
4914 #ifdef _SC_NPROCESSORS_ONLN
4915 {*r
= _SC_NPROCESSORS_ONLN
; return 0;}
4916 #else /* def _SC_NPROCESSORS_ONLN */
4917 {errno
= EINVAL
; return -1;}
4918 #endif /* ndef _SC_NPROCESSORS_ONLN */
4919 if (x
== Mono_Posix_SysconfName__SC_NZERO
)
4921 {*r
= _SC_NZERO
; return 0;}
4922 #else /* def _SC_NZERO */
4923 {errno
= EINVAL
; return -1;}
4924 #endif /* ndef _SC_NZERO */
4925 if (x
== Mono_Posix_SysconfName__SC_OPEN_MAX
)
4927 {*r
= _SC_OPEN_MAX
; return 0;}
4928 #else /* def _SC_OPEN_MAX */
4929 {errno
= EINVAL
; return -1;}
4930 #endif /* ndef _SC_OPEN_MAX */
4931 if (x
== Mono_Posix_SysconfName__SC_PAGESIZE
)
4933 {*r
= _SC_PAGESIZE
; return 0;}
4934 #else /* def _SC_PAGESIZE */
4935 {errno
= EINVAL
; return -1;}
4936 #endif /* ndef _SC_PAGESIZE */
4937 if (x
== Mono_Posix_SysconfName__SC_PASS_MAX
)
4939 {*r
= _SC_PASS_MAX
; return 0;}
4940 #else /* def _SC_PASS_MAX */
4941 {errno
= EINVAL
; return -1;}
4942 #endif /* ndef _SC_PASS_MAX */
4943 if (x
== Mono_Posix_SysconfName__SC_PHYS_PAGES
)
4944 #ifdef _SC_PHYS_PAGES
4945 {*r
= _SC_PHYS_PAGES
; return 0;}
4946 #else /* def _SC_PHYS_PAGES */
4947 {errno
= EINVAL
; return -1;}
4948 #endif /* ndef _SC_PHYS_PAGES */
4949 if (x
== Mono_Posix_SysconfName__SC_PII
)
4951 {*r
= _SC_PII
; return 0;}
4952 #else /* def _SC_PII */
4953 {errno
= EINVAL
; return -1;}
4954 #endif /* ndef _SC_PII */
4955 if (x
== Mono_Posix_SysconfName__SC_PII_INTERNET
)
4956 #ifdef _SC_PII_INTERNET
4957 {*r
= _SC_PII_INTERNET
; return 0;}
4958 #else /* def _SC_PII_INTERNET */
4959 {errno
= EINVAL
; return -1;}
4960 #endif /* ndef _SC_PII_INTERNET */
4961 if (x
== Mono_Posix_SysconfName__SC_PII_INTERNET_DGRAM
)
4962 #ifdef _SC_PII_INTERNET_DGRAM
4963 {*r
= _SC_PII_INTERNET_DGRAM
; return 0;}
4964 #else /* def _SC_PII_INTERNET_DGRAM */
4965 {errno
= EINVAL
; return -1;}
4966 #endif /* ndef _SC_PII_INTERNET_DGRAM */
4967 if (x
== Mono_Posix_SysconfName__SC_PII_INTERNET_STREAM
)
4968 #ifdef _SC_PII_INTERNET_STREAM
4969 {*r
= _SC_PII_INTERNET_STREAM
; return 0;}
4970 #else /* def _SC_PII_INTERNET_STREAM */
4971 {errno
= EINVAL
; return -1;}
4972 #endif /* ndef _SC_PII_INTERNET_STREAM */
4973 if (x
== Mono_Posix_SysconfName__SC_PII_OSI
)
4975 {*r
= _SC_PII_OSI
; return 0;}
4976 #else /* def _SC_PII_OSI */
4977 {errno
= EINVAL
; return -1;}
4978 #endif /* ndef _SC_PII_OSI */
4979 if (x
== Mono_Posix_SysconfName__SC_PII_OSI_CLTS
)
4980 #ifdef _SC_PII_OSI_CLTS
4981 {*r
= _SC_PII_OSI_CLTS
; return 0;}
4982 #else /* def _SC_PII_OSI_CLTS */
4983 {errno
= EINVAL
; return -1;}
4984 #endif /* ndef _SC_PII_OSI_CLTS */
4985 if (x
== Mono_Posix_SysconfName__SC_PII_OSI_COTS
)
4986 #ifdef _SC_PII_OSI_COTS
4987 {*r
= _SC_PII_OSI_COTS
; return 0;}
4988 #else /* def _SC_PII_OSI_COTS */
4989 {errno
= EINVAL
; return -1;}
4990 #endif /* ndef _SC_PII_OSI_COTS */
4991 if (x
== Mono_Posix_SysconfName__SC_PII_OSI_M
)
4992 #ifdef _SC_PII_OSI_M
4993 {*r
= _SC_PII_OSI_M
; return 0;}
4994 #else /* def _SC_PII_OSI_M */
4995 {errno
= EINVAL
; return -1;}
4996 #endif /* ndef _SC_PII_OSI_M */
4997 if (x
== Mono_Posix_SysconfName__SC_PII_SOCKET
)
4998 #ifdef _SC_PII_SOCKET
4999 {*r
= _SC_PII_SOCKET
; return 0;}
5000 #else /* def _SC_PII_SOCKET */
5001 {errno
= EINVAL
; return -1;}
5002 #endif /* ndef _SC_PII_SOCKET */
5003 if (x
== Mono_Posix_SysconfName__SC_PII_XTI
)
5005 {*r
= _SC_PII_XTI
; return 0;}
5006 #else /* def _SC_PII_XTI */
5007 {errno
= EINVAL
; return -1;}
5008 #endif /* ndef _SC_PII_XTI */
5009 if (x
== Mono_Posix_SysconfName__SC_PIPE
)
5011 {*r
= _SC_PIPE
; return 0;}
5012 #else /* def _SC_PIPE */
5013 {errno
= EINVAL
; return -1;}
5014 #endif /* ndef _SC_PIPE */
5015 if (x
== Mono_Posix_SysconfName__SC_POLL
)
5017 {*r
= _SC_POLL
; return 0;}
5018 #else /* def _SC_POLL */
5019 {errno
= EINVAL
; return -1;}
5020 #endif /* ndef _SC_POLL */
5021 if (x
== Mono_Posix_SysconfName__SC_PRIORITIZED_IO
)
5022 #ifdef _SC_PRIORITIZED_IO
5023 {*r
= _SC_PRIORITIZED_IO
; return 0;}
5024 #else /* def _SC_PRIORITIZED_IO */
5025 {errno
= EINVAL
; return -1;}
5026 #endif /* ndef _SC_PRIORITIZED_IO */
5027 if (x
== Mono_Posix_SysconfName__SC_PRIORITY_SCHEDULING
)
5028 #ifdef _SC_PRIORITY_SCHEDULING
5029 {*r
= _SC_PRIORITY_SCHEDULING
; return 0;}
5030 #else /* def _SC_PRIORITY_SCHEDULING */
5031 {errno
= EINVAL
; return -1;}
5032 #endif /* ndef _SC_PRIORITY_SCHEDULING */
5033 if (x
== Mono_Posix_SysconfName__SC_READER_WRITER_LOCKS
)
5034 #ifdef _SC_READER_WRITER_LOCKS
5035 {*r
= _SC_READER_WRITER_LOCKS
; return 0;}
5036 #else /* def _SC_READER_WRITER_LOCKS */
5037 {errno
= EINVAL
; return -1;}
5038 #endif /* ndef _SC_READER_WRITER_LOCKS */
5039 if (x
== Mono_Posix_SysconfName__SC_REALTIME_SIGNALS
)
5040 #ifdef _SC_REALTIME_SIGNALS
5041 {*r
= _SC_REALTIME_SIGNALS
; return 0;}
5042 #else /* def _SC_REALTIME_SIGNALS */
5043 {errno
= EINVAL
; return -1;}
5044 #endif /* ndef _SC_REALTIME_SIGNALS */
5045 if (x
== Mono_Posix_SysconfName__SC_REGEXP
)
5047 {*r
= _SC_REGEXP
; return 0;}
5048 #else /* def _SC_REGEXP */
5049 {errno
= EINVAL
; return -1;}
5050 #endif /* ndef _SC_REGEXP */
5051 if (x
== Mono_Posix_SysconfName__SC_REGEX_VERSION
)
5052 #ifdef _SC_REGEX_VERSION
5053 {*r
= _SC_REGEX_VERSION
; return 0;}
5054 #else /* def _SC_REGEX_VERSION */
5055 {errno
= EINVAL
; return -1;}
5056 #endif /* ndef _SC_REGEX_VERSION */
5057 if (x
== Mono_Posix_SysconfName__SC_RE_DUP_MAX
)
5058 #ifdef _SC_RE_DUP_MAX
5059 {*r
= _SC_RE_DUP_MAX
; return 0;}
5060 #else /* def _SC_RE_DUP_MAX */
5061 {errno
= EINVAL
; return -1;}
5062 #endif /* ndef _SC_RE_DUP_MAX */
5063 if (x
== Mono_Posix_SysconfName__SC_RTSIG_MAX
)
5064 #ifdef _SC_RTSIG_MAX
5065 {*r
= _SC_RTSIG_MAX
; return 0;}
5066 #else /* def _SC_RTSIG_MAX */
5067 {errno
= EINVAL
; return -1;}
5068 #endif /* ndef _SC_RTSIG_MAX */
5069 if (x
== Mono_Posix_SysconfName__SC_SAVED_IDS
)
5070 #ifdef _SC_SAVED_IDS
5071 {*r
= _SC_SAVED_IDS
; return 0;}
5072 #else /* def _SC_SAVED_IDS */
5073 {errno
= EINVAL
; return -1;}
5074 #endif /* ndef _SC_SAVED_IDS */
5075 if (x
== Mono_Posix_SysconfName__SC_SCHAR_MAX
)
5076 #ifdef _SC_SCHAR_MAX
5077 {*r
= _SC_SCHAR_MAX
; return 0;}
5078 #else /* def _SC_SCHAR_MAX */
5079 {errno
= EINVAL
; return -1;}
5080 #endif /* ndef _SC_SCHAR_MAX */
5081 if (x
== Mono_Posix_SysconfName__SC_SCHAR_MIN
)
5082 #ifdef _SC_SCHAR_MIN
5083 {*r
= _SC_SCHAR_MIN
; return 0;}
5084 #else /* def _SC_SCHAR_MIN */
5085 {errno
= EINVAL
; return -1;}
5086 #endif /* ndef _SC_SCHAR_MIN */
5087 if (x
== Mono_Posix_SysconfName__SC_SELECT
)
5089 {*r
= _SC_SELECT
; return 0;}
5090 #else /* def _SC_SELECT */
5091 {errno
= EINVAL
; return -1;}
5092 #endif /* ndef _SC_SELECT */
5093 if (x
== Mono_Posix_SysconfName__SC_SEMAPHORES
)
5094 #ifdef _SC_SEMAPHORES
5095 {*r
= _SC_SEMAPHORES
; return 0;}
5096 #else /* def _SC_SEMAPHORES */
5097 {errno
= EINVAL
; return -1;}
5098 #endif /* ndef _SC_SEMAPHORES */
5099 if (x
== Mono_Posix_SysconfName__SC_SEM_NSEMS_MAX
)
5100 #ifdef _SC_SEM_NSEMS_MAX
5101 {*r
= _SC_SEM_NSEMS_MAX
; return 0;}
5102 #else /* def _SC_SEM_NSEMS_MAX */
5103 {errno
= EINVAL
; return -1;}
5104 #endif /* ndef _SC_SEM_NSEMS_MAX */
5105 if (x
== Mono_Posix_SysconfName__SC_SEM_VALUE_MAX
)
5106 #ifdef _SC_SEM_VALUE_MAX
5107 {*r
= _SC_SEM_VALUE_MAX
; return 0;}
5108 #else /* def _SC_SEM_VALUE_MAX */
5109 {errno
= EINVAL
; return -1;}
5110 #endif /* ndef _SC_SEM_VALUE_MAX */
5111 if (x
== Mono_Posix_SysconfName__SC_SHARED_MEMORY_OBJECTS
)
5112 #ifdef _SC_SHARED_MEMORY_OBJECTS
5113 {*r
= _SC_SHARED_MEMORY_OBJECTS
; return 0;}
5114 #else /* def _SC_SHARED_MEMORY_OBJECTS */
5115 {errno
= EINVAL
; return -1;}
5116 #endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
5117 if (x
== Mono_Posix_SysconfName__SC_SHELL
)
5119 {*r
= _SC_SHELL
; return 0;}
5120 #else /* def _SC_SHELL */
5121 {errno
= EINVAL
; return -1;}
5122 #endif /* ndef _SC_SHELL */
5123 if (x
== Mono_Posix_SysconfName__SC_SHRT_MAX
)
5125 {*r
= _SC_SHRT_MAX
; return 0;}
5126 #else /* def _SC_SHRT_MAX */
5127 {errno
= EINVAL
; return -1;}
5128 #endif /* ndef _SC_SHRT_MAX */
5129 if (x
== Mono_Posix_SysconfName__SC_SHRT_MIN
)
5131 {*r
= _SC_SHRT_MIN
; return 0;}
5132 #else /* def _SC_SHRT_MIN */
5133 {errno
= EINVAL
; return -1;}
5134 #endif /* ndef _SC_SHRT_MIN */
5135 if (x
== Mono_Posix_SysconfName__SC_SIGNALS
)
5137 {*r
= _SC_SIGNALS
; return 0;}
5138 #else /* def _SC_SIGNALS */
5139 {errno
= EINVAL
; return -1;}
5140 #endif /* ndef _SC_SIGNALS */
5141 if (x
== Mono_Posix_SysconfName__SC_SIGQUEUE_MAX
)
5142 #ifdef _SC_SIGQUEUE_MAX
5143 {*r
= _SC_SIGQUEUE_MAX
; return 0;}
5144 #else /* def _SC_SIGQUEUE_MAX */
5145 {errno
= EINVAL
; return -1;}
5146 #endif /* ndef _SC_SIGQUEUE_MAX */
5147 if (x
== Mono_Posix_SysconfName__SC_SINGLE_PROCESS
)
5148 #ifdef _SC_SINGLE_PROCESS
5149 {*r
= _SC_SINGLE_PROCESS
; return 0;}
5150 #else /* def _SC_SINGLE_PROCESS */
5151 {errno
= EINVAL
; return -1;}
5152 #endif /* ndef _SC_SINGLE_PROCESS */
5153 if (x
== Mono_Posix_SysconfName__SC_SPAWN
)
5155 {*r
= _SC_SPAWN
; return 0;}
5156 #else /* def _SC_SPAWN */
5157 {errno
= EINVAL
; return -1;}
5158 #endif /* ndef _SC_SPAWN */
5159 if (x
== Mono_Posix_SysconfName__SC_SPIN_LOCKS
)
5160 #ifdef _SC_SPIN_LOCKS
5161 {*r
= _SC_SPIN_LOCKS
; return 0;}
5162 #else /* def _SC_SPIN_LOCKS */
5163 {errno
= EINVAL
; return -1;}
5164 #endif /* ndef _SC_SPIN_LOCKS */
5165 if (x
== Mono_Posix_SysconfName__SC_SPORADIC_SERVER
)
5166 #ifdef _SC_SPORADIC_SERVER
5167 {*r
= _SC_SPORADIC_SERVER
; return 0;}
5168 #else /* def _SC_SPORADIC_SERVER */
5169 {errno
= EINVAL
; return -1;}
5170 #endif /* ndef _SC_SPORADIC_SERVER */
5171 if (x
== Mono_Posix_SysconfName__SC_SSIZE_MAX
)
5172 #ifdef _SC_SSIZE_MAX
5173 {*r
= _SC_SSIZE_MAX
; return 0;}
5174 #else /* def _SC_SSIZE_MAX */
5175 {errno
= EINVAL
; return -1;}
5176 #endif /* ndef _SC_SSIZE_MAX */
5177 if (x
== Mono_Posix_SysconfName__SC_STREAMS
)
5179 {*r
= _SC_STREAMS
; return 0;}
5180 #else /* def _SC_STREAMS */
5181 {errno
= EINVAL
; return -1;}
5182 #endif /* ndef _SC_STREAMS */
5183 if (x
== Mono_Posix_SysconfName__SC_STREAM_MAX
)
5184 #ifdef _SC_STREAM_MAX
5185 {*r
= _SC_STREAM_MAX
; return 0;}
5186 #else /* def _SC_STREAM_MAX */
5187 {errno
= EINVAL
; return -1;}
5188 #endif /* ndef _SC_STREAM_MAX */
5189 if (x
== Mono_Posix_SysconfName__SC_SYMLOOP_MAX
)
5190 #ifdef _SC_SYMLOOP_MAX
5191 {*r
= _SC_SYMLOOP_MAX
; return 0;}
5192 #else /* def _SC_SYMLOOP_MAX */
5193 {errno
= EINVAL
; return -1;}
5194 #endif /* ndef _SC_SYMLOOP_MAX */
5195 if (x
== Mono_Posix_SysconfName__SC_SYNCHRONIZED_IO
)
5196 #ifdef _SC_SYNCHRONIZED_IO
5197 {*r
= _SC_SYNCHRONIZED_IO
; return 0;}
5198 #else /* def _SC_SYNCHRONIZED_IO */
5199 {errno
= EINVAL
; return -1;}
5200 #endif /* ndef _SC_SYNCHRONIZED_IO */
5201 if (x
== Mono_Posix_SysconfName__SC_SYSTEM_DATABASE
)
5202 #ifdef _SC_SYSTEM_DATABASE
5203 {*r
= _SC_SYSTEM_DATABASE
; return 0;}
5204 #else /* def _SC_SYSTEM_DATABASE */
5205 {errno
= EINVAL
; return -1;}
5206 #endif /* ndef _SC_SYSTEM_DATABASE */
5207 if (x
== Mono_Posix_SysconfName__SC_SYSTEM_DATABASE_R
)
5208 #ifdef _SC_SYSTEM_DATABASE_R
5209 {*r
= _SC_SYSTEM_DATABASE_R
; return 0;}
5210 #else /* def _SC_SYSTEM_DATABASE_R */
5211 {errno
= EINVAL
; return -1;}
5212 #endif /* ndef _SC_SYSTEM_DATABASE_R */
5213 if (x
== Mono_Posix_SysconfName__SC_THREADS
)
5215 {*r
= _SC_THREADS
; return 0;}
5216 #else /* def _SC_THREADS */
5217 {errno
= EINVAL
; return -1;}
5218 #endif /* ndef _SC_THREADS */
5219 if (x
== Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKADDR
)
5220 #ifdef _SC_THREAD_ATTR_STACKADDR
5221 {*r
= _SC_THREAD_ATTR_STACKADDR
; return 0;}
5222 #else /* def _SC_THREAD_ATTR_STACKADDR */
5223 {errno
= EINVAL
; return -1;}
5224 #endif /* ndef _SC_THREAD_ATTR_STACKADDR */
5225 if (x
== Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKSIZE
)
5226 #ifdef _SC_THREAD_ATTR_STACKSIZE
5227 {*r
= _SC_THREAD_ATTR_STACKSIZE
; return 0;}
5228 #else /* def _SC_THREAD_ATTR_STACKSIZE */
5229 {errno
= EINVAL
; return -1;}
5230 #endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
5231 if (x
== Mono_Posix_SysconfName__SC_THREAD_CPUTIME
)
5232 #ifdef _SC_THREAD_CPUTIME
5233 {*r
= _SC_THREAD_CPUTIME
; return 0;}
5234 #else /* def _SC_THREAD_CPUTIME */
5235 {errno
= EINVAL
; return -1;}
5236 #endif /* ndef _SC_THREAD_CPUTIME */
5237 if (x
== Mono_Posix_SysconfName__SC_THREAD_DESTRUCTOR_ITERATIONS
)
5238 #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
5239 {*r
= _SC_THREAD_DESTRUCTOR_ITERATIONS
; return 0;}
5240 #else /* def _SC_THREAD_DESTRUCTOR_ITERATIONS */
5241 {errno
= EINVAL
; return -1;}
5242 #endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
5243 if (x
== Mono_Posix_SysconfName__SC_THREAD_KEYS_MAX
)
5244 #ifdef _SC_THREAD_KEYS_MAX
5245 {*r
= _SC_THREAD_KEYS_MAX
; return 0;}
5246 #else /* def _SC_THREAD_KEYS_MAX */
5247 {errno
= EINVAL
; return -1;}
5248 #endif /* ndef _SC_THREAD_KEYS_MAX */
5249 if (x
== Mono_Posix_SysconfName__SC_THREAD_PRIORITY_SCHEDULING
)
5250 #ifdef _SC_THREAD_PRIORITY_SCHEDULING
5251 {*r
= _SC_THREAD_PRIORITY_SCHEDULING
; return 0;}
5252 #else /* def _SC_THREAD_PRIORITY_SCHEDULING */
5253 {errno
= EINVAL
; return -1;}
5254 #endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
5255 if (x
== Mono_Posix_SysconfName__SC_THREAD_PRIO_INHERIT
)
5256 #ifdef _SC_THREAD_PRIO_INHERIT
5257 {*r
= _SC_THREAD_PRIO_INHERIT
; return 0;}
5258 #else /* def _SC_THREAD_PRIO_INHERIT */
5259 {errno
= EINVAL
; return -1;}
5260 #endif /* ndef _SC_THREAD_PRIO_INHERIT */
5261 if (x
== Mono_Posix_SysconfName__SC_THREAD_PRIO_PROTECT
)
5262 #ifdef _SC_THREAD_PRIO_PROTECT
5263 {*r
= _SC_THREAD_PRIO_PROTECT
; return 0;}
5264 #else /* def _SC_THREAD_PRIO_PROTECT */
5265 {errno
= EINVAL
; return -1;}
5266 #endif /* ndef _SC_THREAD_PRIO_PROTECT */
5267 if (x
== Mono_Posix_SysconfName__SC_THREAD_PROCESS_SHARED
)
5268 #ifdef _SC_THREAD_PROCESS_SHARED
5269 {*r
= _SC_THREAD_PROCESS_SHARED
; return 0;}
5270 #else /* def _SC_THREAD_PROCESS_SHARED */
5271 {errno
= EINVAL
; return -1;}
5272 #endif /* ndef _SC_THREAD_PROCESS_SHARED */
5273 if (x
== Mono_Posix_SysconfName__SC_THREAD_SAFE_FUNCTIONS
)
5274 #ifdef _SC_THREAD_SAFE_FUNCTIONS
5275 {*r
= _SC_THREAD_SAFE_FUNCTIONS
; return 0;}
5276 #else /* def _SC_THREAD_SAFE_FUNCTIONS */
5277 {errno
= EINVAL
; return -1;}
5278 #endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
5279 if (x
== Mono_Posix_SysconfName__SC_THREAD_SPORADIC_SERVER
)
5280 #ifdef _SC_THREAD_SPORADIC_SERVER
5281 {*r
= _SC_THREAD_SPORADIC_SERVER
; return 0;}
5282 #else /* def _SC_THREAD_SPORADIC_SERVER */
5283 {errno
= EINVAL
; return -1;}
5284 #endif /* ndef _SC_THREAD_SPORADIC_SERVER */
5285 if (x
== Mono_Posix_SysconfName__SC_THREAD_STACK_MIN
)
5286 #ifdef _SC_THREAD_STACK_MIN
5287 {*r
= _SC_THREAD_STACK_MIN
; return 0;}
5288 #else /* def _SC_THREAD_STACK_MIN */
5289 {errno
= EINVAL
; return -1;}
5290 #endif /* ndef _SC_THREAD_STACK_MIN */
5291 if (x
== Mono_Posix_SysconfName__SC_THREAD_THREADS_MAX
)
5292 #ifdef _SC_THREAD_THREADS_MAX
5293 {*r
= _SC_THREAD_THREADS_MAX
; return 0;}
5294 #else /* def _SC_THREAD_THREADS_MAX */
5295 {errno
= EINVAL
; return -1;}
5296 #endif /* ndef _SC_THREAD_THREADS_MAX */
5297 if (x
== Mono_Posix_SysconfName__SC_TIMEOUTS
)
5299 {*r
= _SC_TIMEOUTS
; return 0;}
5300 #else /* def _SC_TIMEOUTS */
5301 {errno
= EINVAL
; return -1;}
5302 #endif /* ndef _SC_TIMEOUTS */
5303 if (x
== Mono_Posix_SysconfName__SC_TIMERS
)
5305 {*r
= _SC_TIMERS
; return 0;}
5306 #else /* def _SC_TIMERS */
5307 {errno
= EINVAL
; return -1;}
5308 #endif /* ndef _SC_TIMERS */
5309 if (x
== Mono_Posix_SysconfName__SC_TIMER_MAX
)
5310 #ifdef _SC_TIMER_MAX
5311 {*r
= _SC_TIMER_MAX
; return 0;}
5312 #else /* def _SC_TIMER_MAX */
5313 {errno
= EINVAL
; return -1;}
5314 #endif /* ndef _SC_TIMER_MAX */
5315 if (x
== Mono_Posix_SysconfName__SC_TRACE
)
5317 {*r
= _SC_TRACE
; return 0;}
5318 #else /* def _SC_TRACE */
5319 {errno
= EINVAL
; return -1;}
5320 #endif /* ndef _SC_TRACE */
5321 if (x
== Mono_Posix_SysconfName__SC_TRACE_EVENT_FILTER
)
5322 #ifdef _SC_TRACE_EVENT_FILTER
5323 {*r
= _SC_TRACE_EVENT_FILTER
; return 0;}
5324 #else /* def _SC_TRACE_EVENT_FILTER */
5325 {errno
= EINVAL
; return -1;}
5326 #endif /* ndef _SC_TRACE_EVENT_FILTER */
5327 if (x
== Mono_Posix_SysconfName__SC_TRACE_INHERIT
)
5328 #ifdef _SC_TRACE_INHERIT
5329 {*r
= _SC_TRACE_INHERIT
; return 0;}
5330 #else /* def _SC_TRACE_INHERIT */
5331 {errno
= EINVAL
; return -1;}
5332 #endif /* ndef _SC_TRACE_INHERIT */
5333 if (x
== Mono_Posix_SysconfName__SC_TRACE_LOG
)
5334 #ifdef _SC_TRACE_LOG
5335 {*r
= _SC_TRACE_LOG
; return 0;}
5336 #else /* def _SC_TRACE_LOG */
5337 {errno
= EINVAL
; return -1;}
5338 #endif /* ndef _SC_TRACE_LOG */
5339 if (x
== Mono_Posix_SysconfName__SC_TTY_NAME_MAX
)
5340 #ifdef _SC_TTY_NAME_MAX
5341 {*r
= _SC_TTY_NAME_MAX
; return 0;}
5342 #else /* def _SC_TTY_NAME_MAX */
5343 {errno
= EINVAL
; return -1;}
5344 #endif /* ndef _SC_TTY_NAME_MAX */
5345 if (x
== Mono_Posix_SysconfName__SC_TYPED_MEMORY_OBJECTS
)
5346 #ifdef _SC_TYPED_MEMORY_OBJECTS
5347 {*r
= _SC_TYPED_MEMORY_OBJECTS
; return 0;}
5348 #else /* def _SC_TYPED_MEMORY_OBJECTS */
5349 {errno
= EINVAL
; return -1;}
5350 #endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
5351 if (x
== Mono_Posix_SysconfName__SC_TZNAME_MAX
)
5352 #ifdef _SC_TZNAME_MAX
5353 {*r
= _SC_TZNAME_MAX
; return 0;}
5354 #else /* def _SC_TZNAME_MAX */
5355 {errno
= EINVAL
; return -1;}
5356 #endif /* ndef _SC_TZNAME_MAX */
5357 if (x
== Mono_Posix_SysconfName__SC_T_IOV_MAX
)
5358 #ifdef _SC_T_IOV_MAX
5359 {*r
= _SC_T_IOV_MAX
; return 0;}
5360 #else /* def _SC_T_IOV_MAX */
5361 {errno
= EINVAL
; return -1;}
5362 #endif /* ndef _SC_T_IOV_MAX */
5363 if (x
== Mono_Posix_SysconfName__SC_UCHAR_MAX
)
5364 #ifdef _SC_UCHAR_MAX
5365 {*r
= _SC_UCHAR_MAX
; return 0;}
5366 #else /* def _SC_UCHAR_MAX */
5367 {errno
= EINVAL
; return -1;}
5368 #endif /* ndef _SC_UCHAR_MAX */
5369 if (x
== Mono_Posix_SysconfName__SC_UINT_MAX
)
5371 {*r
= _SC_UINT_MAX
; return 0;}
5372 #else /* def _SC_UINT_MAX */
5373 {errno
= EINVAL
; return -1;}
5374 #endif /* ndef _SC_UINT_MAX */
5375 if (x
== Mono_Posix_SysconfName__SC_UIO_MAXIOV
)
5376 #ifdef _SC_UIO_MAXIOV
5377 {*r
= _SC_UIO_MAXIOV
; return 0;}
5378 #else /* def _SC_UIO_MAXIOV */
5379 {errno
= EINVAL
; return -1;}
5380 #endif /* ndef _SC_UIO_MAXIOV */
5381 if (x
== Mono_Posix_SysconfName__SC_ULONG_MAX
)
5382 #ifdef _SC_ULONG_MAX
5383 {*r
= _SC_ULONG_MAX
; return 0;}
5384 #else /* def _SC_ULONG_MAX */
5385 {errno
= EINVAL
; return -1;}
5386 #endif /* ndef _SC_ULONG_MAX */
5387 if (x
== Mono_Posix_SysconfName__SC_USER_GROUPS
)
5388 #ifdef _SC_USER_GROUPS
5389 {*r
= _SC_USER_GROUPS
; return 0;}
5390 #else /* def _SC_USER_GROUPS */
5391 {errno
= EINVAL
; return -1;}
5392 #endif /* ndef _SC_USER_GROUPS */
5393 if (x
== Mono_Posix_SysconfName__SC_USER_GROUPS_R
)
5394 #ifdef _SC_USER_GROUPS_R
5395 {*r
= _SC_USER_GROUPS_R
; return 0;}
5396 #else /* def _SC_USER_GROUPS_R */
5397 {errno
= EINVAL
; return -1;}
5398 #endif /* ndef _SC_USER_GROUPS_R */
5399 if (x
== Mono_Posix_SysconfName__SC_USHRT_MAX
)
5400 #ifdef _SC_USHRT_MAX
5401 {*r
= _SC_USHRT_MAX
; return 0;}
5402 #else /* def _SC_USHRT_MAX */
5403 {errno
= EINVAL
; return -1;}
5404 #endif /* ndef _SC_USHRT_MAX */
5405 if (x
== Mono_Posix_SysconfName__SC_V6_ILP32_OFF32
)
5406 #ifdef _SC_V6_ILP32_OFF32
5407 {*r
= _SC_V6_ILP32_OFF32
; return 0;}
5408 #else /* def _SC_V6_ILP32_OFF32 */
5409 {errno
= EINVAL
; return -1;}
5410 #endif /* ndef _SC_V6_ILP32_OFF32 */
5411 if (x
== Mono_Posix_SysconfName__SC_V6_ILP32_OFFBIG
)
5412 #ifdef _SC_V6_ILP32_OFFBIG
5413 {*r
= _SC_V6_ILP32_OFFBIG
; return 0;}
5414 #else /* def _SC_V6_ILP32_OFFBIG */
5415 {errno
= EINVAL
; return -1;}
5416 #endif /* ndef _SC_V6_ILP32_OFFBIG */
5417 if (x
== Mono_Posix_SysconfName__SC_V6_LP64_OFF64
)
5418 #ifdef _SC_V6_LP64_OFF64
5419 {*r
= _SC_V6_LP64_OFF64
; return 0;}
5420 #else /* def _SC_V6_LP64_OFF64 */
5421 {errno
= EINVAL
; return -1;}
5422 #endif /* ndef _SC_V6_LP64_OFF64 */
5423 if (x
== Mono_Posix_SysconfName__SC_V6_LPBIG_OFFBIG
)
5424 #ifdef _SC_V6_LPBIG_OFFBIG
5425 {*r
= _SC_V6_LPBIG_OFFBIG
; return 0;}
5426 #else /* def _SC_V6_LPBIG_OFFBIG */
5427 {errno
= EINVAL
; return -1;}
5428 #endif /* ndef _SC_V6_LPBIG_OFFBIG */
5429 if (x
== Mono_Posix_SysconfName__SC_VERSION
)
5431 {*r
= _SC_VERSION
; return 0;}
5432 #else /* def _SC_VERSION */
5433 {errno
= EINVAL
; return -1;}
5434 #endif /* ndef _SC_VERSION */
5435 if (x
== Mono_Posix_SysconfName__SC_WORD_BIT
)
5437 {*r
= _SC_WORD_BIT
; return 0;}
5438 #else /* def _SC_WORD_BIT */
5439 {errno
= EINVAL
; return -1;}
5440 #endif /* ndef _SC_WORD_BIT */
5441 if (x
== Mono_Posix_SysconfName__SC_XBS5_ILP32_OFF32
)
5442 #ifdef _SC_XBS5_ILP32_OFF32
5443 {*r
= _SC_XBS5_ILP32_OFF32
; return 0;}
5444 #else /* def _SC_XBS5_ILP32_OFF32 */
5445 {errno
= EINVAL
; return -1;}
5446 #endif /* ndef _SC_XBS5_ILP32_OFF32 */
5447 if (x
== Mono_Posix_SysconfName__SC_XBS5_ILP32_OFFBIG
)
5448 #ifdef _SC_XBS5_ILP32_OFFBIG
5449 {*r
= _SC_XBS5_ILP32_OFFBIG
; return 0;}
5450 #else /* def _SC_XBS5_ILP32_OFFBIG */
5451 {errno
= EINVAL
; return -1;}
5452 #endif /* ndef _SC_XBS5_ILP32_OFFBIG */
5453 if (x
== Mono_Posix_SysconfName__SC_XBS5_LP64_OFF64
)
5454 #ifdef _SC_XBS5_LP64_OFF64
5455 {*r
= _SC_XBS5_LP64_OFF64
; return 0;}
5456 #else /* def _SC_XBS5_LP64_OFF64 */
5457 {errno
= EINVAL
; return -1;}
5458 #endif /* ndef _SC_XBS5_LP64_OFF64 */
5459 if (x
== Mono_Posix_SysconfName__SC_XBS5_LPBIG_OFFBIG
)
5460 #ifdef _SC_XBS5_LPBIG_OFFBIG
5461 {*r
= _SC_XBS5_LPBIG_OFFBIG
; return 0;}
5462 #else /* def _SC_XBS5_LPBIG_OFFBIG */
5463 {errno
= EINVAL
; return -1;}
5464 #endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
5465 if (x
== Mono_Posix_SysconfName__SC_XOPEN_CRYPT
)
5466 #ifdef _SC_XOPEN_CRYPT
5467 {*r
= _SC_XOPEN_CRYPT
; return 0;}
5468 #else /* def _SC_XOPEN_CRYPT */
5469 {errno
= EINVAL
; return -1;}
5470 #endif /* ndef _SC_XOPEN_CRYPT */
5471 if (x
== Mono_Posix_SysconfName__SC_XOPEN_ENH_I18N
)
5472 #ifdef _SC_XOPEN_ENH_I18N
5473 {*r
= _SC_XOPEN_ENH_I18N
; return 0;}
5474 #else /* def _SC_XOPEN_ENH_I18N */
5475 {errno
= EINVAL
; return -1;}
5476 #endif /* ndef _SC_XOPEN_ENH_I18N */
5477 if (x
== Mono_Posix_SysconfName__SC_XOPEN_LEGACY
)
5478 #ifdef _SC_XOPEN_LEGACY
5479 {*r
= _SC_XOPEN_LEGACY
; return 0;}
5480 #else /* def _SC_XOPEN_LEGACY */
5481 {errno
= EINVAL
; return -1;}
5482 #endif /* ndef _SC_XOPEN_LEGACY */
5483 if (x
== Mono_Posix_SysconfName__SC_XOPEN_REALTIME
)
5484 #ifdef _SC_XOPEN_REALTIME
5485 {*r
= _SC_XOPEN_REALTIME
; return 0;}
5486 #else /* def _SC_XOPEN_REALTIME */
5487 {errno
= EINVAL
; return -1;}
5488 #endif /* ndef _SC_XOPEN_REALTIME */
5489 if (x
== Mono_Posix_SysconfName__SC_XOPEN_REALTIME_THREADS
)
5490 #ifdef _SC_XOPEN_REALTIME_THREADS
5491 {*r
= _SC_XOPEN_REALTIME_THREADS
; return 0;}
5492 #else /* def _SC_XOPEN_REALTIME_THREADS */
5493 {errno
= EINVAL
; return -1;}
5494 #endif /* ndef _SC_XOPEN_REALTIME_THREADS */
5495 if (x
== Mono_Posix_SysconfName__SC_XOPEN_SHM
)
5496 #ifdef _SC_XOPEN_SHM
5497 {*r
= _SC_XOPEN_SHM
; return 0;}
5498 #else /* def _SC_XOPEN_SHM */
5499 {errno
= EINVAL
; return -1;}
5500 #endif /* ndef _SC_XOPEN_SHM */
5501 if (x
== Mono_Posix_SysconfName__SC_XOPEN_UNIX
)
5502 #ifdef _SC_XOPEN_UNIX
5503 {*r
= _SC_XOPEN_UNIX
; return 0;}
5504 #else /* def _SC_XOPEN_UNIX */
5505 {errno
= EINVAL
; return -1;}
5506 #endif /* ndef _SC_XOPEN_UNIX */
5507 if (x
== Mono_Posix_SysconfName__SC_XOPEN_VERSION
)
5508 #ifdef _SC_XOPEN_VERSION
5509 {*r
= _SC_XOPEN_VERSION
; return 0;}
5510 #else /* def _SC_XOPEN_VERSION */
5511 {errno
= EINVAL
; return -1;}
5512 #endif /* ndef _SC_XOPEN_VERSION */
5513 if (x
== Mono_Posix_SysconfName__SC_XOPEN_XCU_VERSION
)
5514 #ifdef _SC_XOPEN_XCU_VERSION
5515 {*r
= _SC_XOPEN_XCU_VERSION
; return 0;}
5516 #else /* def _SC_XOPEN_XCU_VERSION */
5517 {errno
= EINVAL
; return -1;}
5518 #endif /* ndef _SC_XOPEN_XCU_VERSION */
5519 if (x
== Mono_Posix_SysconfName__SC_XOPEN_XPG2
)
5520 #ifdef _SC_XOPEN_XPG2
5521 {*r
= _SC_XOPEN_XPG2
; return 0;}
5522 #else /* def _SC_XOPEN_XPG2 */
5523 {errno
= EINVAL
; return -1;}
5524 #endif /* ndef _SC_XOPEN_XPG2 */
5525 if (x
== Mono_Posix_SysconfName__SC_XOPEN_XPG3
)
5526 #ifdef _SC_XOPEN_XPG3
5527 {*r
= _SC_XOPEN_XPG3
; return 0;}
5528 #else /* def _SC_XOPEN_XPG3 */
5529 {errno
= EINVAL
; return -1;}
5530 #endif /* ndef _SC_XOPEN_XPG3 */
5531 if (x
== Mono_Posix_SysconfName__SC_XOPEN_XPG4
)
5532 #ifdef _SC_XOPEN_XPG4
5533 {*r
= _SC_XOPEN_XPG4
; return 0;}
5534 #else /* def _SC_XOPEN_XPG4 */
5535 {errno
= EINVAL
; return -1;}
5536 #endif /* ndef _SC_XOPEN_XPG4 */
5539 errno
= EINVAL
; return -1;
5542 int Mono_Posix_ToSysconfName (int x
, int *r
)
5547 #ifdef _SC_2_CHAR_TERM
5548 if (x
== _SC_2_CHAR_TERM
)
5549 {*r
= Mono_Posix_SysconfName__SC_2_CHAR_TERM
; return 0;}
5550 #endif /* ndef _SC_2_CHAR_TERM */
5552 if (x
== _SC_2_C_BIND
)
5553 {*r
= Mono_Posix_SysconfName__SC_2_C_BIND
; return 0;}
5554 #endif /* ndef _SC_2_C_BIND */
5556 if (x
== _SC_2_C_DEV
)
5557 {*r
= Mono_Posix_SysconfName__SC_2_C_DEV
; return 0;}
5558 #endif /* ndef _SC_2_C_DEV */
5559 #ifdef _SC_2_C_VERSION
5560 if (x
== _SC_2_C_VERSION
)
5561 {*r
= Mono_Posix_SysconfName__SC_2_C_VERSION
; return 0;}
5562 #endif /* ndef _SC_2_C_VERSION */
5563 #ifdef _SC_2_FORT_DEV
5564 if (x
== _SC_2_FORT_DEV
)
5565 {*r
= Mono_Posix_SysconfName__SC_2_FORT_DEV
; return 0;}
5566 #endif /* ndef _SC_2_FORT_DEV */
5567 #ifdef _SC_2_FORT_RUN
5568 if (x
== _SC_2_FORT_RUN
)
5569 {*r
= Mono_Posix_SysconfName__SC_2_FORT_RUN
; return 0;}
5570 #endif /* ndef _SC_2_FORT_RUN */
5571 #ifdef _SC_2_LOCALEDEF
5572 if (x
== _SC_2_LOCALEDEF
)
5573 {*r
= Mono_Posix_SysconfName__SC_2_LOCALEDEF
; return 0;}
5574 #endif /* ndef _SC_2_LOCALEDEF */
5577 {*r
= Mono_Posix_SysconfName__SC_2_PBS
; return 0;}
5578 #endif /* ndef _SC_2_PBS */
5579 #ifdef _SC_2_PBS_ACCOUNTING
5580 if (x
== _SC_2_PBS_ACCOUNTING
)
5581 {*r
= Mono_Posix_SysconfName__SC_2_PBS_ACCOUNTING
; return 0;}
5582 #endif /* ndef _SC_2_PBS_ACCOUNTING */
5583 #ifdef _SC_2_PBS_CHECKPOINT
5584 if (x
== _SC_2_PBS_CHECKPOINT
)
5585 {*r
= Mono_Posix_SysconfName__SC_2_PBS_CHECKPOINT
; return 0;}
5586 #endif /* ndef _SC_2_PBS_CHECKPOINT */
5587 #ifdef _SC_2_PBS_LOCATE
5588 if (x
== _SC_2_PBS_LOCATE
)
5589 {*r
= Mono_Posix_SysconfName__SC_2_PBS_LOCATE
; return 0;}
5590 #endif /* ndef _SC_2_PBS_LOCATE */
5591 #ifdef _SC_2_PBS_MESSAGE
5592 if (x
== _SC_2_PBS_MESSAGE
)
5593 {*r
= Mono_Posix_SysconfName__SC_2_PBS_MESSAGE
; return 0;}
5594 #endif /* ndef _SC_2_PBS_MESSAGE */
5595 #ifdef _SC_2_PBS_TRACK
5596 if (x
== _SC_2_PBS_TRACK
)
5597 {*r
= Mono_Posix_SysconfName__SC_2_PBS_TRACK
; return 0;}
5598 #endif /* ndef _SC_2_PBS_TRACK */
5600 if (x
== _SC_2_SW_DEV
)
5601 {*r
= Mono_Posix_SysconfName__SC_2_SW_DEV
; return 0;}
5602 #endif /* ndef _SC_2_SW_DEV */
5605 {*r
= Mono_Posix_SysconfName__SC_2_UPE
; return 0;}
5606 #endif /* ndef _SC_2_UPE */
5607 #ifdef _SC_2_VERSION
5608 if (x
== _SC_2_VERSION
)
5609 {*r
= Mono_Posix_SysconfName__SC_2_VERSION
; return 0;}
5610 #endif /* ndef _SC_2_VERSION */
5611 #ifdef _SC_ADVISORY_INFO
5612 if (x
== _SC_ADVISORY_INFO
)
5613 {*r
= Mono_Posix_SysconfName__SC_ADVISORY_INFO
; return 0;}
5614 #endif /* ndef _SC_ADVISORY_INFO */
5615 #ifdef _SC_AIO_LISTIO_MAX
5616 if (x
== _SC_AIO_LISTIO_MAX
)
5617 {*r
= Mono_Posix_SysconfName__SC_AIO_LISTIO_MAX
; return 0;}
5618 #endif /* ndef _SC_AIO_LISTIO_MAX */
5620 if (x
== _SC_AIO_MAX
)
5621 {*r
= Mono_Posix_SysconfName__SC_AIO_MAX
; return 0;}
5622 #endif /* ndef _SC_AIO_MAX */
5623 #ifdef _SC_AIO_PRIO_DELTA_MAX
5624 if (x
== _SC_AIO_PRIO_DELTA_MAX
)
5625 {*r
= Mono_Posix_SysconfName__SC_AIO_PRIO_DELTA_MAX
; return 0;}
5626 #endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
5628 if (x
== _SC_ARG_MAX
)
5629 {*r
= Mono_Posix_SysconfName__SC_ARG_MAX
; return 0;}
5630 #endif /* ndef _SC_ARG_MAX */
5631 #ifdef _SC_ASYNCHRONOUS_IO
5632 if (x
== _SC_ASYNCHRONOUS_IO
)
5633 {*r
= Mono_Posix_SysconfName__SC_ASYNCHRONOUS_IO
; return 0;}
5634 #endif /* ndef _SC_ASYNCHRONOUS_IO */
5635 #ifdef _SC_ATEXIT_MAX
5636 if (x
== _SC_ATEXIT_MAX
)
5637 {*r
= Mono_Posix_SysconfName__SC_ATEXIT_MAX
; return 0;}
5638 #endif /* ndef _SC_ATEXIT_MAX */
5639 #ifdef _SC_AVPHYS_PAGES
5640 if (x
== _SC_AVPHYS_PAGES
)
5641 {*r
= Mono_Posix_SysconfName__SC_AVPHYS_PAGES
; return 0;}
5642 #endif /* ndef _SC_AVPHYS_PAGES */
5644 if (x
== _SC_BARRIERS
)
5645 {*r
= Mono_Posix_SysconfName__SC_BARRIERS
; return 0;}
5646 #endif /* ndef _SC_BARRIERS */
5649 {*r
= Mono_Posix_SysconfName__SC_BASE
; return 0;}
5650 #endif /* ndef _SC_BASE */
5651 #ifdef _SC_BC_BASE_MAX
5652 if (x
== _SC_BC_BASE_MAX
)
5653 {*r
= Mono_Posix_SysconfName__SC_BC_BASE_MAX
; return 0;}
5654 #endif /* ndef _SC_BC_BASE_MAX */
5655 #ifdef _SC_BC_DIM_MAX
5656 if (x
== _SC_BC_DIM_MAX
)
5657 {*r
= Mono_Posix_SysconfName__SC_BC_DIM_MAX
; return 0;}
5658 #endif /* ndef _SC_BC_DIM_MAX */
5659 #ifdef _SC_BC_SCALE_MAX
5660 if (x
== _SC_BC_SCALE_MAX
)
5661 {*r
= Mono_Posix_SysconfName__SC_BC_SCALE_MAX
; return 0;}
5662 #endif /* ndef _SC_BC_SCALE_MAX */
5663 #ifdef _SC_BC_STRING_MAX
5664 if (x
== _SC_BC_STRING_MAX
)
5665 {*r
= Mono_Posix_SysconfName__SC_BC_STRING_MAX
; return 0;}
5666 #endif /* ndef _SC_BC_STRING_MAX */
5667 #ifdef _SC_CHARCLASS_NAME_MAX
5668 if (x
== _SC_CHARCLASS_NAME_MAX
)
5669 {*r
= Mono_Posix_SysconfName__SC_CHARCLASS_NAME_MAX
; return 0;}
5670 #endif /* ndef _SC_CHARCLASS_NAME_MAX */
5672 if (x
== _SC_CHAR_BIT
)
5673 {*r
= Mono_Posix_SysconfName__SC_CHAR_BIT
; return 0;}
5674 #endif /* ndef _SC_CHAR_BIT */
5676 if (x
== _SC_CHAR_MAX
)
5677 {*r
= Mono_Posix_SysconfName__SC_CHAR_MAX
; return 0;}
5678 #endif /* ndef _SC_CHAR_MAX */
5680 if (x
== _SC_CHAR_MIN
)
5681 {*r
= Mono_Posix_SysconfName__SC_CHAR_MIN
; return 0;}
5682 #endif /* ndef _SC_CHAR_MIN */
5683 #ifdef _SC_CHILD_MAX
5684 if (x
== _SC_CHILD_MAX
)
5685 {*r
= Mono_Posix_SysconfName__SC_CHILD_MAX
; return 0;}
5686 #endif /* ndef _SC_CHILD_MAX */
5688 if (x
== _SC_CLK_TCK
)
5689 {*r
= Mono_Posix_SysconfName__SC_CLK_TCK
; return 0;}
5690 #endif /* ndef _SC_CLK_TCK */
5691 #ifdef _SC_CLOCK_SELECTION
5692 if (x
== _SC_CLOCK_SELECTION
)
5693 {*r
= Mono_Posix_SysconfName__SC_CLOCK_SELECTION
; return 0;}
5694 #endif /* ndef _SC_CLOCK_SELECTION */
5695 #ifdef _SC_COLL_WEIGHTS_MAX
5696 if (x
== _SC_COLL_WEIGHTS_MAX
)
5697 {*r
= Mono_Posix_SysconfName__SC_COLL_WEIGHTS_MAX
; return 0;}
5698 #endif /* ndef _SC_COLL_WEIGHTS_MAX */
5700 if (x
== _SC_CPUTIME
)
5701 {*r
= Mono_Posix_SysconfName__SC_CPUTIME
; return 0;}
5702 #endif /* ndef _SC_CPUTIME */
5703 #ifdef _SC_C_LANG_SUPPORT
5704 if (x
== _SC_C_LANG_SUPPORT
)
5705 {*r
= Mono_Posix_SysconfName__SC_C_LANG_SUPPORT
; return 0;}
5706 #endif /* ndef _SC_C_LANG_SUPPORT */
5707 #ifdef _SC_C_LANG_SUPPORT_R
5708 if (x
== _SC_C_LANG_SUPPORT_R
)
5709 {*r
= Mono_Posix_SysconfName__SC_C_LANG_SUPPORT_R
; return 0;}
5710 #endif /* ndef _SC_C_LANG_SUPPORT_R */
5711 #ifdef _SC_DELAYTIMER_MAX
5712 if (x
== _SC_DELAYTIMER_MAX
)
5713 {*r
= Mono_Posix_SysconfName__SC_DELAYTIMER_MAX
; return 0;}
5714 #endif /* ndef _SC_DELAYTIMER_MAX */
5715 #ifdef _SC_DEVICE_IO
5716 if (x
== _SC_DEVICE_IO
)
5717 {*r
= Mono_Posix_SysconfName__SC_DEVICE_IO
; return 0;}
5718 #endif /* ndef _SC_DEVICE_IO */
5719 #ifdef _SC_DEVICE_SPECIFIC
5720 if (x
== _SC_DEVICE_SPECIFIC
)
5721 {*r
= Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC
; return 0;}
5722 #endif /* ndef _SC_DEVICE_SPECIFIC */
5723 #ifdef _SC_DEVICE_SPECIFIC_R
5724 if (x
== _SC_DEVICE_SPECIFIC_R
)
5725 {*r
= Mono_Posix_SysconfName__SC_DEVICE_SPECIFIC_R
; return 0;}
5726 #endif /* ndef _SC_DEVICE_SPECIFIC_R */
5727 #ifdef _SC_EQUIV_CLASS_MAX
5728 if (x
== _SC_EQUIV_CLASS_MAX
)
5729 {*r
= Mono_Posix_SysconfName__SC_EQUIV_CLASS_MAX
; return 0;}
5730 #endif /* ndef _SC_EQUIV_CLASS_MAX */
5731 #ifdef _SC_EXPR_NEST_MAX
5732 if (x
== _SC_EXPR_NEST_MAX
)
5733 {*r
= Mono_Posix_SysconfName__SC_EXPR_NEST_MAX
; return 0;}
5734 #endif /* ndef _SC_EXPR_NEST_MAX */
5736 if (x
== _SC_FD_MGMT
)
5737 {*r
= Mono_Posix_SysconfName__SC_FD_MGMT
; return 0;}
5738 #endif /* ndef _SC_FD_MGMT */
5741 {*r
= Mono_Posix_SysconfName__SC_FIFO
; return 0;}
5742 #endif /* ndef _SC_FIFO */
5743 #ifdef _SC_FILE_ATTRIBUTES
5744 if (x
== _SC_FILE_ATTRIBUTES
)
5745 {*r
= Mono_Posix_SysconfName__SC_FILE_ATTRIBUTES
; return 0;}
5746 #endif /* ndef _SC_FILE_ATTRIBUTES */
5747 #ifdef _SC_FILE_LOCKING
5748 if (x
== _SC_FILE_LOCKING
)
5749 {*r
= Mono_Posix_SysconfName__SC_FILE_LOCKING
; return 0;}
5750 #endif /* ndef _SC_FILE_LOCKING */
5751 #ifdef _SC_FILE_SYSTEM
5752 if (x
== _SC_FILE_SYSTEM
)
5753 {*r
= Mono_Posix_SysconfName__SC_FILE_SYSTEM
; return 0;}
5754 #endif /* ndef _SC_FILE_SYSTEM */
5757 {*r
= Mono_Posix_SysconfName__SC_FSYNC
; return 0;}
5758 #endif /* ndef _SC_FSYNC */
5759 #ifdef _SC_GETGR_R_SIZE_MAX
5760 if (x
== _SC_GETGR_R_SIZE_MAX
)
5761 {*r
= Mono_Posix_SysconfName__SC_GETGR_R_SIZE_MAX
; return 0;}
5762 #endif /* ndef _SC_GETGR_R_SIZE_MAX */
5763 #ifdef _SC_GETPW_R_SIZE_MAX
5764 if (x
== _SC_GETPW_R_SIZE_MAX
)
5765 {*r
= Mono_Posix_SysconfName__SC_GETPW_R_SIZE_MAX
; return 0;}
5766 #endif /* ndef _SC_GETPW_R_SIZE_MAX */
5767 #ifdef _SC_HOST_NAME_MAX
5768 if (x
== _SC_HOST_NAME_MAX
)
5769 {*r
= Mono_Posix_SysconfName__SC_HOST_NAME_MAX
; return 0;}
5770 #endif /* ndef _SC_HOST_NAME_MAX */
5772 if (x
== _SC_INT_MAX
)
5773 {*r
= Mono_Posix_SysconfName__SC_INT_MAX
; return 0;}
5774 #endif /* ndef _SC_INT_MAX */
5776 if (x
== _SC_INT_MIN
)
5777 {*r
= Mono_Posix_SysconfName__SC_INT_MIN
; return 0;}
5778 #endif /* ndef _SC_INT_MIN */
5780 if (x
== _SC_IOV_MAX
)
5781 {*r
= Mono_Posix_SysconfName__SC_IOV_MAX
; return 0;}
5782 #endif /* ndef _SC_IOV_MAX */
5783 #ifdef _SC_JOB_CONTROL
5784 if (x
== _SC_JOB_CONTROL
)
5785 {*r
= Mono_Posix_SysconfName__SC_JOB_CONTROL
; return 0;}
5786 #endif /* ndef _SC_JOB_CONTROL */
5787 #ifdef _SC_LEVEL1_DCACHE_ASSOC
5788 if (x
== _SC_LEVEL1_DCACHE_ASSOC
)
5789 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_ASSOC
; return 0;}
5790 #endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
5791 #ifdef _SC_LEVEL1_DCACHE_LINESIZE
5792 if (x
== _SC_LEVEL1_DCACHE_LINESIZE
)
5793 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_LINESIZE
; return 0;}
5794 #endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
5795 #ifdef _SC_LEVEL1_DCACHE_SIZE
5796 if (x
== _SC_LEVEL1_DCACHE_SIZE
)
5797 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_DCACHE_SIZE
; return 0;}
5798 #endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
5799 #ifdef _SC_LEVEL1_ICACHE_ASSOC
5800 if (x
== _SC_LEVEL1_ICACHE_ASSOC
)
5801 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_ASSOC
; return 0;}
5802 #endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
5803 #ifdef _SC_LEVEL1_ICACHE_LINESIZE
5804 if (x
== _SC_LEVEL1_ICACHE_LINESIZE
)
5805 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_LINESIZE
; return 0;}
5806 #endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
5807 #ifdef _SC_LEVEL1_ICACHE_SIZE
5808 if (x
== _SC_LEVEL1_ICACHE_SIZE
)
5809 {*r
= Mono_Posix_SysconfName__SC_LEVEL1_ICACHE_SIZE
; return 0;}
5810 #endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
5811 #ifdef _SC_LEVEL2_CACHE_ASSOC
5812 if (x
== _SC_LEVEL2_CACHE_ASSOC
)
5813 {*r
= Mono_Posix_SysconfName__SC_LEVEL2_CACHE_ASSOC
; return 0;}
5814 #endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
5815 #ifdef _SC_LEVEL2_CACHE_LINESIZE
5816 if (x
== _SC_LEVEL2_CACHE_LINESIZE
)
5817 {*r
= Mono_Posix_SysconfName__SC_LEVEL2_CACHE_LINESIZE
; return 0;}
5818 #endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
5819 #ifdef _SC_LEVEL2_CACHE_SIZE
5820 if (x
== _SC_LEVEL2_CACHE_SIZE
)
5821 {*r
= Mono_Posix_SysconfName__SC_LEVEL2_CACHE_SIZE
; return 0;}
5822 #endif /* ndef _SC_LEVEL2_CACHE_SIZE */
5823 #ifdef _SC_LEVEL3_CACHE_ASSOC
5824 if (x
== _SC_LEVEL3_CACHE_ASSOC
)
5825 {*r
= Mono_Posix_SysconfName__SC_LEVEL3_CACHE_ASSOC
; return 0;}
5826 #endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
5827 #ifdef _SC_LEVEL3_CACHE_LINESIZE
5828 if (x
== _SC_LEVEL3_CACHE_LINESIZE
)
5829 {*r
= Mono_Posix_SysconfName__SC_LEVEL3_CACHE_LINESIZE
; return 0;}
5830 #endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
5831 #ifdef _SC_LEVEL3_CACHE_SIZE
5832 if (x
== _SC_LEVEL3_CACHE_SIZE
)
5833 {*r
= Mono_Posix_SysconfName__SC_LEVEL3_CACHE_SIZE
; return 0;}
5834 #endif /* ndef _SC_LEVEL3_CACHE_SIZE */
5835 #ifdef _SC_LEVEL4_CACHE_ASSOC
5836 if (x
== _SC_LEVEL4_CACHE_ASSOC
)
5837 {*r
= Mono_Posix_SysconfName__SC_LEVEL4_CACHE_ASSOC
; return 0;}
5838 #endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
5839 #ifdef _SC_LEVEL4_CACHE_LINESIZE
5840 if (x
== _SC_LEVEL4_CACHE_LINESIZE
)
5841 {*r
= Mono_Posix_SysconfName__SC_LEVEL4_CACHE_LINESIZE
; return 0;}
5842 #endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
5843 #ifdef _SC_LEVEL4_CACHE_SIZE
5844 if (x
== _SC_LEVEL4_CACHE_SIZE
)
5845 {*r
= Mono_Posix_SysconfName__SC_LEVEL4_CACHE_SIZE
; return 0;}
5846 #endif /* ndef _SC_LEVEL4_CACHE_SIZE */
5848 if (x
== _SC_LINE_MAX
)
5849 {*r
= Mono_Posix_SysconfName__SC_LINE_MAX
; return 0;}
5850 #endif /* ndef _SC_LINE_MAX */
5851 #ifdef _SC_LOGIN_NAME_MAX
5852 if (x
== _SC_LOGIN_NAME_MAX
)
5853 {*r
= Mono_Posix_SysconfName__SC_LOGIN_NAME_MAX
; return 0;}
5854 #endif /* ndef _SC_LOGIN_NAME_MAX */
5856 if (x
== _SC_LONG_BIT
)
5857 {*r
= Mono_Posix_SysconfName__SC_LONG_BIT
; return 0;}
5858 #endif /* ndef _SC_LONG_BIT */
5859 #ifdef _SC_MAPPED_FILES
5860 if (x
== _SC_MAPPED_FILES
)
5861 {*r
= Mono_Posix_SysconfName__SC_MAPPED_FILES
; return 0;}
5862 #endif /* ndef _SC_MAPPED_FILES */
5863 #ifdef _SC_MB_LEN_MAX
5864 if (x
== _SC_MB_LEN_MAX
)
5865 {*r
= Mono_Posix_SysconfName__SC_MB_LEN_MAX
; return 0;}
5866 #endif /* ndef _SC_MB_LEN_MAX */
5868 if (x
== _SC_MEMLOCK
)
5869 {*r
= Mono_Posix_SysconfName__SC_MEMLOCK
; return 0;}
5870 #endif /* ndef _SC_MEMLOCK */
5871 #ifdef _SC_MEMLOCK_RANGE
5872 if (x
== _SC_MEMLOCK_RANGE
)
5873 {*r
= Mono_Posix_SysconfName__SC_MEMLOCK_RANGE
; return 0;}
5874 #endif /* ndef _SC_MEMLOCK_RANGE */
5875 #ifdef _SC_MEMORY_PROTECTION
5876 if (x
== _SC_MEMORY_PROTECTION
)
5877 {*r
= Mono_Posix_SysconfName__SC_MEMORY_PROTECTION
; return 0;}
5878 #endif /* ndef _SC_MEMORY_PROTECTION */
5879 #ifdef _SC_MESSAGE_PASSING
5880 if (x
== _SC_MESSAGE_PASSING
)
5881 {*r
= Mono_Posix_SysconfName__SC_MESSAGE_PASSING
; return 0;}
5882 #endif /* ndef _SC_MESSAGE_PASSING */
5883 #ifdef _SC_MONOTONIC_CLOCK
5884 if (x
== _SC_MONOTONIC_CLOCK
)
5885 {*r
= Mono_Posix_SysconfName__SC_MONOTONIC_CLOCK
; return 0;}
5886 #endif /* ndef _SC_MONOTONIC_CLOCK */
5887 #ifdef _SC_MQ_OPEN_MAX
5888 if (x
== _SC_MQ_OPEN_MAX
)
5889 {*r
= Mono_Posix_SysconfName__SC_MQ_OPEN_MAX
; return 0;}
5890 #endif /* ndef _SC_MQ_OPEN_MAX */
5891 #ifdef _SC_MQ_PRIO_MAX
5892 if (x
== _SC_MQ_PRIO_MAX
)
5893 {*r
= Mono_Posix_SysconfName__SC_MQ_PRIO_MAX
; return 0;}
5894 #endif /* ndef _SC_MQ_PRIO_MAX */
5895 #ifdef _SC_MULTI_PROCESS
5896 if (x
== _SC_MULTI_PROCESS
)
5897 {*r
= Mono_Posix_SysconfName__SC_MULTI_PROCESS
; return 0;}
5898 #endif /* ndef _SC_MULTI_PROCESS */
5899 #ifdef _SC_NETWORKING
5900 if (x
== _SC_NETWORKING
)
5901 {*r
= Mono_Posix_SysconfName__SC_NETWORKING
; return 0;}
5902 #endif /* ndef _SC_NETWORKING */
5903 #ifdef _SC_NGROUPS_MAX
5904 if (x
== _SC_NGROUPS_MAX
)
5905 {*r
= Mono_Posix_SysconfName__SC_NGROUPS_MAX
; return 0;}
5906 #endif /* ndef _SC_NGROUPS_MAX */
5907 #ifdef _SC_NL_ARGMAX
5908 if (x
== _SC_NL_ARGMAX
)
5909 {*r
= Mono_Posix_SysconfName__SC_NL_ARGMAX
; return 0;}
5910 #endif /* ndef _SC_NL_ARGMAX */
5911 #ifdef _SC_NL_LANGMAX
5912 if (x
== _SC_NL_LANGMAX
)
5913 {*r
= Mono_Posix_SysconfName__SC_NL_LANGMAX
; return 0;}
5914 #endif /* ndef _SC_NL_LANGMAX */
5915 #ifdef _SC_NL_MSGMAX
5916 if (x
== _SC_NL_MSGMAX
)
5917 {*r
= Mono_Posix_SysconfName__SC_NL_MSGMAX
; return 0;}
5918 #endif /* ndef _SC_NL_MSGMAX */
5920 if (x
== _SC_NL_NMAX
)
5921 {*r
= Mono_Posix_SysconfName__SC_NL_NMAX
; return 0;}
5922 #endif /* ndef _SC_NL_NMAX */
5923 #ifdef _SC_NL_SETMAX
5924 if (x
== _SC_NL_SETMAX
)
5925 {*r
= Mono_Posix_SysconfName__SC_NL_SETMAX
; return 0;}
5926 #endif /* ndef _SC_NL_SETMAX */
5927 #ifdef _SC_NL_TEXTMAX
5928 if (x
== _SC_NL_TEXTMAX
)
5929 {*r
= Mono_Posix_SysconfName__SC_NL_TEXTMAX
; return 0;}
5930 #endif /* ndef _SC_NL_TEXTMAX */
5931 #ifdef _SC_NPROCESSORS_CONF
5932 if (x
== _SC_NPROCESSORS_CONF
)
5933 {*r
= Mono_Posix_SysconfName__SC_NPROCESSORS_CONF
; return 0;}
5934 #endif /* ndef _SC_NPROCESSORS_CONF */
5935 #ifdef _SC_NPROCESSORS_ONLN
5936 if (x
== _SC_NPROCESSORS_ONLN
)
5937 {*r
= Mono_Posix_SysconfName__SC_NPROCESSORS_ONLN
; return 0;}
5938 #endif /* ndef _SC_NPROCESSORS_ONLN */
5941 {*r
= Mono_Posix_SysconfName__SC_NZERO
; return 0;}
5942 #endif /* ndef _SC_NZERO */
5944 if (x
== _SC_OPEN_MAX
)
5945 {*r
= Mono_Posix_SysconfName__SC_OPEN_MAX
; return 0;}
5946 #endif /* ndef _SC_OPEN_MAX */
5948 if (x
== _SC_PAGESIZE
)
5949 {*r
= Mono_Posix_SysconfName__SC_PAGESIZE
; return 0;}
5950 #endif /* ndef _SC_PAGESIZE */
5952 if (x
== _SC_PASS_MAX
)
5953 {*r
= Mono_Posix_SysconfName__SC_PASS_MAX
; return 0;}
5954 #endif /* ndef _SC_PASS_MAX */
5955 #ifdef _SC_PHYS_PAGES
5956 if (x
== _SC_PHYS_PAGES
)
5957 {*r
= Mono_Posix_SysconfName__SC_PHYS_PAGES
; return 0;}
5958 #endif /* ndef _SC_PHYS_PAGES */
5961 {*r
= Mono_Posix_SysconfName__SC_PII
; return 0;}
5962 #endif /* ndef _SC_PII */
5963 #ifdef _SC_PII_INTERNET
5964 if (x
== _SC_PII_INTERNET
)
5965 {*r
= Mono_Posix_SysconfName__SC_PII_INTERNET
; return 0;}
5966 #endif /* ndef _SC_PII_INTERNET */
5967 #ifdef _SC_PII_INTERNET_DGRAM
5968 if (x
== _SC_PII_INTERNET_DGRAM
)
5969 {*r
= Mono_Posix_SysconfName__SC_PII_INTERNET_DGRAM
; return 0;}
5970 #endif /* ndef _SC_PII_INTERNET_DGRAM */
5971 #ifdef _SC_PII_INTERNET_STREAM
5972 if (x
== _SC_PII_INTERNET_STREAM
)
5973 {*r
= Mono_Posix_SysconfName__SC_PII_INTERNET_STREAM
; return 0;}
5974 #endif /* ndef _SC_PII_INTERNET_STREAM */
5976 if (x
== _SC_PII_OSI
)
5977 {*r
= Mono_Posix_SysconfName__SC_PII_OSI
; return 0;}
5978 #endif /* ndef _SC_PII_OSI */
5979 #ifdef _SC_PII_OSI_CLTS
5980 if (x
== _SC_PII_OSI_CLTS
)
5981 {*r
= Mono_Posix_SysconfName__SC_PII_OSI_CLTS
; return 0;}
5982 #endif /* ndef _SC_PII_OSI_CLTS */
5983 #ifdef _SC_PII_OSI_COTS
5984 if (x
== _SC_PII_OSI_COTS
)
5985 {*r
= Mono_Posix_SysconfName__SC_PII_OSI_COTS
; return 0;}
5986 #endif /* ndef _SC_PII_OSI_COTS */
5987 #ifdef _SC_PII_OSI_M
5988 if (x
== _SC_PII_OSI_M
)
5989 {*r
= Mono_Posix_SysconfName__SC_PII_OSI_M
; return 0;}
5990 #endif /* ndef _SC_PII_OSI_M */
5991 #ifdef _SC_PII_SOCKET
5992 if (x
== _SC_PII_SOCKET
)
5993 {*r
= Mono_Posix_SysconfName__SC_PII_SOCKET
; return 0;}
5994 #endif /* ndef _SC_PII_SOCKET */
5996 if (x
== _SC_PII_XTI
)
5997 {*r
= Mono_Posix_SysconfName__SC_PII_XTI
; return 0;}
5998 #endif /* ndef _SC_PII_XTI */
6001 {*r
= Mono_Posix_SysconfName__SC_PIPE
; return 0;}
6002 #endif /* ndef _SC_PIPE */
6005 {*r
= Mono_Posix_SysconfName__SC_POLL
; return 0;}
6006 #endif /* ndef _SC_POLL */
6007 #ifdef _SC_PRIORITIZED_IO
6008 if (x
== _SC_PRIORITIZED_IO
)
6009 {*r
= Mono_Posix_SysconfName__SC_PRIORITIZED_IO
; return 0;}
6010 #endif /* ndef _SC_PRIORITIZED_IO */
6011 #ifdef _SC_PRIORITY_SCHEDULING
6012 if (x
== _SC_PRIORITY_SCHEDULING
)
6013 {*r
= Mono_Posix_SysconfName__SC_PRIORITY_SCHEDULING
; return 0;}
6014 #endif /* ndef _SC_PRIORITY_SCHEDULING */
6015 #ifdef _SC_READER_WRITER_LOCKS
6016 if (x
== _SC_READER_WRITER_LOCKS
)
6017 {*r
= Mono_Posix_SysconfName__SC_READER_WRITER_LOCKS
; return 0;}
6018 #endif /* ndef _SC_READER_WRITER_LOCKS */
6019 #ifdef _SC_REALTIME_SIGNALS
6020 if (x
== _SC_REALTIME_SIGNALS
)
6021 {*r
= Mono_Posix_SysconfName__SC_REALTIME_SIGNALS
; return 0;}
6022 #endif /* ndef _SC_REALTIME_SIGNALS */
6024 if (x
== _SC_REGEXP
)
6025 {*r
= Mono_Posix_SysconfName__SC_REGEXP
; return 0;}
6026 #endif /* ndef _SC_REGEXP */
6027 #ifdef _SC_REGEX_VERSION
6028 if (x
== _SC_REGEX_VERSION
)
6029 {*r
= Mono_Posix_SysconfName__SC_REGEX_VERSION
; return 0;}
6030 #endif /* ndef _SC_REGEX_VERSION */
6031 #ifdef _SC_RE_DUP_MAX
6032 if (x
== _SC_RE_DUP_MAX
)
6033 {*r
= Mono_Posix_SysconfName__SC_RE_DUP_MAX
; return 0;}
6034 #endif /* ndef _SC_RE_DUP_MAX */
6035 #ifdef _SC_RTSIG_MAX
6036 if (x
== _SC_RTSIG_MAX
)
6037 {*r
= Mono_Posix_SysconfName__SC_RTSIG_MAX
; return 0;}
6038 #endif /* ndef _SC_RTSIG_MAX */
6039 #ifdef _SC_SAVED_IDS
6040 if (x
== _SC_SAVED_IDS
)
6041 {*r
= Mono_Posix_SysconfName__SC_SAVED_IDS
; return 0;}
6042 #endif /* ndef _SC_SAVED_IDS */
6043 #ifdef _SC_SCHAR_MAX
6044 if (x
== _SC_SCHAR_MAX
)
6045 {*r
= Mono_Posix_SysconfName__SC_SCHAR_MAX
; return 0;}
6046 #endif /* ndef _SC_SCHAR_MAX */
6047 #ifdef _SC_SCHAR_MIN
6048 if (x
== _SC_SCHAR_MIN
)
6049 {*r
= Mono_Posix_SysconfName__SC_SCHAR_MIN
; return 0;}
6050 #endif /* ndef _SC_SCHAR_MIN */
6052 if (x
== _SC_SELECT
)
6053 {*r
= Mono_Posix_SysconfName__SC_SELECT
; return 0;}
6054 #endif /* ndef _SC_SELECT */
6055 #ifdef _SC_SEMAPHORES
6056 if (x
== _SC_SEMAPHORES
)
6057 {*r
= Mono_Posix_SysconfName__SC_SEMAPHORES
; return 0;}
6058 #endif /* ndef _SC_SEMAPHORES */
6059 #ifdef _SC_SEM_NSEMS_MAX
6060 if (x
== _SC_SEM_NSEMS_MAX
)
6061 {*r
= Mono_Posix_SysconfName__SC_SEM_NSEMS_MAX
; return 0;}
6062 #endif /* ndef _SC_SEM_NSEMS_MAX */
6063 #ifdef _SC_SEM_VALUE_MAX
6064 if (x
== _SC_SEM_VALUE_MAX
)
6065 {*r
= Mono_Posix_SysconfName__SC_SEM_VALUE_MAX
; return 0;}
6066 #endif /* ndef _SC_SEM_VALUE_MAX */
6067 #ifdef _SC_SHARED_MEMORY_OBJECTS
6068 if (x
== _SC_SHARED_MEMORY_OBJECTS
)
6069 {*r
= Mono_Posix_SysconfName__SC_SHARED_MEMORY_OBJECTS
; return 0;}
6070 #endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
6073 {*r
= Mono_Posix_SysconfName__SC_SHELL
; return 0;}
6074 #endif /* ndef _SC_SHELL */
6076 if (x
== _SC_SHRT_MAX
)
6077 {*r
= Mono_Posix_SysconfName__SC_SHRT_MAX
; return 0;}
6078 #endif /* ndef _SC_SHRT_MAX */
6080 if (x
== _SC_SHRT_MIN
)
6081 {*r
= Mono_Posix_SysconfName__SC_SHRT_MIN
; return 0;}
6082 #endif /* ndef _SC_SHRT_MIN */
6084 if (x
== _SC_SIGNALS
)
6085 {*r
= Mono_Posix_SysconfName__SC_SIGNALS
; return 0;}
6086 #endif /* ndef _SC_SIGNALS */
6087 #ifdef _SC_SIGQUEUE_MAX
6088 if (x
== _SC_SIGQUEUE_MAX
)
6089 {*r
= Mono_Posix_SysconfName__SC_SIGQUEUE_MAX
; return 0;}
6090 #endif /* ndef _SC_SIGQUEUE_MAX */
6091 #ifdef _SC_SINGLE_PROCESS
6092 if (x
== _SC_SINGLE_PROCESS
)
6093 {*r
= Mono_Posix_SysconfName__SC_SINGLE_PROCESS
; return 0;}
6094 #endif /* ndef _SC_SINGLE_PROCESS */
6097 {*r
= Mono_Posix_SysconfName__SC_SPAWN
; return 0;}
6098 #endif /* ndef _SC_SPAWN */
6099 #ifdef _SC_SPIN_LOCKS
6100 if (x
== _SC_SPIN_LOCKS
)
6101 {*r
= Mono_Posix_SysconfName__SC_SPIN_LOCKS
; return 0;}
6102 #endif /* ndef _SC_SPIN_LOCKS */
6103 #ifdef _SC_SPORADIC_SERVER
6104 if (x
== _SC_SPORADIC_SERVER
)
6105 {*r
= Mono_Posix_SysconfName__SC_SPORADIC_SERVER
; return 0;}
6106 #endif /* ndef _SC_SPORADIC_SERVER */
6107 #ifdef _SC_SSIZE_MAX
6108 if (x
== _SC_SSIZE_MAX
)
6109 {*r
= Mono_Posix_SysconfName__SC_SSIZE_MAX
; return 0;}
6110 #endif /* ndef _SC_SSIZE_MAX */
6112 if (x
== _SC_STREAMS
)
6113 {*r
= Mono_Posix_SysconfName__SC_STREAMS
; return 0;}
6114 #endif /* ndef _SC_STREAMS */
6115 #ifdef _SC_STREAM_MAX
6116 if (x
== _SC_STREAM_MAX
)
6117 {*r
= Mono_Posix_SysconfName__SC_STREAM_MAX
; return 0;}
6118 #endif /* ndef _SC_STREAM_MAX */
6119 #ifdef _SC_SYMLOOP_MAX
6120 if (x
== _SC_SYMLOOP_MAX
)
6121 {*r
= Mono_Posix_SysconfName__SC_SYMLOOP_MAX
; return 0;}
6122 #endif /* ndef _SC_SYMLOOP_MAX */
6123 #ifdef _SC_SYNCHRONIZED_IO
6124 if (x
== _SC_SYNCHRONIZED_IO
)
6125 {*r
= Mono_Posix_SysconfName__SC_SYNCHRONIZED_IO
; return 0;}
6126 #endif /* ndef _SC_SYNCHRONIZED_IO */
6127 #ifdef _SC_SYSTEM_DATABASE
6128 if (x
== _SC_SYSTEM_DATABASE
)
6129 {*r
= Mono_Posix_SysconfName__SC_SYSTEM_DATABASE
; return 0;}
6130 #endif /* ndef _SC_SYSTEM_DATABASE */
6131 #ifdef _SC_SYSTEM_DATABASE_R
6132 if (x
== _SC_SYSTEM_DATABASE_R
)
6133 {*r
= Mono_Posix_SysconfName__SC_SYSTEM_DATABASE_R
; return 0;}
6134 #endif /* ndef _SC_SYSTEM_DATABASE_R */
6136 if (x
== _SC_THREADS
)
6137 {*r
= Mono_Posix_SysconfName__SC_THREADS
; return 0;}
6138 #endif /* ndef _SC_THREADS */
6139 #ifdef _SC_THREAD_ATTR_STACKADDR
6140 if (x
== _SC_THREAD_ATTR_STACKADDR
)
6141 {*r
= Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKADDR
; return 0;}
6142 #endif /* ndef _SC_THREAD_ATTR_STACKADDR */
6143 #ifdef _SC_THREAD_ATTR_STACKSIZE
6144 if (x
== _SC_THREAD_ATTR_STACKSIZE
)
6145 {*r
= Mono_Posix_SysconfName__SC_THREAD_ATTR_STACKSIZE
; return 0;}
6146 #endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
6147 #ifdef _SC_THREAD_CPUTIME
6148 if (x
== _SC_THREAD_CPUTIME
)
6149 {*r
= Mono_Posix_SysconfName__SC_THREAD_CPUTIME
; return 0;}
6150 #endif /* ndef _SC_THREAD_CPUTIME */
6151 #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
6152 if (x
== _SC_THREAD_DESTRUCTOR_ITERATIONS
)
6153 {*r
= Mono_Posix_SysconfName__SC_THREAD_DESTRUCTOR_ITERATIONS
; return 0;}
6154 #endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
6155 #ifdef _SC_THREAD_KEYS_MAX
6156 if (x
== _SC_THREAD_KEYS_MAX
)
6157 {*r
= Mono_Posix_SysconfName__SC_THREAD_KEYS_MAX
; return 0;}
6158 #endif /* ndef _SC_THREAD_KEYS_MAX */
6159 #ifdef _SC_THREAD_PRIORITY_SCHEDULING
6160 if (x
== _SC_THREAD_PRIORITY_SCHEDULING
)
6161 {*r
= Mono_Posix_SysconfName__SC_THREAD_PRIORITY_SCHEDULING
; return 0;}
6162 #endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
6163 #ifdef _SC_THREAD_PRIO_INHERIT
6164 if (x
== _SC_THREAD_PRIO_INHERIT
)
6165 {*r
= Mono_Posix_SysconfName__SC_THREAD_PRIO_INHERIT
; return 0;}
6166 #endif /* ndef _SC_THREAD_PRIO_INHERIT */
6167 #ifdef _SC_THREAD_PRIO_PROTECT
6168 if (x
== _SC_THREAD_PRIO_PROTECT
)
6169 {*r
= Mono_Posix_SysconfName__SC_THREAD_PRIO_PROTECT
; return 0;}
6170 #endif /* ndef _SC_THREAD_PRIO_PROTECT */
6171 #ifdef _SC_THREAD_PROCESS_SHARED
6172 if (x
== _SC_THREAD_PROCESS_SHARED
)
6173 {*r
= Mono_Posix_SysconfName__SC_THREAD_PROCESS_SHARED
; return 0;}
6174 #endif /* ndef _SC_THREAD_PROCESS_SHARED */
6175 #ifdef _SC_THREAD_SAFE_FUNCTIONS
6176 if (x
== _SC_THREAD_SAFE_FUNCTIONS
)
6177 {*r
= Mono_Posix_SysconfName__SC_THREAD_SAFE_FUNCTIONS
; return 0;}
6178 #endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
6179 #ifdef _SC_THREAD_SPORADIC_SERVER
6180 if (x
== _SC_THREAD_SPORADIC_SERVER
)
6181 {*r
= Mono_Posix_SysconfName__SC_THREAD_SPORADIC_SERVER
; return 0;}
6182 #endif /* ndef _SC_THREAD_SPORADIC_SERVER */
6183 #ifdef _SC_THREAD_STACK_MIN
6184 if (x
== _SC_THREAD_STACK_MIN
)
6185 {*r
= Mono_Posix_SysconfName__SC_THREAD_STACK_MIN
; return 0;}
6186 #endif /* ndef _SC_THREAD_STACK_MIN */
6187 #ifdef _SC_THREAD_THREADS_MAX
6188 if (x
== _SC_THREAD_THREADS_MAX
)
6189 {*r
= Mono_Posix_SysconfName__SC_THREAD_THREADS_MAX
; return 0;}
6190 #endif /* ndef _SC_THREAD_THREADS_MAX */
6192 if (x
== _SC_TIMEOUTS
)
6193 {*r
= Mono_Posix_SysconfName__SC_TIMEOUTS
; return 0;}
6194 #endif /* ndef _SC_TIMEOUTS */
6196 if (x
== _SC_TIMERS
)
6197 {*r
= Mono_Posix_SysconfName__SC_TIMERS
; return 0;}
6198 #endif /* ndef _SC_TIMERS */
6199 #ifdef _SC_TIMER_MAX
6200 if (x
== _SC_TIMER_MAX
)
6201 {*r
= Mono_Posix_SysconfName__SC_TIMER_MAX
; return 0;}
6202 #endif /* ndef _SC_TIMER_MAX */
6205 {*r
= Mono_Posix_SysconfName__SC_TRACE
; return 0;}
6206 #endif /* ndef _SC_TRACE */
6207 #ifdef _SC_TRACE_EVENT_FILTER
6208 if (x
== _SC_TRACE_EVENT_FILTER
)
6209 {*r
= Mono_Posix_SysconfName__SC_TRACE_EVENT_FILTER
; return 0;}
6210 #endif /* ndef _SC_TRACE_EVENT_FILTER */
6211 #ifdef _SC_TRACE_INHERIT
6212 if (x
== _SC_TRACE_INHERIT
)
6213 {*r
= Mono_Posix_SysconfName__SC_TRACE_INHERIT
; return 0;}
6214 #endif /* ndef _SC_TRACE_INHERIT */
6215 #ifdef _SC_TRACE_LOG
6216 if (x
== _SC_TRACE_LOG
)
6217 {*r
= Mono_Posix_SysconfName__SC_TRACE_LOG
; return 0;}
6218 #endif /* ndef _SC_TRACE_LOG */
6219 #ifdef _SC_TTY_NAME_MAX
6220 if (x
== _SC_TTY_NAME_MAX
)
6221 {*r
= Mono_Posix_SysconfName__SC_TTY_NAME_MAX
; return 0;}
6222 #endif /* ndef _SC_TTY_NAME_MAX */
6223 #ifdef _SC_TYPED_MEMORY_OBJECTS
6224 if (x
== _SC_TYPED_MEMORY_OBJECTS
)
6225 {*r
= Mono_Posix_SysconfName__SC_TYPED_MEMORY_OBJECTS
; return 0;}
6226 #endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
6227 #ifdef _SC_TZNAME_MAX
6228 if (x
== _SC_TZNAME_MAX
)
6229 {*r
= Mono_Posix_SysconfName__SC_TZNAME_MAX
; return 0;}
6230 #endif /* ndef _SC_TZNAME_MAX */
6231 #ifdef _SC_T_IOV_MAX
6232 if (x
== _SC_T_IOV_MAX
)
6233 {*r
= Mono_Posix_SysconfName__SC_T_IOV_MAX
; return 0;}
6234 #endif /* ndef _SC_T_IOV_MAX */
6235 #ifdef _SC_UCHAR_MAX
6236 if (x
== _SC_UCHAR_MAX
)
6237 {*r
= Mono_Posix_SysconfName__SC_UCHAR_MAX
; return 0;}
6238 #endif /* ndef _SC_UCHAR_MAX */
6240 if (x
== _SC_UINT_MAX
)
6241 {*r
= Mono_Posix_SysconfName__SC_UINT_MAX
; return 0;}
6242 #endif /* ndef _SC_UINT_MAX */
6243 #ifdef _SC_UIO_MAXIOV
6244 if (x
== _SC_UIO_MAXIOV
)
6245 {*r
= Mono_Posix_SysconfName__SC_UIO_MAXIOV
; return 0;}
6246 #endif /* ndef _SC_UIO_MAXIOV */
6247 #ifdef _SC_ULONG_MAX
6248 if (x
== _SC_ULONG_MAX
)
6249 {*r
= Mono_Posix_SysconfName__SC_ULONG_MAX
; return 0;}
6250 #endif /* ndef _SC_ULONG_MAX */
6251 #ifdef _SC_USER_GROUPS
6252 if (x
== _SC_USER_GROUPS
)
6253 {*r
= Mono_Posix_SysconfName__SC_USER_GROUPS
; return 0;}
6254 #endif /* ndef _SC_USER_GROUPS */
6255 #ifdef _SC_USER_GROUPS_R
6256 if (x
== _SC_USER_GROUPS_R
)
6257 {*r
= Mono_Posix_SysconfName__SC_USER_GROUPS_R
; return 0;}
6258 #endif /* ndef _SC_USER_GROUPS_R */
6259 #ifdef _SC_USHRT_MAX
6260 if (x
== _SC_USHRT_MAX
)
6261 {*r
= Mono_Posix_SysconfName__SC_USHRT_MAX
; return 0;}
6262 #endif /* ndef _SC_USHRT_MAX */
6263 #ifdef _SC_V6_ILP32_OFF32
6264 if (x
== _SC_V6_ILP32_OFF32
)
6265 {*r
= Mono_Posix_SysconfName__SC_V6_ILP32_OFF32
; return 0;}
6266 #endif /* ndef _SC_V6_ILP32_OFF32 */
6267 #ifdef _SC_V6_ILP32_OFFBIG
6268 if (x
== _SC_V6_ILP32_OFFBIG
)
6269 {*r
= Mono_Posix_SysconfName__SC_V6_ILP32_OFFBIG
; return 0;}
6270 #endif /* ndef _SC_V6_ILP32_OFFBIG */
6271 #ifdef _SC_V6_LP64_OFF64
6272 if (x
== _SC_V6_LP64_OFF64
)
6273 {*r
= Mono_Posix_SysconfName__SC_V6_LP64_OFF64
; return 0;}
6274 #endif /* ndef _SC_V6_LP64_OFF64 */
6275 #ifdef _SC_V6_LPBIG_OFFBIG
6276 if (x
== _SC_V6_LPBIG_OFFBIG
)
6277 {*r
= Mono_Posix_SysconfName__SC_V6_LPBIG_OFFBIG
; return 0;}
6278 #endif /* ndef _SC_V6_LPBIG_OFFBIG */
6280 if (x
== _SC_VERSION
)
6281 {*r
= Mono_Posix_SysconfName__SC_VERSION
; return 0;}
6282 #endif /* ndef _SC_VERSION */
6284 if (x
== _SC_WORD_BIT
)
6285 {*r
= Mono_Posix_SysconfName__SC_WORD_BIT
; return 0;}
6286 #endif /* ndef _SC_WORD_BIT */
6287 #ifdef _SC_XBS5_ILP32_OFF32
6288 if (x
== _SC_XBS5_ILP32_OFF32
)
6289 {*r
= Mono_Posix_SysconfName__SC_XBS5_ILP32_OFF32
; return 0;}
6290 #endif /* ndef _SC_XBS5_ILP32_OFF32 */
6291 #ifdef _SC_XBS5_ILP32_OFFBIG
6292 if (x
== _SC_XBS5_ILP32_OFFBIG
)
6293 {*r
= Mono_Posix_SysconfName__SC_XBS5_ILP32_OFFBIG
; return 0;}
6294 #endif /* ndef _SC_XBS5_ILP32_OFFBIG */
6295 #ifdef _SC_XBS5_LP64_OFF64
6296 if (x
== _SC_XBS5_LP64_OFF64
)
6297 {*r
= Mono_Posix_SysconfName__SC_XBS5_LP64_OFF64
; return 0;}
6298 #endif /* ndef _SC_XBS5_LP64_OFF64 */
6299 #ifdef _SC_XBS5_LPBIG_OFFBIG
6300 if (x
== _SC_XBS5_LPBIG_OFFBIG
)
6301 {*r
= Mono_Posix_SysconfName__SC_XBS5_LPBIG_OFFBIG
; return 0;}
6302 #endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
6303 #ifdef _SC_XOPEN_CRYPT
6304 if (x
== _SC_XOPEN_CRYPT
)
6305 {*r
= Mono_Posix_SysconfName__SC_XOPEN_CRYPT
; return 0;}
6306 #endif /* ndef _SC_XOPEN_CRYPT */
6307 #ifdef _SC_XOPEN_ENH_I18N
6308 if (x
== _SC_XOPEN_ENH_I18N
)
6309 {*r
= Mono_Posix_SysconfName__SC_XOPEN_ENH_I18N
; return 0;}
6310 #endif /* ndef _SC_XOPEN_ENH_I18N */
6311 #ifdef _SC_XOPEN_LEGACY
6312 if (x
== _SC_XOPEN_LEGACY
)
6313 {*r
= Mono_Posix_SysconfName__SC_XOPEN_LEGACY
; return 0;}
6314 #endif /* ndef _SC_XOPEN_LEGACY */
6315 #ifdef _SC_XOPEN_REALTIME
6316 if (x
== _SC_XOPEN_REALTIME
)
6317 {*r
= Mono_Posix_SysconfName__SC_XOPEN_REALTIME
; return 0;}
6318 #endif /* ndef _SC_XOPEN_REALTIME */
6319 #ifdef _SC_XOPEN_REALTIME_THREADS
6320 if (x
== _SC_XOPEN_REALTIME_THREADS
)
6321 {*r
= Mono_Posix_SysconfName__SC_XOPEN_REALTIME_THREADS
; return 0;}
6322 #endif /* ndef _SC_XOPEN_REALTIME_THREADS */
6323 #ifdef _SC_XOPEN_SHM
6324 if (x
== _SC_XOPEN_SHM
)
6325 {*r
= Mono_Posix_SysconfName__SC_XOPEN_SHM
; return 0;}
6326 #endif /* ndef _SC_XOPEN_SHM */
6327 #ifdef _SC_XOPEN_UNIX
6328 if (x
== _SC_XOPEN_UNIX
)
6329 {*r
= Mono_Posix_SysconfName__SC_XOPEN_UNIX
; return 0;}
6330 #endif /* ndef _SC_XOPEN_UNIX */
6331 #ifdef _SC_XOPEN_VERSION
6332 if (x
== _SC_XOPEN_VERSION
)
6333 {*r
= Mono_Posix_SysconfName__SC_XOPEN_VERSION
; return 0;}
6334 #endif /* ndef _SC_XOPEN_VERSION */
6335 #ifdef _SC_XOPEN_XCU_VERSION
6336 if (x
== _SC_XOPEN_XCU_VERSION
)
6337 {*r
= Mono_Posix_SysconfName__SC_XOPEN_XCU_VERSION
; return 0;}
6338 #endif /* ndef _SC_XOPEN_XCU_VERSION */
6339 #ifdef _SC_XOPEN_XPG2
6340 if (x
== _SC_XOPEN_XPG2
)
6341 {*r
= Mono_Posix_SysconfName__SC_XOPEN_XPG2
; return 0;}
6342 #endif /* ndef _SC_XOPEN_XPG2 */
6343 #ifdef _SC_XOPEN_XPG3
6344 if (x
== _SC_XOPEN_XPG3
)
6345 {*r
= Mono_Posix_SysconfName__SC_XOPEN_XPG3
; return 0;}
6346 #endif /* ndef _SC_XOPEN_XPG3 */
6347 #ifdef _SC_XOPEN_XPG4
6348 if (x
== _SC_XOPEN_XPG4
)
6349 {*r
= Mono_Posix_SysconfName__SC_XOPEN_XPG4
; return 0;}
6350 #endif /* ndef _SC_XOPEN_XPG4 */
6351 errno
= EINVAL
; return -1;
6354 int Mono_Posix_FromSyslogFacility (int x
, int *r
)
6357 if (x
== Mono_Posix_SyslogFacility_LOG_AUTH
)
6359 {*r
= LOG_AUTH
; return 0;}
6360 #else /* def LOG_AUTH */
6361 {errno
= EINVAL
; return -1;}
6362 #endif /* ndef LOG_AUTH */
6363 if (x
== Mono_Posix_SyslogFacility_LOG_AUTHPRIV
)
6365 {*r
= LOG_AUTHPRIV
; return 0;}
6366 #else /* def LOG_AUTHPRIV */
6367 {errno
= EINVAL
; return -1;}
6368 #endif /* ndef LOG_AUTHPRIV */
6369 if (x
== Mono_Posix_SyslogFacility_LOG_CRON
)
6371 {*r
= LOG_CRON
; return 0;}
6372 #else /* def LOG_CRON */
6373 {errno
= EINVAL
; return -1;}
6374 #endif /* ndef LOG_CRON */
6375 if (x
== Mono_Posix_SyslogFacility_LOG_DAEMON
)
6377 {*r
= LOG_DAEMON
; return 0;}
6378 #else /* def LOG_DAEMON */
6379 {errno
= EINVAL
; return -1;}
6380 #endif /* ndef LOG_DAEMON */
6381 if (x
== Mono_Posix_SyslogFacility_LOG_FTP
)
6383 {*r
= LOG_FTP
; return 0;}
6384 #else /* def LOG_FTP */
6385 {errno
= EINVAL
; return -1;}
6386 #endif /* ndef LOG_FTP */
6387 if (x
== Mono_Posix_SyslogFacility_LOG_KERN
)
6389 {*r
= LOG_KERN
; return 0;}
6390 #else /* def LOG_KERN */
6391 {errno
= EINVAL
; return -1;}
6392 #endif /* ndef LOG_KERN */
6393 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL0
)
6395 {*r
= LOG_LOCAL0
; return 0;}
6396 #else /* def LOG_LOCAL0 */
6397 {errno
= EINVAL
; return -1;}
6398 #endif /* ndef LOG_LOCAL0 */
6399 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL1
)
6401 {*r
= LOG_LOCAL1
; return 0;}
6402 #else /* def LOG_LOCAL1 */
6403 {errno
= EINVAL
; return -1;}
6404 #endif /* ndef LOG_LOCAL1 */
6405 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL2
)
6407 {*r
= LOG_LOCAL2
; return 0;}
6408 #else /* def LOG_LOCAL2 */
6409 {errno
= EINVAL
; return -1;}
6410 #endif /* ndef LOG_LOCAL2 */
6411 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL3
)
6413 {*r
= LOG_LOCAL3
; return 0;}
6414 #else /* def LOG_LOCAL3 */
6415 {errno
= EINVAL
; return -1;}
6416 #endif /* ndef LOG_LOCAL3 */
6417 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL4
)
6419 {*r
= LOG_LOCAL4
; return 0;}
6420 #else /* def LOG_LOCAL4 */
6421 {errno
= EINVAL
; return -1;}
6422 #endif /* ndef LOG_LOCAL4 */
6423 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL5
)
6425 {*r
= LOG_LOCAL5
; return 0;}
6426 #else /* def LOG_LOCAL5 */
6427 {errno
= EINVAL
; return -1;}
6428 #endif /* ndef LOG_LOCAL5 */
6429 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL6
)
6431 {*r
= LOG_LOCAL6
; return 0;}
6432 #else /* def LOG_LOCAL6 */
6433 {errno
= EINVAL
; return -1;}
6434 #endif /* ndef LOG_LOCAL6 */
6435 if (x
== Mono_Posix_SyslogFacility_LOG_LOCAL7
)
6437 {*r
= LOG_LOCAL7
; return 0;}
6438 #else /* def LOG_LOCAL7 */
6439 {errno
= EINVAL
; return -1;}
6440 #endif /* ndef LOG_LOCAL7 */
6441 if (x
== Mono_Posix_SyslogFacility_LOG_LPR
)
6443 {*r
= LOG_LPR
; return 0;}
6444 #else /* def LOG_LPR */
6445 {errno
= EINVAL
; return -1;}
6446 #endif /* ndef LOG_LPR */
6447 if (x
== Mono_Posix_SyslogFacility_LOG_MAIL
)
6449 {*r
= LOG_MAIL
; return 0;}
6450 #else /* def LOG_MAIL */
6451 {errno
= EINVAL
; return -1;}
6452 #endif /* ndef LOG_MAIL */
6453 if (x
== Mono_Posix_SyslogFacility_LOG_NEWS
)
6455 {*r
= LOG_NEWS
; return 0;}
6456 #else /* def LOG_NEWS */
6457 {errno
= EINVAL
; return -1;}
6458 #endif /* ndef LOG_NEWS */
6459 if (x
== Mono_Posix_SyslogFacility_LOG_SYSLOG
)
6461 {*r
= LOG_SYSLOG
; return 0;}
6462 #else /* def LOG_SYSLOG */
6463 {errno
= EINVAL
; return -1;}
6464 #endif /* ndef LOG_SYSLOG */
6465 if (x
== Mono_Posix_SyslogFacility_LOG_USER
)
6467 {*r
= LOG_USER
; return 0;}
6468 #else /* def LOG_USER */
6469 {errno
= EINVAL
; return -1;}
6470 #endif /* ndef LOG_USER */
6471 if (x
== Mono_Posix_SyslogFacility_LOG_UUCP
)
6473 {*r
= LOG_UUCP
; return 0;}
6474 #else /* def LOG_UUCP */
6475 {errno
= EINVAL
; return -1;}
6476 #endif /* ndef LOG_UUCP */
6479 errno
= EINVAL
; return -1;
6482 int Mono_Posix_ToSyslogFacility (int x
, int *r
)
6489 {*r
= Mono_Posix_SyslogFacility_LOG_AUTH
; return 0;}
6490 #endif /* ndef LOG_AUTH */
6492 if (x
== LOG_AUTHPRIV
)
6493 {*r
= Mono_Posix_SyslogFacility_LOG_AUTHPRIV
; return 0;}
6494 #endif /* ndef LOG_AUTHPRIV */
6497 {*r
= Mono_Posix_SyslogFacility_LOG_CRON
; return 0;}
6498 #endif /* ndef LOG_CRON */
6500 if (x
== LOG_DAEMON
)
6501 {*r
= Mono_Posix_SyslogFacility_LOG_DAEMON
; return 0;}
6502 #endif /* ndef LOG_DAEMON */
6505 {*r
= Mono_Posix_SyslogFacility_LOG_FTP
; return 0;}
6506 #endif /* ndef LOG_FTP */
6509 {*r
= Mono_Posix_SyslogFacility_LOG_KERN
; return 0;}
6510 #endif /* ndef LOG_KERN */
6512 if (x
== LOG_LOCAL0
)
6513 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL0
; return 0;}
6514 #endif /* ndef LOG_LOCAL0 */
6516 if (x
== LOG_LOCAL1
)
6517 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL1
; return 0;}
6518 #endif /* ndef LOG_LOCAL1 */
6520 if (x
== LOG_LOCAL2
)
6521 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL2
; return 0;}
6522 #endif /* ndef LOG_LOCAL2 */
6524 if (x
== LOG_LOCAL3
)
6525 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL3
; return 0;}
6526 #endif /* ndef LOG_LOCAL3 */
6528 if (x
== LOG_LOCAL4
)
6529 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL4
; return 0;}
6530 #endif /* ndef LOG_LOCAL4 */
6532 if (x
== LOG_LOCAL5
)
6533 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL5
; return 0;}
6534 #endif /* ndef LOG_LOCAL5 */
6536 if (x
== LOG_LOCAL6
)
6537 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL6
; return 0;}
6538 #endif /* ndef LOG_LOCAL6 */
6540 if (x
== LOG_LOCAL7
)
6541 {*r
= Mono_Posix_SyslogFacility_LOG_LOCAL7
; return 0;}
6542 #endif /* ndef LOG_LOCAL7 */
6545 {*r
= Mono_Posix_SyslogFacility_LOG_LPR
; return 0;}
6546 #endif /* ndef LOG_LPR */
6549 {*r
= Mono_Posix_SyslogFacility_LOG_MAIL
; return 0;}
6550 #endif /* ndef LOG_MAIL */
6553 {*r
= Mono_Posix_SyslogFacility_LOG_NEWS
; return 0;}
6554 #endif /* ndef LOG_NEWS */
6556 if (x
== LOG_SYSLOG
)
6557 {*r
= Mono_Posix_SyslogFacility_LOG_SYSLOG
; return 0;}
6558 #endif /* ndef LOG_SYSLOG */
6561 {*r
= Mono_Posix_SyslogFacility_LOG_USER
; return 0;}
6562 #endif /* ndef LOG_USER */
6565 {*r
= Mono_Posix_SyslogFacility_LOG_UUCP
; return 0;}
6566 #endif /* ndef LOG_UUCP */
6567 errno
= EINVAL
; return -1;
6570 int Mono_Posix_FromSyslogLevel (int x
, int *r
)
6573 if (x
== Mono_Posix_SyslogLevel_LOG_ALERT
)
6575 {*r
= LOG_ALERT
; return 0;}
6576 #else /* def LOG_ALERT */
6577 {errno
= EINVAL
; return -1;}
6578 #endif /* ndef LOG_ALERT */
6579 if (x
== Mono_Posix_SyslogLevel_LOG_CRIT
)
6581 {*r
= LOG_CRIT
; return 0;}
6582 #else /* def LOG_CRIT */
6583 {errno
= EINVAL
; return -1;}
6584 #endif /* ndef LOG_CRIT */
6585 if (x
== Mono_Posix_SyslogLevel_LOG_DEBUG
)
6587 {*r
= LOG_DEBUG
; return 0;}
6588 #else /* def LOG_DEBUG */
6589 {errno
= EINVAL
; return -1;}
6590 #endif /* ndef LOG_DEBUG */
6591 if (x
== Mono_Posix_SyslogLevel_LOG_EMERG
)
6593 {*r
= LOG_EMERG
; return 0;}
6594 #else /* def LOG_EMERG */
6595 {errno
= EINVAL
; return -1;}
6596 #endif /* ndef LOG_EMERG */
6597 if (x
== Mono_Posix_SyslogLevel_LOG_ERR
)
6599 {*r
= LOG_ERR
; return 0;}
6600 #else /* def LOG_ERR */
6601 {errno
= EINVAL
; return -1;}
6602 #endif /* ndef LOG_ERR */
6603 if (x
== Mono_Posix_SyslogLevel_LOG_INFO
)
6605 {*r
= LOG_INFO
; return 0;}
6606 #else /* def LOG_INFO */
6607 {errno
= EINVAL
; return -1;}
6608 #endif /* ndef LOG_INFO */
6609 if (x
== Mono_Posix_SyslogLevel_LOG_NOTICE
)
6611 {*r
= LOG_NOTICE
; return 0;}
6612 #else /* def LOG_NOTICE */
6613 {errno
= EINVAL
; return -1;}
6614 #endif /* ndef LOG_NOTICE */
6615 if (x
== Mono_Posix_SyslogLevel_LOG_WARNING
)
6617 {*r
= LOG_WARNING
; return 0;}
6618 #else /* def LOG_WARNING */
6619 {errno
= EINVAL
; return -1;}
6620 #endif /* ndef LOG_WARNING */
6623 errno
= EINVAL
; return -1;
6626 int Mono_Posix_ToSyslogLevel (int x
, int *r
)
6633 {*r
= Mono_Posix_SyslogLevel_LOG_ALERT
; return 0;}
6634 #endif /* ndef LOG_ALERT */
6637 {*r
= Mono_Posix_SyslogLevel_LOG_CRIT
; return 0;}
6638 #endif /* ndef LOG_CRIT */
6641 {*r
= Mono_Posix_SyslogLevel_LOG_DEBUG
; return 0;}
6642 #endif /* ndef LOG_DEBUG */
6645 {*r
= Mono_Posix_SyslogLevel_LOG_EMERG
; return 0;}
6646 #endif /* ndef LOG_EMERG */
6649 {*r
= Mono_Posix_SyslogLevel_LOG_ERR
; return 0;}
6650 #endif /* ndef LOG_ERR */
6653 {*r
= Mono_Posix_SyslogLevel_LOG_INFO
; return 0;}
6654 #endif /* ndef LOG_INFO */
6656 if (x
== LOG_NOTICE
)
6657 {*r
= Mono_Posix_SyslogLevel_LOG_NOTICE
; return 0;}
6658 #endif /* ndef LOG_NOTICE */
6660 if (x
== LOG_WARNING
)
6661 {*r
= Mono_Posix_SyslogLevel_LOG_WARNING
; return 0;}
6662 #endif /* ndef LOG_WARNING */
6663 errno
= EINVAL
; return -1;
6666 int Mono_Posix_FromSyslogOptions (int x
, int *r
)
6669 if ((x
& Mono_Posix_SyslogOptions_LOG_CONS
) == Mono_Posix_SyslogOptions_LOG_CONS
)
6672 #else /* def LOG_CONS */
6673 {errno
= EINVAL
; return -1;}
6674 #endif /* ndef LOG_CONS */
6675 if ((x
& Mono_Posix_SyslogOptions_LOG_NDELAY
) == Mono_Posix_SyslogOptions_LOG_NDELAY
)
6678 #else /* def LOG_NDELAY */
6679 {errno
= EINVAL
; return -1;}
6680 #endif /* ndef LOG_NDELAY */
6681 if ((x
& Mono_Posix_SyslogOptions_LOG_NOWAIT
) == Mono_Posix_SyslogOptions_LOG_NOWAIT
)
6684 #else /* def LOG_NOWAIT */
6685 {errno
= EINVAL
; return -1;}
6686 #endif /* ndef LOG_NOWAIT */
6687 if ((x
& Mono_Posix_SyslogOptions_LOG_ODELAY
) == Mono_Posix_SyslogOptions_LOG_ODELAY
)
6690 #else /* def LOG_ODELAY */
6691 {errno
= EINVAL
; return -1;}
6692 #endif /* ndef LOG_ODELAY */
6693 if ((x
& Mono_Posix_SyslogOptions_LOG_PERROR
) == Mono_Posix_SyslogOptions_LOG_PERROR
)
6696 #else /* def LOG_PERROR */
6697 {errno
= EINVAL
; return -1;}
6698 #endif /* ndef LOG_PERROR */
6699 if ((x
& Mono_Posix_SyslogOptions_LOG_PID
) == Mono_Posix_SyslogOptions_LOG_PID
)
6702 #else /* def LOG_PID */
6703 {errno
= EINVAL
; return -1;}
6704 #endif /* ndef LOG_PID */
6710 int Mono_Posix_ToSyslogOptions (int x
, int *r
)
6716 if ((x
& LOG_CONS
) == LOG_CONS
)
6717 *r
|= Mono_Posix_SyslogOptions_LOG_CONS
;
6718 #endif /* ndef LOG_CONS */
6720 if ((x
& LOG_NDELAY
) == LOG_NDELAY
)
6721 *r
|= Mono_Posix_SyslogOptions_LOG_NDELAY
;
6722 #endif /* ndef LOG_NDELAY */
6724 if ((x
& LOG_NOWAIT
) == LOG_NOWAIT
)
6725 *r
|= Mono_Posix_SyslogOptions_LOG_NOWAIT
;
6726 #endif /* ndef LOG_NOWAIT */
6728 if ((x
& LOG_ODELAY
) == LOG_ODELAY
)
6729 *r
|= Mono_Posix_SyslogOptions_LOG_ODELAY
;
6730 #endif /* ndef LOG_ODELAY */
6732 if ((x
& LOG_PERROR
) == LOG_PERROR
)
6733 *r
|= Mono_Posix_SyslogOptions_LOG_PERROR
;
6734 #endif /* ndef LOG_PERROR */
6736 if ((x
& LOG_PID
) == LOG_PID
)
6737 *r
|= Mono_Posix_SyslogOptions_LOG_PID
;
6738 #endif /* ndef LOG_PID */
6742 #ifdef HAVE_STRUCT_TIMEVAL
6744 Mono_Posix_FromTimeval (struct Mono_Posix_Timeval
*from
, struct timeval
*to
)
6746 _cnm_return_val_if_overflow (time_t, from
->tv_sec
, -1);
6747 _cnm_return_val_if_overflow (suseconds_t
, from
->tv_usec
, -1);
6749 memset (to
, 0, sizeof(*to
));
6751 to
->tv_sec
= from
->tv_sec
;
6752 to
->tv_usec
= from
->tv_usec
;
6756 #endif /* ndef HAVE_STRUCT_TIMEVAL */
6759 #ifdef HAVE_STRUCT_TIMEVAL
6761 Mono_Posix_ToTimeval (struct timeval
*from
, struct Mono_Posix_Timeval
*to
)
6763 _cnm_return_val_if_overflow (gint64
, from
->tv_sec
, -1);
6764 _cnm_return_val_if_overflow (gint64
, from
->tv_usec
, -1);
6766 memset (to
, 0, sizeof(*to
));
6768 to
->tv_sec
= from
->tv_sec
;
6769 to
->tv_usec
= from
->tv_usec
;
6773 #endif /* ndef HAVE_STRUCT_TIMEVAL */
6776 #ifdef HAVE_STRUCT_TIMEZONE
6778 Mono_Posix_FromTimezone (struct Mono_Posix_Timezone
*from
, struct timezone
*to
)
6780 _cnm_return_val_if_overflow (int, from
->tz_minuteswest
, -1);
6781 _cnm_return_val_if_overflow (int, from
->tz_dsttime
, -1);
6783 memset (to
, 0, sizeof(*to
));
6785 to
->tz_minuteswest
= from
->tz_minuteswest
;
6786 to
->tz_dsttime
= from
->tz_dsttime
;
6790 #endif /* ndef HAVE_STRUCT_TIMEZONE */
6793 #ifdef HAVE_STRUCT_TIMEZONE
6795 Mono_Posix_ToTimezone (struct timezone
*from
, struct Mono_Posix_Timezone
*to
)
6797 _cnm_return_val_if_overflow (int, from
->tz_minuteswest
, -1);
6798 _cnm_return_val_if_overflow (int, from
->tz_dsttime
, -1);
6800 memset (to
, 0, sizeof(*to
));
6802 to
->tz_minuteswest
= from
->tz_minuteswest
;
6803 to
->tz_dsttime
= from
->tz_dsttime
;
6807 #endif /* ndef HAVE_STRUCT_TIMEZONE */
6810 #ifdef HAVE_STRUCT_UTIMBUF
6812 Mono_Posix_FromUtimbuf (struct Mono_Posix_Utimbuf
*from
, struct utimbuf
*to
)
6814 _cnm_return_val_if_overflow (time_t, from
->actime
, -1);
6815 _cnm_return_val_if_overflow (time_t, from
->modtime
, -1);
6817 memset (to
, 0, sizeof(*to
));
6819 to
->actime
= from
->actime
;
6820 to
->modtime
= from
->modtime
;
6824 #endif /* ndef HAVE_STRUCT_UTIMBUF */
6827 #ifdef HAVE_STRUCT_UTIMBUF
6829 Mono_Posix_ToUtimbuf (struct utimbuf
*from
, struct Mono_Posix_Utimbuf
*to
)
6831 _cnm_return_val_if_overflow (gint64
, from
->actime
, -1);
6832 _cnm_return_val_if_overflow (gint64
, from
->modtime
, -1);
6834 memset (to
, 0, sizeof(*to
));
6836 to
->actime
= from
->actime
;
6837 to
->modtime
= from
->modtime
;
6841 #endif /* ndef HAVE_STRUCT_UTIMBUF */
6844 int Mono_Posix_FromWaitOptions (int x
, int *r
)
6847 if ((x
& Mono_Posix_WaitOptions_WNOHANG
) == Mono_Posix_WaitOptions_WNOHANG
)
6850 #else /* def WNOHANG */
6851 {errno
= EINVAL
; return -1;}
6852 #endif /* ndef WNOHANG */
6853 if ((x
& Mono_Posix_WaitOptions_WUNTRACED
) == Mono_Posix_WaitOptions_WUNTRACED
)
6856 #else /* def WUNTRACED */
6857 {errno
= EINVAL
; return -1;}
6858 #endif /* ndef WUNTRACED */
6864 int Mono_Posix_ToWaitOptions (int x
, int *r
)
6870 if ((x
& WNOHANG
) == WNOHANG
)
6871 *r
|= Mono_Posix_WaitOptions_WNOHANG
;
6872 #endif /* ndef WNOHANG */
6874 if ((x
& WUNTRACED
) == WUNTRACED
)
6875 *r
|= Mono_Posix_WaitOptions_WUNTRACED
;
6876 #endif /* ndef WUNTRACED */
6880 int Mono_Posix_FromXattrFlags (int x
, int *r
)
6883 if ((x
& Mono_Posix_XattrFlags_XATTR_AUTO
) == Mono_Posix_XattrFlags_XATTR_AUTO
)
6886 #else /* def XATTR_AUTO */
6887 {errno
= EINVAL
; return -1;}
6888 #endif /* ndef XATTR_AUTO */
6889 if ((x
& Mono_Posix_XattrFlags_XATTR_CREATE
) == Mono_Posix_XattrFlags_XATTR_CREATE
)
6892 #else /* def XATTR_CREATE */
6893 {errno
= EINVAL
; return -1;}
6894 #endif /* ndef XATTR_CREATE */
6895 if ((x
& Mono_Posix_XattrFlags_XATTR_REPLACE
) == Mono_Posix_XattrFlags_XATTR_REPLACE
)
6896 #ifdef XATTR_REPLACE
6897 *r
|= XATTR_REPLACE
;
6898 #else /* def XATTR_REPLACE */
6899 {errno
= EINVAL
; return -1;}
6900 #endif /* ndef XATTR_REPLACE */
6906 int Mono_Posix_ToXattrFlags (int x
, int *r
)
6912 if ((x
& XATTR_AUTO
) == XATTR_AUTO
)
6913 *r
|= Mono_Posix_XattrFlags_XATTR_AUTO
;
6914 #endif /* ndef XATTR_AUTO */
6916 if ((x
& XATTR_CREATE
) == XATTR_CREATE
)
6917 *r
|= Mono_Posix_XattrFlags_XATTR_CREATE
;
6918 #endif /* ndef XATTR_CREATE */
6919 #ifdef XATTR_REPLACE
6920 if ((x
& XATTR_REPLACE
) == XATTR_REPLACE
)
6921 *r
|= Mono_Posix_XattrFlags_XATTR_REPLACE
;
6922 #endif /* ndef XATTR_REPLACE */