1 //! Interface to VxWorks C library
3 use core
::mem
::size_of
;
4 use core
::ptr
::null_mut
;
6 #[cfg_attr(feature = "extra_traits", derive(Debug))]
10 fn clone(&self) -> DIR
{
15 pub type c_schar
= i8;
16 pub type c_uchar
= u8;
17 pub type c_short
= i16;
18 pub type c_ushort
= u16;
20 pub type c_uint
= u32;
21 pub type c_float
= f32;
22 pub type c_double
= f64;
23 pub type c_longlong
= i64;
24 pub type c_ulonglong
= u64;
25 pub type intmax_t
= i64;
26 pub type uintmax_t
= u64;
28 pub type uintptr_t
= usize;
29 pub type intptr_t
= isize;
30 pub type ptrdiff_t
= isize;
31 pub type size_t
= ::uintptr_t
;
32 pub type ssize_t
= ::intptr_t
;
34 pub type pid_t
= ::c_int
;
35 pub type in_addr_t
= u32;
36 pub type sighandler_t
= ::size_t
;
37 pub type cpuset_t
= u32;
39 pub type blkcnt_t
= ::c_long
;
40 pub type blksize_t
= ::c_long
;
41 pub type ino_t
= ::c_ulong
;
43 pub type rlim_t
= ::c_ulong
;
44 pub type suseconds_t
= ::c_long
;
45 pub type time_t
= ::c_long
;
47 pub type errno_t
= ::c_int
;
49 pub type useconds_t
= ::c_ulong
;
51 pub type socklen_t
= ::c_uint
;
53 pub type pthread_t
= ::c_ulong
;
55 pub type clockid_t
= ::c_int
;
57 //defined for the structs
58 pub type dev_t
= ::c_ulong
;
59 pub type mode_t
= ::c_int
;
60 pub type nlink_t
= ::c_ulong
;
61 pub type uid_t
= ::c_ushort
;
62 pub type gid_t
= ::c_ushort
;
63 pub type sigset_t
= ::c_ulonglong
;
64 pub type key_t
= ::c_long
;
66 pub type nfds_t
= ::c_uint
;
67 pub type stat64
= ::stat
;
69 pub type pthread_key_t
= ::c_ulong
;
72 pub type off_t
= ::c_longlong
;
73 pub type off64_t
= off_t
;
76 pub type BOOL
= ::c_int
;
79 pub type _Vx_OBJ_HANDLE
= ::c_int
;
80 pub type _Vx_TASK_ID
= ::_Vx_OBJ_HANDLE
;
81 pub type _Vx_MSG_Q_ID
= ::_Vx_OBJ_HANDLE
;
82 pub type _Vx_SEM_ID_KERNEL
= ::_Vx_OBJ_HANDLE
;
83 pub type _Vx_RTP_ID
= ::_Vx_OBJ_HANDLE
;
84 pub type _Vx_SD_ID
= ::_Vx_OBJ_HANDLE
;
85 pub type _Vx_CONDVAR_ID
= ::_Vx_OBJ_HANDLE
;
86 pub type _Vx_SEM_ID
= *mut ::_Vx_semaphore
;
87 pub type OBJ_HANDLE
= ::_Vx_OBJ_HANDLE
;
88 pub type TASK_ID
= ::OBJ_HANDLE
;
89 pub type MSG_Q_ID
= ::OBJ_HANDLE
;
90 pub type SEM_ID_KERNEL
= ::OBJ_HANDLE
;
91 pub type RTP_ID
= ::OBJ_HANDLE
;
92 pub type SD_ID
= ::OBJ_HANDLE
;
93 pub type CONDVAR_ID
= ::OBJ_HANDLE
;
96 pub type _Vx_usr_arg_t
= isize;
97 pub type _Vx_exit_code_t
= isize;
98 pub type _Vx_ticks_t
= ::c_uint
;
99 pub type _Vx_ticks64_t
= ::c_ulonglong
;
101 pub type sa_family_t
= ::c_uchar
;
104 pub type mqd_t
= ::c_int
;
106 #[cfg_attr(feature = "extra_traits", derive(Debug))]
107 pub enum _Vx_semaphore {}
108 impl ::Copy
for _Vx_semaphore {}
109 impl ::Clone
for _Vx_semaphore
{
110 fn clone(&self) -> _Vx_semaphore
{
116 pub unsafe fn si_addr(&self) -> *mut ::c_void
{
120 pub unsafe fn si_value(&self) -> ::sigval
{
124 pub unsafe fn si_pid(&self) -> ::pid_t
{
128 pub unsafe fn si_uid(&self) -> ::uid_t
{
132 pub unsafe fn si_status(&self) -> ::c_int
{
138 // b_pthread_condattr_t.h
139 pub struct pthread_condattr_t
{
140 pub condAttrStatus
: ::c_int
,
141 pub condAttrPshared
: ::c_int
,
142 pub condAttrClockId
: ::clockid_t
,
145 // b_pthread_cond_t.h
146 pub struct pthread_cond_t
{
147 pub condSemId
: ::_Vx_SEM_ID
,
148 pub condValid
: ::c_int
,
149 pub condInitted
: ::c_int
,
150 pub condRefCount
: ::c_int
,
151 pub condMutex
: *mut ::pthread_mutex_t
,
152 pub condAttr
: ::pthread_condattr_t
,
153 pub condSemName
: [::c_char
; _PTHREAD_SHARED_SEM_NAME_MAX
]
156 // b_pthread_rwlockattr_t.h
157 pub struct pthread_rwlockattr_t
{
158 pub rwlockAttrStatus
: ::c_int
,
159 pub rwlockAttrPshared
: ::c_int
,
160 pub rwlockAttrMaxReaders
: ::c_uint
,
161 pub rwlockAttrConformOpt
: ::c_uint
,
164 // b_pthread_rwlock_t.h
165 pub struct pthread_rwlock_t
{
166 pub rwlockSemId
: :: _Vx_SEM_ID
,
167 pub rwlockReadersRefCount
: ::c_uint
,
168 pub rwlockValid
: ::c_int
,
169 pub rwlockInitted
: ::c_int
,
170 pub rwlockAttr
: ::pthread_rwlockattr_t
,
171 pub rwlockSemName
: [::c_char
; _PTHREAD_SHARED_SEM_NAME_MAX
]
174 // b_struct_timeval.h
176 pub tv_sec
: ::time_t
,
177 pub tv_usec
: ::suseconds_t
,
182 pub l_onoff
: ::c_int
,
183 pub l_linger
: ::c_int
,
186 pub struct sockaddr
{
187 pub sa_len
: ::c_uchar
,
188 pub sa_family
: sa_family_t
,
189 pub sa_data
: [::c_char
; 14],
193 pub iov_base
: *mut ::c_void
,
194 pub iov_len
: ::size_t
,
198 pub msg_name
: *mut c_void
,
199 pub msg_namelen
: socklen_t
,
200 pub msg_iov
: *mut iovec
,
201 pub msg_iovlen
: ::c_int
,
202 pub msg_control
: *mut c_void
,
203 pub msg_controllen
: socklen_t
,
204 pub msg_flags
: ::c_int
,
208 pub cmsg_len
: socklen_t
,
209 pub cmsg_level
: ::c_int
,
210 pub cmsg_type
: ::c_int
,
216 pub events
: ::c_short
,
217 pub revents
: ::c_short
,
222 pub rlim_cur
: ::rlim_t
,
223 pub rlim_max
: ::rlim_t
,
228 pub st_dev
: ::dev_t
,
229 pub st_ino
: ::ino_t
,
230 pub st_mode
: ::mode_t
,
231 pub st_nlink
: ::nlink_t
,
232 pub st_uid
: ::uid_t
,
233 pub st_gid
: ::gid_t
,
234 pub st_rdev
: ::dev_t
,
235 pub st_size
: ::off_t
,
236 pub st_atime
: ::time_t
,
237 pub st_mtime
: ::time_t
,
238 pub st_ctime
: ::time_t
,
239 pub st_blksize
: ::blksize_t
,
240 pub st_blocks
: ::blkcnt_t
,
241 pub st_attrib
: ::c_uchar
,
242 pub st_reserved1
: ::c_int
,
243 pub st_reserved2
: ::c_int
,
244 pub st_reserved3
: ::c_int
,
245 pub st_reserved4
: ::c_int
,
248 //b_struct__Timespec.h
249 pub struct _Timespec
{
250 pub tv_sec
: ::time_t
,
251 pub tv_nsec
: ::c_long
,
254 // b_struct__Sched_param.h
255 pub struct _Sched_param
{
256 pub sched_priority
: ::c_int
, /* scheduling priority */
257 pub sched_ss_low_priority
: ::c_int
, /* low scheduling priority */
258 pub sched_ss_repl_period
: ::_Timespec
, /* replenishment period */
259 pub sched_ss_init_budget
: ::_Timespec
, /* initial budget */
260 pub sched_ss_max_repl
: ::c_int
, /* max pending replenishment */
264 // b_pthread_attr_t.h
265 pub struct pthread_attr_t
{
266 pub threadAttrStatus
: ::c_int
,
267 pub threadAttrStacksize
: ::size_t
,
268 pub threadAttrStackaddr
: *mut ::c_void
,
269 pub threadAttrGuardsize
: ::size_t
,
270 pub threadAttrDetachstate
: ::c_int
,
271 pub threadAttrContentionscope
: ::c_int
,
272 pub threadAttrInheritsched
: ::c_int
,
273 pub threadAttrSchedpolicy
: ::c_int
,
274 pub threadAttrName
: *mut ::c_char
,
275 pub threadAttrOptions
: ::c_int
,
276 pub threadAttrSchedparam
: ::_Sched_param
,
281 pub struct sigaction
{
283 pub sa_mask
: ::sigset_t
,
284 pub sa_flags
: ::c_int
,
289 pub ss_sp
: *mut ::c_void
,
290 pub ss_size
: ::size_t
,
291 pub ss_flags
: ::c_int
,
295 pub struct siginfo_t
{
296 pub si_signo
: ::c_int
,
297 pub si_code
: ::c_int
,
298 pub si_value
: ::sigval
,
299 pub si_errno
: ::c_int
,
300 pub si_status
: ::c_int
,
301 pub si_addr
: *mut ::c_void
,
307 // b_pthread_mutexattr_t.h (usr)
308 pub struct pthread_mutexattr_t
{
309 mutexAttrStatus
: ::c_int
,
310 mutexAttrPshared
: ::c_int
,
311 mutexAttrProtocol
: ::c_int
,
312 mutexAttrPrioceiling
: ::c_int
,
313 mutexAttrType
: ::c_int
,
317 // b_pthread_mutex_t.h (usr)
318 pub struct pthread_mutex_t
{
319 pub mutexSemId
: ::_Vx_SEM_ID
, /*_Vx_SEM_ID ..*/
320 pub mutexValid
: ::c_int
,
321 pub mutexInitted
: ::c_int
,
322 pub mutexCondRefCount
: ::c_int
,
323 pub mutexSavPriority
: ::c_int
,
324 pub mutexAttr
: ::pthread_mutexattr_t
,
325 pub mutexSemName
: [::c_char
; _PTHREAD_SHARED_SEM_NAME_MAX
],
328 // b_struct_timespec.h
329 pub struct timespec
{
330 pub tv_sec
: ::time_t
,
331 pub tv_nsec
: ::c_long
,
338 pub tm_hour
: ::c_int
,
339 pub tm_mday
: ::c_int
,
341 pub tm_year
: ::c_int
,
342 pub tm_wday
: ::c_int
,
343 pub tm_yday
: ::c_int
,
344 pub tm_isdst
: ::c_int
,
349 pub s_addr
: in_addr_t
,
354 pub imr_multiaddr
: in_addr
,
355 pub imr_interface
: in_addr
,
360 pub struct in6_addr
{
361 pub s6_addr
: [u8; 16],
365 pub struct ipv6_mreq
{
366 pub ipv6mr_multiaddr
: in6_addr
,
367 pub ipv6mr_interface
: ::c_uint
,
371 pub struct addrinfo
{
372 pub ai_flags
: ::c_int
,
373 pub ai_family
: ::c_int
,
374 pub ai_socktype
: ::c_int
,
375 pub ai_protocol
: ::c_int
,
376 pub ai_addrlen
: ::size_t
,
377 pub ai_canonname
: *mut ::c_char
,
378 pub ai_addr
: *mut ::sockaddr
,
379 pub ai_next
: *mut ::addrinfo
,
383 pub struct sockaddr_in
{
387 pub sin_addr
: ::in_addr
,
388 pub sin_zero
: [::c_char
; 8],
392 pub struct sockaddr_in6
{
394 pub sin6_family
: u8,
396 pub sin6_flowinfo
: u32,
397 pub sin6_addr
: ::in6_addr
,
398 pub sin6_scope_id
: u32,
402 pub dli_fname
: *const ::c_char
,
403 pub dli_fbase
: *mut ::c_void
,
404 pub dli_sname
: *const ::c_char
,
405 pub dli_saddr
: *mut ::c_void
,
409 pub mq_maxmsg
: ::c_long
,
410 pub mq_msgsize
: ::c_long
,
411 pub mq_flags
: ::c_long
,
412 pub mq_curmsgs
: ::c_long
,
420 pub d_name
: [::c_char
; _PARM_NAME_MAX
as usize + 1],
423 pub struct sockaddr_un
{
425 pub sun_family
: sa_family_t
,
426 pub sun_path
: [::c_char
; 104]
430 pub struct RTP_DESC
{
431 pub status
: ::c_int
,
433 pub entrAddr
: *mut ::c_void
,
434 pub initTaskId
: ::TASK_ID
,
435 pub parentId
: ::RTP_ID
,
436 pub pathName
: [::c_char
; VX_RTP_NAME_LENGTH
as usize + 1],
437 pub taskCnt
: ::c_int
,
438 pub textStart
: *mut ::c_void
,
439 pub textEnd
: *mut ::c_void
,
442 pub struct sockaddr_storage
{
443 pub ss_len
: ::c_uchar
,
444 pub ss_family
: ::sa_family_t
,
445 pub __ss_pad1
: [::c_char
; _SS_PAD1SIZE
],
446 pub __ss_align
: i32,
447 pub __ss_pad2
: [::c_char
; _SS_PAD2SIZE
],
451 pub sa_handler
: ::Option
<unsafe extern "C" fn(::c_int
) -> !>,
452 pub sa_sigaction
: ::Option
<unsafe extern "C" fn(::c_int
,
454 *mut ::c_void
) -> !>,
458 pub sival_int
: ::c_int
,
459 pub sival_ptr
: *mut ::c_void
,
464 if #[cfg(feature = "extra_traits")] {
465 impl ::fmt
::Debug
for dirent
{
466 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
467 f
.debug_struct("dirent")
468 .field("d_ino", &self.d_ino
)
469 .field("d_name", &&self.d_name
[..])
474 impl ::fmt
::Debug
for sockaddr_un
{
475 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
476 f
.debug_struct("sockaddr_un")
477 .field("sun_len", &self.sun_len
)
478 .field("sun_family", &self.sun_family
)
479 .field("sun_path", &&self.sun_path
[..])
484 impl ::fmt
::Debug
for RTP_DESC
{
485 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
486 f
.debug_struct("RTP_DESC")
487 .field("status", &self.status
)
488 .field("options", &self.options
)
489 .field("entrAddr", &self.entrAddr
)
490 .field("initTaskId", &self.initTaskId
)
491 .field("parentId", &self.parentId
)
492 .field("pathName", &&self.pathName
[..])
493 .field("taskCnt", &self.taskCnt
)
494 .field("textStart", &self.textStart
)
495 .field("textEnd", &self.textEnd
)
499 impl ::fmt
::Debug
for sockaddr_storage
{
500 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
501 f
.debug_struct("sockaddr_storage")
502 .field("ss_len", &self.ss_len
)
503 .field("ss_family", &self.ss_family
)
504 .field("__ss_pad1", &&self.__ss_pad1
[..])
505 .field("__ss_align", &self.__ss_align
)
506 .field("__ss_pad2", &&self.__ss_pad2
[..])
511 impl PartialEq
for sa_u_t
{
512 fn eq(&self, other
: &sa_u_t
) -> bool
{
514 let h1
= match self.sa_handler
{
515 Some(handler
) => handler
as usize,
518 let h2
= match other
.sa_handler
{
519 Some(handler
) => handler
as usize,
526 impl Eq
for sa_u_t {}
527 impl ::fmt
::Debug
for sa_u_t
{
528 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
530 let h
= match self.sa_handler
{
531 Some(handler
) => handler
as usize,
535 f
.debug_struct("sa_u_t")
536 .field("sa_handler", &h
)
541 impl ::hash
::Hash
for sa_u_t
{
542 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
544 let h
= match self.sa_handler
{
545 Some(handler
) => handler
as usize,
553 impl PartialEq
for sigval
{
554 fn eq(&self, other
: &sigval
) -> bool
{
555 unsafe { self.sival_ptr as usize == other.sival_ptr as usize }
558 impl Eq
for sigval {}
559 impl ::fmt
::Debug
for sigval
{
560 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
561 f
.debug_struct("sigval")
562 .field("sival_ptr", unsafe { &(self.sival_ptr as usize) }
)
566 impl ::hash
::Hash
for sigval
{
567 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
568 unsafe { (self.sival_ptr as usize).hash(state) }
;
574 pub const STDIN_FILENO
: ::c_int
= 0;
575 pub const STDOUT_FILENO
: ::c_int
= 1;
576 pub const STDERR_FILENO
: ::c_int
= 2;
578 pub const EXIT_SUCCESS
: ::c_int
= 0;
579 pub const EXIT_FAILURE
: ::c_int
= 1;
581 pub const EAI_SERVICE
: ::c_int
= 9;
582 pub const EAI_SOCKTYPE
: ::c_int
= 10;
583 pub const EAI_SYSTEM
: ::c_int
= 11;
585 // This is not defined in vxWorks, but we have to define it here
586 // to make the building pass for getrandom and libstd, FIXME
587 pub const RTLD_DEFAULT
: *mut ::c_void
= 0i64 as *mut ::c_void
;
590 pub const CLOCK_REALTIME
: ::c_int
= 0x0;
591 pub const CLOCK_MONOTONIC
: ::c_int
= 0x1;
592 pub const CLOCK_PROCESS_CPUTIME_ID
: ::c_int
= 0x2;
593 pub const CLOCK_THREAD_CPUTIME_ID
: ::c_int
= 0x3;
594 pub const TIMER_ABSTIME
: ::c_int
= 0x1;
595 pub const TIMER_RELTIME
: ::c_int
= 0x0;
598 pub const PTHREAD_INITIALIZED_OBJ
: ::c_int
= 0xF70990EF;
599 pub const PTHREAD_DESTROYED_OBJ
: ::c_int
= -1;
600 pub const PTHREAD_VALID_OBJ
: ::c_int
= 0xEC542A37;
601 pub const PTHREAD_INVALID_OBJ
: ::c_int
= -1;
602 pub const PTHREAD_UNUSED_YET_OBJ
: ::c_int
= -1;
604 pub const PTHREAD_PRIO_NONE
: ::c_int
= 0;
605 pub const PTHREAD_PRIO_INHERIT
: ::c_int
= 1;
606 pub const PTHREAD_PRIO_PROTECT
: ::c_int
= 2;
608 pub const PTHREAD_MUTEX_NORMAL
: ::c_int
= 0;
609 pub const PTHREAD_MUTEX_ERRORCHECK
: ::c_int
= 1;
610 pub const PTHREAD_MUTEX_RECURSIVE
: ::c_int
= 2;
611 pub const PTHREAD_MUTEX_DEFAULT
: ::c_int
= PTHREAD_MUTEX_NORMAL
;
612 pub const PTHREAD_STACK_MIN
: usize = 4096;
613 pub const _PTHREAD_SHARED_SEM_NAME_MAX
: usize = 30;
616 pub const OK
: ::c_int
= 0;
617 pub const EPERM
: ::c_int
= 1; /* Not owner */
618 pub const ENOENT
: ::c_int
= 2; /* No such file or directory */
619 pub const ESRCH
: ::c_int
= 3; /* No such process */
620 pub const EINTR
: ::c_int
= 4; /* Interrupted system call */
621 pub const EIO
: ::c_int
= 5; /* I/O error */
622 pub const ENXIO
: ::c_int
= 6; /* No such device or address */
623 pub const E2BIG
: ::c_int
= 7; /* Arg list too long */
624 pub const ENOEXEC
: ::c_int
= 8; /* Exec format error */
625 pub const EBADF
: ::c_int
= 9; /* Bad file number */
626 pub const ECHILD
: ::c_int
= 10; /* No children */
627 pub const EAGAIN
: ::c_int
= 11; /* No more processes */
628 pub const ENOMEM
: ::c_int
= 12; /* Not enough core */
629 pub const EACCES
: ::c_int
= 13; /* Permission denied */
630 pub const EFAULT
: ::c_int
= 14;
631 pub const ENOTEMPTY
: ::c_int
= 15;
632 pub const EBUSY
: ::c_int
= 16;
633 pub const EEXIST
: ::c_int
= 17;
634 pub const ENODEV
: ::c_int
= 19;
635 pub const ENOTDIR
: ::c_int
= 20;
636 pub const EISDIR
: ::c_int
= 21;
637 pub const EINVAL
: ::c_int
= 22;
638 pub const ENAMETOOLONG
: ::c_int
= 26;
639 pub const EFBIG
: ::c_int
= 27;
640 pub const ENOSPC
: ::c_int
= 28;
641 pub const EROFS
: ::c_int
= 30;
642 pub const EPIPE
: ::c_int
= 32;
643 pub const EDEADLK
: ::c_int
= 33;
644 pub const ERANGE
: ::c_int
= 38;
645 pub const EDESTADDRREQ
: ::c_int
= 40;
646 pub const EPROTOTYPE
: ::c_int
= 41;
647 pub const ENOPROTOOPT
: ::c_int
= 42;
648 pub const EPROTONOSUPPORT
: ::c_int
= 43;
649 pub const ESOCKTNOSUPPORT
: ::c_int
= 44;
650 pub const EOPNOTSUPP
: ::c_int
= 45;
651 pub const EPFNOSUPPORT
: ::c_int
= 46;
652 pub const EAFNOSUPPORT
: ::c_int
= 47;
653 pub const EADDRINUSE
: ::c_int
= 48;
654 pub const EADDRNOTAVAIL
: ::c_int
= 49;
655 pub const ENOTSOCK
: ::c_int
= 50;
656 pub const ENETUNREACH
: ::c_int
= 51;
657 pub const ENETRESET
: ::c_int
= 52;
658 pub const ECONNABORTED
: ::c_int
= 53;
659 pub const ECONNRESET
: ::c_int
= 54;
660 pub const ENOBUFS
: ::c_int
= 55;
661 pub const EISCONN
: ::c_int
= 56;
662 pub const ENOTCONN
: ::c_int
= 57;
663 pub const ESHUTDOWN
: ::c_int
= 58;
664 pub const ETOOMANYREFS
: ::c_int
= 59;
665 pub const ETIMEDOUT
: ::c_int
= 60;
666 pub const ECONNREFUSED
: ::c_int
= 61;
667 pub const EINPROGRESS
: ::c_int
= 68;
668 pub const EALREADY
: ::c_int
= 69;
669 pub const EWOULDBLOCK
: ::c_int
= 70;
670 pub const ENOSYS
: ::c_int
= 71;
671 pub const EDQUOT
: ::c_int
= 83;
672 pub const ESTALE
: ::c_int
= 88;
674 // NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h
675 const M_nfsStat
: ::c_int
= 48 << 16;
679 NFSERR_BADHANDLE
= 10001,
680 NFSERR_NOT_SYNC
= 10002,
681 NFSERR_BAD_COOKIE
= 10003,
682 NFSERR_TOOSMALL
= 10005,
683 NFSERR_BADTYPE
= 10007,
684 NFSERR_JUKEBOX
= 10008,
687 pub const S_nfsLib_NFS_OK
: ::c_int
= OK
;
688 pub const S_nfsLib_NFSERR_PERM
: ::c_int
= EPERM
;
689 pub const S_nfsLib_NFSERR_NOENT
: ::c_int
= ENOENT
;
690 pub const S_nfsLib_NFSERR_IO
: ::c_int
= EIO
;
691 pub const S_nfsLib_NFSERR_NXIO
: ::c_int
= ENXIO
;
692 pub const S_nfsLib_NFSERR_ACCESS
: ::c_int
= EACCES
;
693 pub const S_nfsLib_NFSERR_EXIST
: ::c_int
= EEXIST
;
694 pub const S_nfsLib_NFSERR_ENODEV
: ::c_int
= ENODEV
;
695 pub const S_nfsLib_NFSERR_NOTDIR
: ::c_int
= ENOTDIR
;
696 pub const S_nfsLib_NFSERR_ISDIR
: ::c_int
= EISDIR
;
697 pub const S_nfsLib_NFSERR_INVAL
: ::c_int
= EINVAL
;
698 pub const S_nfsLib_NFSERR_FBIG
: ::c_int
= EFBIG
;
699 pub const S_nfsLib_NFSERR_NOSPC
: ::c_int
= ENOSPC
;
700 pub const S_nfsLib_NFSERR_ROFS
: ::c_int
= EROFS
;
701 pub const S_nfsLib_NFSERR_NAMETOOLONG
: ::c_int
= ENAMETOOLONG
;
702 pub const S_nfsLib_NFSERR_NOTEMPTY
: ::c_int
= ENOTEMPTY
;
703 pub const S_nfsLib_NFSERR_DQUOT
: ::c_int
= EDQUOT
;
704 pub const S_nfsLib_NFSERR_STALE
: ::c_int
= ESTALE
;
705 pub const S_nfsLib_NFSERR_WFLUSH
: ::c_int
=
706 M_nfsStat
| nfsstat
::NFSERR_WFLUSH
as ::c_int
;
707 pub const S_nfsLib_NFSERR_REMOTE
: ::c_int
=
708 M_nfsStat
| nfsstat
::NFSERR_REMOTE
as ::c_int
;
709 pub const S_nfsLib_NFSERR_BADHANDLE
: ::c_int
=
710 M_nfsStat
| nfsstat
::NFSERR_BADHANDLE
as ::c_int
;
711 pub const S_nfsLib_NFSERR_NOT_SYNC
: ::c_int
=
712 M_nfsStat
| nfsstat
::NFSERR_NOT_SYNC
as ::c_int
;
713 pub const S_nfsLib_NFSERR_BAD_COOKIE
: ::c_int
=
714 M_nfsStat
| nfsstat
::NFSERR_BAD_COOKIE
as ::c_int
;
715 pub const S_nfsLib_NFSERR_NOTSUPP
: ::c_int
= EOPNOTSUPP
;
716 pub const S_nfsLib_NFSERR_TOOSMALL
: ::c_int
=
717 M_nfsStat
| nfsstat
::NFSERR_TOOSMALL
as ::c_int
;
718 pub const S_nfsLib_NFSERR_SERVERFAULT
: ::c_int
= EIO
;
719 pub const S_nfsLib_NFSERR_BADTYPE
: ::c_int
=
720 M_nfsStat
| nfsstat
::NFSERR_BADTYPE
as ::c_int
;
721 pub const S_nfsLib_NFSERR_JUKEBOX
: ::c_int
=
722 M_nfsStat
| nfsstat
::NFSERR_JUKEBOX
as ::c_int
;
725 pub const IPPROTO_IP
: ::c_int
= 0;
726 pub const IPPROTO_IPV6
: ::c_int
= 41;
728 pub const IP_TTL
: ::c_int
= 4;
729 pub const IP_MULTICAST_IF
: ::c_int
= 9;
730 pub const IP_MULTICAST_TTL
: ::c_int
= 10;
731 pub const IP_MULTICAST_LOOP
: ::c_int
= 11;
732 pub const IP_ADD_MEMBERSHIP
: ::c_int
= 12;
733 pub const IP_DROP_MEMBERSHIP
: ::c_int
= 13;
736 pub const IPV6_V6ONLY
: ::c_int
= 1;
737 pub const IPV6_UNICAST_HOPS
: ::c_int
= 4;
738 pub const IPV6_MULTICAST_IF
: ::c_int
= 9;
739 pub const IPV6_MULTICAST_HOPS
: ::c_int
= 10;
740 pub const IPV6_MULTICAST_LOOP
: ::c_int
= 11;
741 pub const IPV6_ADD_MEMBERSHIP
: ::c_int
= 12;
742 pub const IPV6_DROP_MEMBERSHIP
: ::c_int
= 13;
745 pub const S_IFMT
: ::c_int
= 0xf000;
746 pub const S_IFIFO
: ::c_int
= 0x1000;
747 pub const S_IFCHR
: ::c_int
= 0x2000;
748 pub const S_IFDIR
: ::c_int
= 0x4000;
749 pub const S_IFBLK
: ::c_int
= 0x6000;
750 pub const S_IFREG
: ::c_int
= 0x8000;
751 pub const S_IFLNK
: ::c_int
= 0xa000;
752 pub const S_IFSHM
: ::c_int
= 0xb000;
753 pub const S_IFSOCK
: ::c_int
= 0xc000;
754 pub const S_ISUID
: ::c_int
= 0x0800;
755 pub const S_ISGID
: ::c_int
= 0x0400;
756 pub const S_ISTXT
: ::c_int
= 0x0200;
757 pub const S_IRUSR
: ::c_int
= 0x0100;
758 pub const S_IWUSR
: ::c_int
= 0x0080;
759 pub const S_IXUSR
: ::c_int
= 0x0040;
760 pub const S_IRWXU
: ::c_int
= 0x01c0;
761 pub const S_IRGRP
: ::c_int
= 0x0020;
762 pub const S_IWGRP
: ::c_int
= 0x0010;
763 pub const S_IXGRP
: ::c_int
= 0x0008;
764 pub const S_IRWXG
: ::c_int
= 0x0038;
765 pub const S_IROTH
: ::c_int
= 0x0004;
766 pub const S_IWOTH
: ::c_int
= 0x0002;
767 pub const S_IXOTH
: ::c_int
= 0x0001;
768 pub const S_IRWXO
: ::c_int
= 0x0007;
771 pub const SOL_SOCKET
: ::c_int
= 0xffff;
773 pub const SO_DEBUG
: ::c_int
= 0x0001;
774 pub const SO_REUSEADDR
: ::c_int
= 0x0004;
775 pub const SO_KEEPALIVE
: ::c_int
= 0x0008;
776 pub const SO_DONTROUTE
: ::c_int
= 0x0010;
777 pub const SO_RCVLOWAT
: ::c_int
= 0x0012;
778 pub const SO_SNDLOWAT
: ::c_int
= 0x0013;
779 pub const SO_SNDTIMEO
: ::c_int
= 0x1005;
780 pub const SO_ACCEPTCONN
: ::c_int
= 0x001e;
781 pub const SO_BROADCAST
: ::c_int
= 0x0020;
782 pub const SO_USELOOPBACK
: ::c_int
= 0x0040;
783 pub const SO_LINGER
: ::c_int
= 0x0080;
784 pub const SO_REUSEPORT
: ::c_int
= 0x0200;
786 pub const SO_VLAN
: ::c_int
= 0x8000;
788 pub const SO_SNDBUF
: ::c_int
= 0x1001;
789 pub const SO_RCVBUF
: ::c_int
= 0x1002;
790 pub const SO_RCVTIMEO
: ::c_int
= 0x1006;
791 pub const SO_ERROR
: ::c_int
= 0x1007;
792 pub const SO_TYPE
: ::c_int
= 0x1008;
793 pub const SO_BINDTODEVICE
: ::c_int
= 0x1010;
794 pub const SO_OOBINLINE
: ::c_int
= 0x1011;
795 pub const SO_CONNTIMEO
: ::c_int
= 0x100a;
797 pub const SOCK_STREAM
: ::c_int
= 1;
798 pub const SOCK_DGRAM
: ::c_int
= 2;
799 pub const SOCK_RAW
: ::c_int
= 3;
800 pub const SOCK_RDM
: ::c_int
= 4;
801 pub const SOCK_SEQPACKET
: ::c_int
= 5;
802 pub const SOCK_PACKET
: ::c_int
= 10;
804 pub const _SS_MAXSIZE
: usize = 128;
805 pub const _SS_ALIGNSIZE
: usize = size_of
::<u32>();
806 pub const _SS_PAD1SIZE
: usize =
807 _SS_ALIGNSIZE
- size_of
::<::c_uchar
>() - size_of
::<::sa_family_t
>();
808 pub const _SS_PAD2SIZE
: usize = _SS_MAXSIZE
809 - size_of
::<::c_uchar
>()
810 - size_of
::<::sa_family_t
>()
814 pub const MSG_OOB
: ::c_int
= 0x0001;
815 pub const MSG_PEEK
: ::c_int
= 0x0002;
816 pub const MSG_DONTROUTE
: ::c_int
= 0x0004;
817 pub const MSG_EOR
: ::c_int
= 0x0008;
818 pub const MSG_TRUNC
: ::c_int
= 0x0010;
819 pub const MSG_CTRUNC
: ::c_int
= 0x0020;
820 pub const MSG_WAITALL
: ::c_int
= 0x0040;
821 pub const MSG_DONTWAIT
: ::c_int
= 0x0080;
822 pub const MSG_EOF
: ::c_int
= 0x0100;
823 pub const MSG_EXP
: ::c_int
= 0x0200;
824 pub const MSG_MBUF
: ::c_int
= 0x0400;
825 pub const MSG_NOTIFICATION
: ::c_int
= 0x0800;
826 pub const MSG_COMPAT
: ::c_int
= 0x8000;
828 pub const AF_UNSPEC
: ::c_int
= 0;
829 pub const AF_LOCAL
: ::c_int
= 1;
830 pub const AF_UNIX
: ::c_int
= AF_LOCAL
;
831 pub const AF_INET
: ::c_int
= 2;
832 pub const AF_NETLINK
: ::c_int
= 16;
833 pub const AF_ROUTE
: ::c_int
= 17;
834 pub const AF_LINK
: ::c_int
= 18;
835 pub const AF_PACKET
: ::c_int
= 19;
836 pub const pseudo_AF_KEY
: ::c_int
= 27;
837 pub const AF_KEY
: ::c_int
= pseudo_AF_KEY
;
838 pub const AF_INET6
: ::c_int
= 28;
839 pub const AF_SOCKDEV
: ::c_int
= 31;
840 pub const AF_TIPC
: ::c_int
= 33;
841 pub const AF_MIPC
: ::c_int
= 34;
842 pub const AF_MIPC_SAFE
: ::c_int
= 35;
843 pub const AF_MAX
: ::c_int
= 37;
845 pub const SHUT_RD
: ::c_int
= 0;
846 pub const SHUT_WR
: ::c_int
= 1;
847 pub const SHUT_RDWR
: ::c_int
= 2;
849 pub const IPPROTO_TCP
: ::c_int
= 6;
850 pub const TCP_NODELAY
: ::c_int
= 1;
851 pub const TCP_MAXSEG
: ::c_int
= 2;
852 pub const TCP_NOPUSH
: ::c_int
= 3;
853 pub const TCP_KEEPIDLE
: ::c_int
= 4;
854 pub const TCP_KEEPINTVL
: ::c_int
= 5;
855 pub const TCP_KEEPCNT
: ::c_int
= 6;
858 pub const FIONREAD
: ::c_int
= 0x40040001;
859 pub const FIOFLUSH
: ::c_int
= 2;
860 pub const FIOOPTIONS
: ::c_int
= 3;
861 pub const FIOBAUDRATE
: ::c_int
= 4;
862 pub const FIODISKFORMAT
: ::c_int
= 5;
863 pub const FIODISKINIT
: ::c_int
= 6;
864 pub const FIOSEEK
: ::c_int
= 7;
865 pub const FIOWHERE
: ::c_int
= 8;
866 pub const FIODIRENTRY
: ::c_int
= 9;
867 pub const FIORENAME
: ::c_int
= 10;
868 pub const FIOREADYCHANGE
: ::c_int
= 11;
869 pub const FIODISKCHANGE
: ::c_int
= 13;
870 pub const FIOCANCEL
: ::c_int
= 14;
871 pub const FIOSQUEEZE
: ::c_int
= 15;
872 pub const FIOGETNAME
: ::c_int
= 18;
873 pub const FIONBIO
: ::c_int
= 0x90040010;
876 pub const PATH_MAX
: ::c_int
= _PARM_PATH_MAX
;
877 pub const _POSIX_PATH_MAX
: ::c_int
= 256;
880 pub const POLLIN
: ::c_short
= 0x0001;
881 pub const POLLPRI
: ::c_short
= 0x0002;
882 pub const POLLOUT
: ::c_short
= 0x0004;
883 pub const POLLRDNORM
: ::c_short
= 0x0040;
884 pub const POLLWRNORM
: ::c_short
= POLLOUT
;
885 pub const POLLRDBAND
: ::c_short
= 0x0080;
886 pub const POLLWRBAND
: ::c_short
= 0x0100;
887 pub const POLLERR
: ::c_short
= 0x0008;
888 pub const POLLHUP
: ::c_short
= 0x0010;
889 pub const POLLNVAL
: ::c_short
= 0x0020;
892 pub const FD_CLOEXEC
: ::c_int
= 1;
893 pub const F_DUPFD
: ::c_int
= 0;
894 pub const F_GETFD
: ::c_int
= 1;
895 pub const F_SETFD
: ::c_int
= 2;
896 pub const F_GETFL
: ::c_int
= 3;
897 pub const F_SETFL
: ::c_int
= 4;
898 pub const F_GETOWN
: ::c_int
= 5;
899 pub const F_SETOWN
: ::c_int
= 6;
900 pub const F_GETLK
: ::c_int
= 7;
901 pub const F_SETLK
: ::c_int
= 8;
902 pub const F_SETLKW
: ::c_int
= 9;
903 pub const F_DUPFD_CLOEXEC
: ::c_int
= 14;
906 pub const SIG_DFL
: sighandler_t
= 0 as sighandler_t
;
907 pub const SIG_IGN
: sighandler_t
= 1 as sighandler_t
;
908 pub const SIG_ERR
: sighandler_t
= -1 as isize as sighandler_t
;
910 pub const SIGHUP
: ::c_int
= 1;
911 pub const SIGINT
: ::c_int
= 2;
912 pub const SIGQUIT
: ::c_int
= 3;
913 pub const SIGILL
: ::c_int
= 4;
914 pub const SIGTRAP
: ::c_int
= 5;
915 pub const SIGABRT
: ::c_int
= 6;
916 pub const SIGEMT
: ::c_int
= 7;
917 pub const SIGFPE
: ::c_int
= 8;
918 pub const SIGKILL
: ::c_int
= 9;
919 pub const SIGBUS
: ::c_int
= 10;
920 pub const SIGSEGV
: ::c_int
= 11;
921 pub const SIGFMT
: ::c_int
= 12;
922 pub const SIGPIPE
: ::c_int
= 13;
923 pub const SIGALRM
: ::c_int
= 14;
924 pub const SIGTERM
: ::c_int
= 15;
925 pub const SIGCNCL
: ::c_int
= 16;
926 pub const SIGSTOP
: ::c_int
= 17;
927 pub const SIGTSTP
: ::c_int
= 18;
928 pub const SIGCONT
: ::c_int
= 19;
929 pub const SIGCHLD
: ::c_int
= 20;
930 pub const SIGTTIN
: ::c_int
= 21;
931 pub const SIGTTOU
: ::c_int
= 22;
933 pub const SIG_BLOCK
: ::c_int
= 1;
934 pub const SIG_UNBLOCK
: ::c_int
= 2;
935 pub const SIG_SETMASK
: ::c_int
= 3;
937 pub const SI_SYNC
: ::c_int
= 0;
938 pub const SI_USER
: ::c_int
= -1;
939 pub const SI_QUEUE
: ::c_int
= -2;
940 pub const SI_TIMER
: ::c_int
= -3;
941 pub const SI_ASYNCIO
: ::c_int
= -4;
942 pub const SI_MESGQ
: ::c_int
= -5;
943 pub const SI_CHILD
: ::c_int
= -6;
944 pub const SI_KILL
: ::c_int
= SI_USER
;
946 // vxParams.h definitions
947 pub const _PARM_NAME_MAX
: ::c_int
= 255;
948 pub const _PARM_PATH_MAX
: ::c_int
= 1024;
951 pub const WNOHANG
: ::c_int
= 0x01;
952 pub const WUNTRACED
: ::c_int
= 0x02;
954 const PTHREAD_MUTEXATTR_INITIALIZER
: pthread_mutexattr_t
=
955 pthread_mutexattr_t
{
956 mutexAttrStatus
: PTHREAD_INITIALIZED_OBJ
,
957 mutexAttrProtocol
: PTHREAD_PRIO_NONE
,
958 mutexAttrPrioceiling
: 0,
959 mutexAttrType
: PTHREAD_MUTEX_DEFAULT
,
962 pub const PTHREAD_MUTEX_INITIALIZER
: pthread_mutex_t
= pthread_mutex_t
{
963 mutexSemId
: null_mut(),
964 mutexValid
: PTHREAD_VALID_OBJ
,
965 mutexInitted
: PTHREAD_UNUSED_YET_OBJ
,
966 mutexCondRefCount
: 0,
967 mutexSavPriority
: -1,
968 mutexAttr
: PTHREAD_MUTEXATTR_INITIALIZER
,
969 mutexSemName
: [0; _PTHREAD_SHARED_SEM_NAME_MAX
],
972 const PTHREAD_CONDATTR_INITIALIZER
: pthread_condattr_t
= pthread_condattr_t
{
973 condAttrStatus
: 0xf70990ef,
975 condAttrClockId
: CLOCK_REALTIME
,
977 pub const PTHREAD_COND_INITIALIZER
: pthread_cond_t
= pthread_cond_t
{
978 condSemId
: null_mut(),
979 condValid
: PTHREAD_VALID_OBJ
,
980 condInitted
: PTHREAD_UNUSED_YET_OBJ
,
982 condMutex
: null_mut(),
983 condAttr
: PTHREAD_CONDATTR_INITIALIZER
,
984 condSemName
: [0; _PTHREAD_SHARED_SEM_NAME_MAX
],
987 const PTHREAD_RWLOCKATTR_INITIALIZER
: pthread_rwlockattr_t
=
988 pthread_rwlockattr_t
{
989 rwlockAttrStatus
: PTHREAD_INITIALIZED_OBJ
,
990 rwlockAttrPshared
: 1,
991 rwlockAttrMaxReaders
: 0,
992 rwlockAttrConformOpt
: 1,
994 pub const PTHREAD_RWLOCK_INITIALIZER
: pthread_rwlock_t
= pthread_rwlock_t
{
995 rwlockSemId
: null_mut(),
996 rwlockReadersRefCount
: 0,
997 rwlockValid
: PTHREAD_VALID_OBJ
,
998 rwlockInitted
: PTHREAD_UNUSED_YET_OBJ
,
999 rwlockAttr
: PTHREAD_RWLOCKATTR_INITIALIZER
,
1000 rwlockSemName
: [0; _PTHREAD_SHARED_SEM_NAME_MAX
],
1003 pub const SEEK_SET
: ::c_int
= 0;
1004 pub const SEEK_CUR
: ::c_int
= 1;
1005 pub const SEEK_END
: ::c_int
= 2;
1008 pub const VX_RTP_NAME_LENGTH
: ::c_int
= 255;
1009 pub const RTP_ID_ERROR
: ::RTP_ID
= -1;
1011 // h/public/unistd.h
1012 pub const _SC_GETPW_R_SIZE_MAX
: ::c_int
= 21; // Via unistd.h
1013 pub const _SC_PAGESIZE
: ::c_int
= 39;
1014 pub const O_ACCMODE
: ::c_int
= 3;
1015 pub const O_CLOEXEC
: ::c_int
= 0x100000; // fcntlcom
1016 pub const O_EXCL
: ::c_int
= 0x0800;
1017 pub const O_CREAT
: ::c_int
= 0x0200;
1018 pub const O_TRUNC
: ::c_int
= 0x0400;
1019 pub const O_APPEND
: ::c_int
= 0x0008;
1020 pub const O_RDWR
: ::c_int
= 0x0002;
1021 pub const O_WRONLY
: ::c_int
= 0x0001;
1022 pub const O_RDONLY
: ::c_int
= 0;
1023 pub const O_NONBLOCK
: ::c_int
= 0x4000;
1025 #[cfg_attr(feature = "extra_traits", derive(Debug))]
1027 impl ::Copy
for FILE {}
1028 impl ::Clone
for FILE
{
1029 fn clone(&self) -> FILE
{
1033 #[cfg_attr(feature = "extra_traits", derive(Debug))]
1034 pub enum fpos_t {}
// FIXME: fill this out with a struct
1035 impl ::Copy
for fpos_t {}
1036 impl ::Clone
for fpos_t
{
1037 fn clone(&self) -> fpos_t
{
1043 pub fn CMSG_ALIGN(len
: usize) -> usize {
1044 len
+ ::mem
::size_of
::<usize>() - 1 & !(::mem
::size_of
::<usize>() - 1)
1047 pub fn CMSG_NXTHDR(mhdr
: *const msghdr
,
1048 cmsg
: *const cmsghdr
) -> *mut cmsghdr
{
1049 let next
= cmsg
as usize + CMSG_ALIGN((*cmsg
).cmsg_len
as usize)
1050 + CMSG_ALIGN(::mem
::size_of
::<::cmsghdr
>());
1051 let max
= (*mhdr
).msg_control
as usize
1052 + (*mhdr
).msg_controllen
as usize;
1054 (cmsg
as usize + CMSG_ALIGN((*cmsg
).cmsg_len
as usize))
1061 pub fn CMSG_FIRSTHDR(mhdr
: *const msghdr
) -> *mut cmsghdr
{
1062 if (*mhdr
).msg_controllen
as usize > 0 {
1063 (*mhdr
).msg_control
as *mut cmsghdr
1069 pub fn CMSG_DATA(cmsg
: *const cmsghdr
) -> *mut ::c_uchar
{
1070 (cmsg
as *mut ::c_uchar
)
1071 .offset(CMSG_ALIGN(::mem
::size_of
::<::cmsghdr
>()) as isize)
1074 pub fn CMSG_SPACE(length
: ::c_uint
) -> ::c_uint
{
1075 (CMSG_ALIGN(length
as usize) + CMSG_ALIGN(::mem
::size_of
::<cmsghdr
>()))
1079 pub fn CMSG_LEN(length
: ::c_uint
) -> ::c_uint
{
1080 CMSG_ALIGN(::mem
::size_of
::<cmsghdr
>()) as ::c_uint
+ length
1085 pub fn isalnum(c
: c_int
) -> c_int
;
1086 pub fn isalpha(c
: c_int
) -> c_int
;
1087 pub fn iscntrl(c
: c_int
) -> c_int
;
1088 pub fn isdigit(c
: c_int
) -> c_int
;
1089 pub fn isgraph(c
: c_int
) -> c_int
;
1090 pub fn islower(c
: c_int
) -> c_int
;
1091 pub fn isprint(c
: c_int
) -> c_int
;
1092 pub fn ispunct(c
: c_int
) -> c_int
;
1093 pub fn isspace(c
: c_int
) -> c_int
;
1094 pub fn isupper(c
: c_int
) -> c_int
;
1095 pub fn isxdigit(c
: c_int
) -> c_int
;
1096 pub fn isblank(c
: c_int
) -> c_int
;
1097 pub fn tolower(c
: c_int
) -> c_int
;
1098 pub fn toupper(c
: c_int
) -> c_int
;
1099 pub fn fopen(filename
: *const c_char
, mode
: *const c_char
) -> *mut FILE
;
1101 filename
: *const c_char
,
1102 mode
: *const c_char
,
1105 pub fn fflush(file
: *mut FILE
) -> c_int
;
1106 pub fn fclose(file
: *mut FILE
) -> c_int
;
1107 pub fn remove(filename
: *const c_char
) -> c_int
;
1108 pub fn rename(oldname
: *const c_char
, newname
: *const c_char
) -> c_int
;
1109 pub fn tmpfile() -> *mut FILE
;
1112 buffer
: *mut c_char
,
1116 pub fn setbuf(stream
: *mut FILE
, buf
: *mut c_char
);
1117 pub fn getchar() -> c_int
;
1118 pub fn putchar(c
: c_int
) -> c_int
;
1119 pub fn fgetc(stream
: *mut FILE
) -> c_int
;
1120 pub fn fgets(buf
: *mut c_char
, n
: c_int
, stream
: *mut FILE
)
1122 pub fn fputc(c
: c_int
, stream
: *mut FILE
) -> c_int
;
1123 pub fn fputs(s
: *const c_char
, stream
: *mut FILE
) -> c_int
;
1124 pub fn puts(s
: *const c_char
) -> c_int
;
1125 pub fn ungetc(c
: c_int
, stream
: *mut FILE
) -> c_int
;
1138 pub fn fseek(stream
: *mut FILE
, offset
: c_long
, whence
: c_int
) -> c_int
;
1139 pub fn ftell(stream
: *mut FILE
) -> c_long
;
1140 pub fn rewind(stream
: *mut FILE
);
1141 pub fn fgetpos(stream
: *mut FILE
, ptr
: *mut fpos_t
) -> c_int
;
1142 pub fn fsetpos(stream
: *mut FILE
, ptr
: *const fpos_t
) -> c_int
;
1143 pub fn feof(stream
: *mut FILE
) -> c_int
;
1144 pub fn ferror(stream
: *mut FILE
) -> c_int
;
1145 pub fn perror(s
: *const c_char
);
1146 pub fn atoi(s
: *const c_char
) -> c_int
;
1147 pub fn strtod(s
: *const c_char
, endp
: *mut *mut c_char
) -> c_double
;
1150 endp
: *mut *mut c_char
,
1155 endp
: *mut *mut c_char
,
1158 pub fn calloc(nobj
: size_t
, size
: size_t
) -> *mut c_void
;
1159 pub fn malloc(size
: size_t
) -> *mut c_void
;
1160 pub fn realloc(p
: *mut c_void
, size
: size_t
) -> *mut c_void
;
1161 pub fn free(p
: *mut c_void
);
1162 pub fn abort() -> !;
1163 pub fn exit(status
: c_int
) -> !;
1164 pub fn atexit(cb
: extern "C" fn()) -> c_int
;
1165 pub fn system(s
: *const c_char
) -> c_int
;
1166 pub fn getenv(s
: *const c_char
) -> *mut c_char
;
1168 pub fn strcpy(dst
: *mut c_char
, src
: *const c_char
) -> *mut c_char
;
1174 pub fn strcat(s
: *mut c_char
, ct
: *const c_char
) -> *mut c_char
;
1180 pub fn strcmp(cs
: *const c_char
, ct
: *const c_char
) -> c_int
;
1181 pub fn strncmp(cs
: *const c_char
, ct
: *const c_char
, n
: size_t
) -> c_int
;
1182 pub fn strcoll(cs
: *const c_char
, ct
: *const c_char
) -> c_int
;
1183 pub fn strchr(cs
: *const c_char
, c
: c_int
) -> *mut c_char
;
1184 pub fn strrchr(cs
: *const c_char
, c
: c_int
) -> *mut c_char
;
1185 pub fn strspn(cs
: *const c_char
, ct
: *const c_char
) -> size_t
;
1186 pub fn strcspn(cs
: *const c_char
, ct
: *const c_char
) -> size_t
;
1187 pub fn strdup(cs
: *const c_char
) -> *mut c_char
;
1188 pub fn strpbrk(cs
: *const c_char
, ct
: *const c_char
) -> *mut c_char
;
1189 pub fn strstr(cs
: *const c_char
, ct
: *const c_char
) -> *mut c_char
;
1190 pub fn strcasecmp(s1
: *const c_char
, s2
: *const c_char
) -> c_int
;
1196 pub fn strlen(cs
: *const c_char
) -> size_t
;
1197 pub fn strerror(n
: c_int
) -> *mut c_char
;
1198 pub fn strtok(s
: *mut c_char
, t
: *const c_char
) -> *mut c_char
;
1199 pub fn strxfrm(s
: *mut c_char
, ct
: *const c_char
, n
: size_t
) -> size_t
;
1200 pub fn wcslen(buf
: *const wchar_t
) -> size_t
;
1203 src
: *const wchar_t
,
1207 pub fn memchr(cx
: *const c_void
, c
: c_int
, n
: size_t
) -> *mut c_void
;
1208 pub fn wmemchr(cx
: *const wchar_t
, c
: wchar_t
, n
: size_t
) -> *mut wchar_t
;
1209 pub fn memcmp(cx
: *const c_void
, ct
: *const c_void
, n
: size_t
) -> c_int
;
1220 pub fn memset(dest
: *mut c_void
, c
: c_int
, n
: size_t
) -> *mut c_void
;
1225 stream
: *mut ::FILE
,
1226 format
: *const ::c_char
,
1229 pub fn printf(format
: *const ::c_char
, ...) -> ::c_int
;
1233 format
: *const ::c_char
,
1236 pub fn sprintf(s
: *mut ::c_char
, format
: *const ::c_char
, ...) -> ::c_int
;
1238 stream
: *mut ::FILE
,
1239 format
: *const ::c_char
,
1242 pub fn scanf(format
: *const ::c_char
, ...) -> ::c_int
;
1243 pub fn sscanf(s
: *const ::c_char
, format
: *const ::c_char
, ...)
1245 pub fn getchar_unlocked() -> ::c_int
;
1246 pub fn putchar_unlocked(c
: ::c_int
) -> ::c_int
;
1247 pub fn stat(path
: *const c_char
, buf
: *mut stat
) -> ::c_int
;
1248 pub fn fdopen(fd
: ::c_int
, mode
: *const c_char
) -> *mut ::FILE
;
1249 pub fn fileno(stream
: *mut ::FILE
) -> ::c_int
;
1250 pub fn creat(path
: *const c_char
, mode
: mode_t
) -> ::c_int
;
1251 pub fn rewinddir(dirp
: *mut ::DIR
);
1252 pub fn fchown(fd
: ::c_int
, owner
: ::uid_t
, group
: ::gid_t
) -> ::c_int
;
1253 pub fn access(path
: *const c_char
, amode
: ::c_int
) -> ::c_int
;
1254 pub fn alarm(seconds
: ::c_uint
) -> ::c_uint
;
1255 pub fn fchdir(dirfd
: ::c_int
) -> ::c_int
;
1256 pub fn chown(path
: *const c_char
, uid
: uid_t
, gid
: gid_t
) -> ::c_int
;
1257 pub fn fpathconf(filedes
: ::c_int
, name
: ::c_int
) -> c_long
;
1258 pub fn getegid() -> gid_t
;
1259 pub fn geteuid() -> uid_t
;
1260 pub fn getgroups(ngroups_max
: ::c_int
, groups
: *mut gid_t
) -> ::c_int
;
1261 pub fn getlogin() -> *mut c_char
;
1264 argv
: *const *mut c_char
,
1265 optstr
: *const c_char
,
1267 pub fn pathconf(path
: *const c_char
, name
: ::c_int
) -> c_long
;
1268 pub fn pause() -> ::c_int
;
1269 pub fn seteuid(uid
: uid_t
) -> ::c_int
;
1270 pub fn setegid(gid
: gid_t
) -> ::c_int
;
1271 pub fn sleep(secs
: ::c_uint
) -> ::c_uint
;
1272 pub fn ttyname(fd
: ::c_int
) -> *mut c_char
;
1273 pub fn wait(status
: *mut ::c_int
) -> pid_t
;
1274 pub fn umask(mask
: mode_t
) -> mode_t
;
1275 pub fn mlock(addr
: *const ::c_void
, len
: ::size_t
) -> ::c_int
;
1276 pub fn mlockall(flags
: ::c_int
) -> ::c_int
;
1277 pub fn munlockall() -> ::c_int
;
1280 addr
: *mut ::c_void
,
1287 pub fn munmap(addr
: *mut ::c_void
, len
: ::size_t
) -> ::c_int
;
1288 pub fn truncate(path
: *const c_char
, length
: off_t
) -> ::c_int
;
1290 pub fn gettimeofday(tp
: *mut ::timeval
, tz
: *mut ::c_void
) -> ::c_int
;
1291 pub fn pthread_exit(value
: *mut ::c_void
) -> !;
1292 pub fn pthread_attr_setdetachstate(
1293 attr
: *mut ::pthread_attr_t
,
1305 act
: *const sigaction
,
1306 oldact
: *mut sigaction
,
1310 filename
: *const ::c_char
,
1311 times
: *const ::timeval
,
1314 #[link_name = "_rtld_dlopen"]
1315 pub fn dlopen(filename
: *const ::c_char
, flag
: ::c_int
) -> *mut ::c_void
;
1317 #[link_name = "_rtld_dlerror"]
1318 pub fn dlerror() -> *mut ::c_char
;
1320 #[link_name = "_rtld_dlsym"]
1322 handle
: *mut ::c_void
,
1323 symbol
: *const ::c_char
,
1326 #[link_name = "_rtld_dlclose"]
1327 pub fn dlclose(handle
: *mut ::c_void
) -> ::c_int
;
1329 #[link_name = "_rtld_dladdr"]
1330 pub fn dladdr(addr
: *mut ::c_void
, info
: *mut Dl_info
) -> ::c_int
;
1333 pub fn gmtime_r(time_p
: *const time_t
, result
: *mut tm
) -> *mut tm
;
1334 pub fn localtime_r(time_p
: *const time_t
, result
: *mut tm
) -> *mut tm
;
1335 pub fn mktime(tm
: *mut tm
) -> time_t
;
1336 pub fn time(time
: *mut time_t
) -> time_t
;
1337 pub fn gmtime(time_p
: *const time_t
) -> *mut tm
;
1338 pub fn localtime(time_p
: *const time_t
) -> *mut tm
;
1339 pub fn timegm(tm
: *mut tm
) -> time_t
;
1340 pub fn difftime(time1
: time_t
, time0
: time_t
) -> ::c_double
;
1341 pub fn gethostname(name
: *mut ::c_char
, len
: ::size_t
) -> ::c_int
;
1342 pub fn usleep(secs
: ::useconds_t
) -> ::c_int
;
1343 pub fn putenv(string
: *mut c_char
) -> ::c_int
;
1346 locale
: *const ::c_char
,
1351 set
: *const sigset_t
,
1352 oldset
: *mut sigset_t
,
1354 pub fn sigpending(set
: *mut sigset_t
) -> ::c_int
;
1356 pub fn mkfifo(path
: *const c_char
, mode
: mode_t
) -> ::c_int
;
1359 stream
: *mut ::FILE
,
1363 pub fn ftello(stream
: *mut ::FILE
) -> ::off_t
;
1364 pub fn mkstemp(template
: *mut ::c_char
) -> ::c_int
;
1366 pub fn tmpnam(ptr
: *mut ::c_char
) -> *mut ::c_char
;
1368 pub fn openlog(ident
: *const ::c_char
, logopt
: ::c_int
, facility
: ::c_int
);
1370 pub fn setlogmask(maskpri
: ::c_int
) -> ::c_int
;
1371 pub fn syslog(priority
: ::c_int
, message
: *const ::c_char
, ...);
1373 lineptr
: *mut *mut c_char
,
1382 pub fn memalign(block_size
: ::size_t
, size_arg
: ::size_t
)
1386 pub fn getcwd(buf
: *mut ::c_char
, size
: ::size_t
) -> *mut ::c_char
;
1389 pub fn chdir(attr
: *const ::c_char
) -> ::c_int
;
1392 pub fn pthread_mutexattr_init(attr
: *mut pthread_mutexattr_t
) -> ::c_int
;
1395 pub fn pthread_mutexattr_destroy(
1396 attr
: *mut pthread_mutexattr_t
,
1400 pub fn pthread_mutexattr_settype(
1401 pAttr
: *mut ::pthread_mutexattr_t
,
1406 pub fn pthread_mutex_init(
1407 mutex
: *mut pthread_mutex_t
,
1408 attr
: *const pthread_mutexattr_t
,
1412 pub fn pthread_mutex_destroy(mutex
: *mut pthread_mutex_t
) -> ::c_int
;
1415 pub fn pthread_mutex_lock(mutex
: *mut pthread_mutex_t
) -> ::c_int
;
1418 pub fn pthread_mutex_trylock(mutex
: *mut pthread_mutex_t
) -> ::c_int
;
1421 pub fn pthread_mutex_timedlock(
1422 attr
: *mut pthread_mutex_t
,
1423 spec
: *const timespec
,
1427 pub fn pthread_mutex_unlock(mutex
: *mut pthread_mutex_t
) -> ::c_int
;
1430 pub fn pthread_attr_setname(
1431 pAttr
: *mut ::pthread_attr_t
,
1432 name
: *mut ::c_char
,
1436 pub fn pthread_attr_setstacksize(
1437 attr
: *mut ::pthread_attr_t
,
1438 stacksize
: ::size_t
,
1442 pub fn pthread_attr_getstacksize(
1443 attr
: *const ::pthread_attr_t
,
1444 size
: *mut ::size_t
,
1448 pub fn pthread_attr_init(attr
: *mut ::pthread_attr_t
) -> ::c_int
;
1451 pub fn pthread_create(
1452 pThread
: *mut ::pthread_t
,
1453 pAttr
: *const ::pthread_attr_t
,
1454 start_routine
: extern "C" fn(*mut ::c_void
) -> *mut ::c_void
,
1455 value
: *mut ::c_void
,
1459 pub fn pthread_attr_destroy(thread
: *mut ::pthread_attr_t
) -> ::c_int
;
1462 pub fn pthread_detach(thread
: ::pthread_t
) -> ::c_int
;
1464 // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void));
1465 pub fn pthread_atfork(
1466 prepare
: ::Option
<unsafe extern "C" fn()>,
1467 parent
: ::Option
<unsafe extern "C" fn()>,
1468 child
: ::Option
<unsafe extern "C" fn()>,
1471 pub fn fstat(fildes
: ::c_int
, buf
: *mut stat
) -> ::c_int
;
1474 pub fn lstat(path
: *const ::c_char
, buf
: *mut stat
) -> ::c_int
;
1477 pub fn ftruncate(fd
: ::c_int
, length
: off_t
) -> ::c_int
;
1482 entry
: *mut ::dirent
,
1483 result
: *mut *mut ::dirent
,
1487 pub fn readdir(pDir
: *mut ::DIR
) -> *mut ::dirent
;
1491 pub fn open(path
: *const ::c_char
, oflag
: ::c_int
, ...) -> ::c_int
;
1494 pub fn poll(fds
: *mut pollfd
, nfds
: nfds_t
, timeout
: ::c_int
) -> ::c_int
;
1497 pub fn pthread_condattr_init(attr
: *mut ::pthread_condattr_t
) -> ::c_int
;
1500 pub fn pthread_condattr_destroy(
1501 attr
: *mut ::pthread_condattr_t
,
1505 pub fn pthread_condattr_getclock(
1506 pAttr
: *const ::pthread_condattr_t
,
1507 pClockId
: *mut ::clockid_t
,
1511 pub fn pthread_condattr_setclock(
1512 pAttr
: *mut ::pthread_condattr_t
,
1513 clockId
: ::clockid_t
,
1517 pub fn pthread_cond_init(
1518 cond
: *mut ::pthread_cond_t
,
1519 attr
: *const ::pthread_condattr_t
,
1523 pub fn pthread_cond_destroy(cond
: *mut pthread_cond_t
) -> ::c_int
;
1526 pub fn pthread_cond_signal(cond
: *mut ::pthread_cond_t
) -> ::c_int
;
1529 pub fn pthread_cond_broadcast(cond
: *mut ::pthread_cond_t
) -> ::c_int
;
1532 pub fn pthread_cond_wait(
1533 cond
: *mut ::pthread_cond_t
,
1534 mutex
: *mut ::pthread_mutex_t
,
1538 pub fn pthread_rwlockattr_init(
1539 attr
: *mut ::pthread_rwlockattr_t
,
1543 pub fn pthread_rwlockattr_destroy(
1544 attr
: *mut ::pthread_rwlockattr_t
,
1548 pub fn pthread_rwlockattr_setmaxreaders(
1549 attr
: *mut ::pthread_rwlockattr_t
,
1554 pub fn pthread_rwlock_init(
1555 attr
: *mut ::pthread_rwlock_t
,
1556 host
: *const ::pthread_rwlockattr_t
,
1560 pub fn pthread_rwlock_destroy(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1563 pub fn pthread_rwlock_rdlock(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1566 pub fn pthread_rwlock_tryrdlock(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1569 pub fn pthread_rwlock_timedrdlock(
1570 attr
: *mut ::pthread_rwlock_t
,
1571 host
: *const ::timespec
,
1575 pub fn pthread_rwlock_wrlock(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1578 pub fn pthread_rwlock_trywrlock(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1581 pub fn pthread_rwlock_timedwrlock(
1582 attr
: *mut ::pthread_rwlock_t
,
1583 host
: *const ::timespec
,
1587 pub fn pthread_rwlock_unlock(attr
: *mut ::pthread_rwlock_t
) -> ::c_int
;
1590 pub fn pthread_key_create(
1591 key
: *mut ::pthread_key_t
,
1592 dtor
: ::Option
<unsafe extern "C" fn(*mut ::c_void
)>,
1596 pub fn pthread_key_delete(key
: ::pthread_key_t
) -> ::c_int
;
1599 pub fn pthread_setspecific(
1600 key
: ::pthread_key_t
,
1601 value
: *const ::c_void
,
1605 pub fn pthread_getspecific(key
: ::pthread_key_t
) -> *mut ::c_void
;
1608 pub fn pthread_cond_timedwait(
1609 cond
: *mut ::pthread_cond_t
,
1610 mutex
: *mut ::pthread_mutex_t
,
1611 abstime
: *const ::timespec
,
1615 pub fn pthread_attr_getname(
1616 attr
: *mut ::pthread_attr_t
,
1617 name
: *mut *mut ::c_char
,
1621 pub fn pthread_join(
1622 thread
: ::pthread_t
,
1623 status
: *mut *mut ::c_void
,
1627 pub fn pthread_self() -> ::pthread_t
;
1630 pub fn clock_gettime(
1631 clock_id
: ::clockid_t
,
1632 tp
: *mut ::timespec
,
1636 pub fn clock_settime(
1637 clock_id
: ::clockid_t
,
1638 tp
: *const ::timespec
,
1642 pub fn clock_getres(
1643 clock_id
: ::clockid_t
,
1644 res
: *mut ::timespec
,
1648 pub fn clock_nanosleep(
1649 clock_id
: ::clockid_t
,
1651 rqtp
: *const ::timespec
,
1652 rmtp
: *mut ::timespec
,
1657 rqtp
: *const ::timespec
,
1658 rmtp
: *mut ::timespec
,
1664 addr
: *mut ::sockaddr
,
1665 addrlen
: *mut ::socklen_t
,
1669 pub fn bind(fd
: ::c_int
, addr
: *const sockaddr
, len
: socklen_t
)
1675 name
: *const ::sockaddr
,
1676 namelen
: ::socklen_t
,
1682 name
: *mut ::sockaddr
,
1683 namelen
: *mut ::socklen_t
,
1689 address
: *mut sockaddr
,
1690 address_len
: *mut socklen_t
,
1698 optval
: *mut ::c_void
,
1699 optlen
: *mut ::socklen_t
,
1703 pub fn listen(socket
: ::c_int
, backlog
: ::c_int
) -> ::c_int
;
1719 from
: *mut ::sockaddr
,
1720 pFromLen
: *mut ::socklen_t
,
1732 buf
: *const ::c_void
,
1739 mp
: *const ::msghdr
,
1746 buf
: *const ::c_void
,
1749 addr
: *const sockaddr
,
1758 value
: *const ::c_void
,
1759 option_len
: socklen_t
,
1763 pub fn shutdown(s
: ::c_int
, how
: ::c_int
) -> ::c_int
;
1773 pub fn ioctl(fd
: ::c_int
, request
: ::c_int
, ...) -> ::c_int
;
1776 pub fn fcntl(fd
: ::c_int
, cmd
: ::c_int
, ...) -> ::c_int
;
1778 // ntp_rfc2553.h for kernel
1780 pub fn gai_strerror(errcode
: ::c_int
) -> *mut ::c_char
;
1784 pub fn close(fd
: ::c_int
) -> ::c_int
;
1788 pub fn read(fd
: ::c_int
, buf
: *mut ::c_void
, count
: ::size_t
)
1795 buf
: *const ::c_void
,
1801 pub fn isatty(fd
: ::c_int
) -> ::c_int
;
1805 pub fn dup(src
: ::c_int
) -> ::c_int
;
1809 pub fn dup2(src
: ::c_int
, dst
: ::c_int
) -> ::c_int
;
1813 pub fn pipe(fds
: *mut ::c_int
) -> ::c_int
;
1817 pub fn unlink(pathname
: *const ::c_char
) -> ::c_int
;
1821 pub fn lseek(fd
: ::c_int
, offset
: off_t
, whence
: ::c_int
) -> off_t
;
1825 node
: *const ::c_char
,
1826 service
: *const ::c_char
,
1827 hints
: *const addrinfo
,
1828 res
: *mut *mut addrinfo
,
1832 pub fn freeaddrinfo(res
: *mut addrinfo
);
1835 pub fn signal(signum
: ::c_int
, handler
: sighandler_t
) -> sighandler_t
;
1838 pub fn getpid() -> pid_t
;
1841 pub fn getppid() -> pid_t
;
1844 pub fn waitpid(pid
: pid_t
, status
: *mut ::c_int
, optons
: ::c_int
)
1848 pub fn sysconf(attr
: ::c_int
) -> ::c_long
;
1853 envVarName
: *const ::c_char
,
1854 envVarValue
: *const ::c_char
,
1861 envVarName
: *const ::c_char
,
1866 fileName
: *const ::c_char
,
1867 resolvedName
: *mut ::c_char
,
1871 pub fn link(src
: *const ::c_char
, dst
: *const ::c_char
) -> ::c_int
;
1875 path
: *const ::c_char
,
1881 pub fn symlink(path1
: *const ::c_char
, path2
: *const ::c_char
) -> ::c_int
;
1884 pub fn opendir(name
: *const ::c_char
) -> *mut ::DIR
;
1887 pub fn rmdir(path
: *const ::c_char
) -> ::c_int
;
1890 pub fn mkdir(dirName
: *const ::c_char
, mode
: ::mode_t
) -> ::c_int
;
1893 pub fn chmod(path
: *const ::c_char
, mode
: ::mode_t
) -> ::c_int
;
1896 pub fn fchmod(attr1
: ::c_int
, attr2
: ::mode_t
) -> ::c_int
;
1899 pub fn fsync(fd
: ::c_int
) -> ::c_int
;
1902 pub fn closedir(ptr
: *mut ::DIR
) -> ::c_int
;
1905 pub fn sched_yield() -> ::c_int
;
1908 pub fn errnoSet(err
: ::c_int
) -> ::c_int
;
1911 pub fn errnoGet() -> ::c_int
;
1914 pub fn _exit(status
: ::c_int
) -> !;
1917 pub fn setgid(gid
: ::gid_t
) -> ::c_int
;
1920 pub fn getgid() -> ::gid_t
;
1923 pub fn setuid(uid
: ::uid_t
) -> ::c_int
;
1926 pub fn getuid() -> ::uid_t
;
1929 pub fn sigemptyset(__set
: *mut sigset_t
) -> ::c_int
;
1931 // pthread.h for kernel
1932 // signal.h for user
1933 pub fn pthread_sigmask(
1935 __set
: *const sigset_t
,
1936 __oset
: *mut sigset_t
,
1939 // signal.h for user
1940 pub fn kill(__pid
: pid_t
, __signo
: ::c_int
) -> ::c_int
;
1942 // signal.h for user
1949 // signal.h for user
1953 pValue
: *const ::sigval
,
1958 pub fn taskKill(taskId
: ::TASK_ID
, signo
: ::c_int
) -> ::c_int
;
1961 pub fn raise(__signo
: ::c_int
) -> ::c_int
;
1964 pub fn taskIdSelf() -> ::TASK_ID
;
1965 pub fn taskDelay(ticks
: ::_Vx_ticks_t
) -> ::c_int
;
1968 pub fn rtpInfoGet(rtpId
: ::RTP_ID
, rtpStruct
: *mut ::RTP_DESC
) -> ::c_int
;
1970 pubrtpFileName
: *const ::c_char
,
1971 argv
: *mut *const ::c_char
,
1972 envp
: *mut *const ::c_char
,
1974 uStackSize
: ::size_t
,
1976 taskOptions
: ::c_int
,
1981 fileName
: *const ::c_char
,
1982 resolvedName
: *mut ::c_char
,
1986 pub fn _pathIsAbsolute(
1987 filepath
: *const ::c_char
,
1988 pNameTail
: *mut *const ::c_char
,
1993 iov
: *const ::iovec
,
1998 iov
: *const ::iovec
,
2003 pub fn randBytes(buf
: *mut c_uchar
, length
: c_int
) -> c_int
;
2004 pub fn randABytes(buf
: *mut c_uchar
, length
: c_int
) -> c_int
;
2005 pub fn randUBytes(buf
: *mut c_uchar
, length
: c_int
) -> c_int
;
2006 pub fn randSecure() -> c_int
;
2009 pub fn mq_open(name
: *const ::c_char
, oflag
: ::c_int
, ...) -> ::mqd_t
;
2010 pub fn mq_close(mqd
: ::mqd_t
) -> ::c_int
;
2011 pub fn mq_unlink(name
: *const ::c_char
) -> ::c_int
;
2014 msg_ptr
: *mut ::c_char
,
2016 msg_prio
: *mut ::c_uint
,
2018 pub fn mq_timedreceive(
2020 msg_ptr
: *mut ::c_char
,
2022 msg_prio
: *mut ::c_uint
,
2023 abs_timeout
: *const ::timespec
,
2027 msg_ptr
: *const ::c_char
,
2031 pub fn mq_timedsend(
2033 msg_ptr
: *const ::c_char
,
2036 abs_timeout
: *const ::timespec
,
2038 pub fn mq_getattr(mqd
: ::mqd_t
, attr
: *mut ::mq_attr
) -> ::c_int
;
2041 newattr
: *const ::mq_attr
,
2042 oldattr
: *mut ::mq_attr
,
2046 //Dummy functions, these don't really exist in VxWorks.
2050 pub {const}
fn WIFEXITED(status
: ::c_int
) -> bool
{
2051 (status
& 0xFF00) == 0
2053 pub {const}
fn WIFSIGNALED(status
: ::c_int
) -> bool
{
2054 (status
& 0xFF00) != 0
2056 pub {const}
fn WIFSTOPPED(status
: ::c_int
) -> bool
{
2057 (status
& 0xFF0000) != 0
2059 pub {const}
fn WEXITSTATUS(status
: ::c_int
) -> ::c_int
{
2062 pub {const}
fn WTERMSIG(status
: ::c_int
) -> ::c_int
{
2063 (status
>> 8) & 0xFF
2065 pub {const}
fn WSTOPSIG(status
: ::c_int
) -> ::c_int
{
2066 (status
>> 16) & 0xFF
2072 _buf
: *mut ::c_void
,
2081 _buf
: *const ::c_void
,
2087 pub fn posix_memalign(
2088 memptr
: *mut *mut ::c_void
,
2092 // check to see if align is a power of 2 and if align is a multiple
2093 // of sizeof(void *)
2094 if (align
& align
- 1 != 0)
2095 || (align
as usize % size_of
::<::size_t
>() != 0)
2101 // posix_memalign should not set errno
2102 let e
= ::errnoGet();
2104 let temp
= memalign(align
, size
);
2105 ::errnoSet(e
as ::c_int
);
2117 if #[cfg(libc_core_cvoid)] {
2118 pub use ::ffi
::c_void
;
2120 // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
2121 // enable more optimization opportunities around it recognizing things
2122 // like malloc/free.
2124 #[allow(missing_copy_implementations)]
2125 #[allow(missing_debug_implementations)]
2127 // Two dummy variants so the #[repr] attribute can be used.
2137 if #[cfg(target_arch = "aarch64")] {
2139 pub use self::aarch64
::*;
2140 } else if #[cfg(any(target_arch = "arm"))] {
2142 pub use self::arm
::*;
2143 } else if #[cfg(any(target_arch = "x86"))] {
2145 pub use self::x86
::*;
2146 } else if #[cfg(any(target_arch = "x86_64"))] {
2148 pub use self::x86_64
::*;
2149 } else if #[cfg(any(target_arch = "powerpc"))] {
2151 pub use self::powerpc
::*;
2152 } else if #[cfg(any(target_arch = "powerpc64"))] {
2154 pub use self::powerpc64
::*;
2156 // Unknown target_arch