This commit is contained in:
Jeremy Soller
2018-08-27 06:35:30 -06:00
parent 7ab700315d
commit bab4e2896a
70 changed files with 363 additions and 404 deletions
+7
View File
@@ -0,0 +1,7 @@
sys_includes = []
include_guard = "_PTHREAD_H"
language = "C"
style = "Tag"
[enum]
prefix_with_name = true
@@ -1,13 +1,26 @@
use platform::types::*;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sched_param {
pub _address: u8,
}
impl Clone for sched_param {
fn clone(&self) -> Self {
*self
}
}
// #[no_mangle]
pub extern "C" fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> libc::c_int {
pub extern "C" fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_getdetachstate(
attr: *const pthread_attr_t,
detachstate: *mut libc::c_int,
) -> libc::c_int {
detachstate: *mut c_int,
) -> c_int {
unimplemented!();
}
@@ -15,15 +28,15 @@ pub extern "C" fn pthread_attr_getdetachstate(
pub extern "C" fn pthread_attr_getguardsize(
attr: *const pthread_attr_t,
guardsize: *mut usize,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_getinheritsched(
attr: *const pthread_attr_t,
inheritsched: *mut libc::c_int,
) -> libc::c_int {
inheritsched: *mut c_int,
) -> c_int {
unimplemented!();
}
@@ -31,31 +44,31 @@ pub extern "C" fn pthread_attr_getinheritsched(
pub extern "C" fn pthread_attr_getschedparam(
attr: *const pthread_attr_t,
param: *mut sched_param,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_getschedpolicy(
attr: *const pthread_attr_t,
policy: *mut libc::c_int,
) -> libc::c_int {
policy: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_getscope(
attr: *const pthread_attr_t,
contentionscope: *mut libc::c_int,
) -> libc::c_int {
contentionscope: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_getstackaddr(
attr: *const pthread_attr_t,
stackaddr: *mut *mut libc::c_void,
) -> libc::c_int {
stackaddr: *mut *mut c_void,
) -> c_int {
unimplemented!();
}
@@ -63,33 +76,33 @@ pub extern "C" fn pthread_attr_getstackaddr(
pub extern "C" fn pthread_attr_getstacksize(
attr: *const pthread_attr_t,
stacksize: *mut usize,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_init(arg1: *mut pthread_attr_t) -> libc::c_int {
pub extern "C" fn pthread_attr_init(arg1: *mut pthread_attr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setdetachstate(
attr: *mut pthread_attr_t,
detachstate: libc::c_int,
) -> libc::c_int {
detachstate: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setguardsize(arg1: *mut pthread_attr_t, arg2: usize) -> libc::c_int {
pub extern "C" fn pthread_attr_setguardsize(arg1: *mut pthread_attr_t, arg2: usize) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setinheritsched(
attr: *mut pthread_attr_t,
inheritsched: libc::c_int,
) -> libc::c_int {
inheritsched: c_int,
) -> c_int {
unimplemented!();
}
@@ -97,61 +110,61 @@ pub extern "C" fn pthread_attr_setinheritsched(
pub extern "C" fn pthread_attr_setschedparam(
attr: *mut pthread_attr_t,
param: *mut sched_param,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setschedpolicy(
attr: *mut pthread_attr_t,
policy: libc::c_int,
) -> libc::c_int {
policy: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setscope(
attr: *mut pthread_attr_t,
contentionscope: libc::c_int,
) -> libc::c_int {
contentionscope: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setstackaddr(
attr: *mut pthread_attr_t,
stackaddr: *mut libc::c_void,
) -> libc::c_int {
stackaddr: *mut c_void,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stacksize: usize) -> libc::c_int {
pub extern "C" fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stacksize: usize) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cancel(thread: pthread_t) -> libc::c_int {
pub extern "C" fn pthread_cancel(thread: pthread_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cleanup_push(routine: *mut libc::c_void, arg: *mut libc::c_void) {
pub extern "C" fn pthread_cleanup_push(routine: *mut c_void, arg: *mut c_void) {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cleanup_pop(execute: libc::c_int) {
pub extern "C" fn pthread_cleanup_pop(execute: c_int) {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> libc::c_int {
pub extern "C" fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> libc::c_int {
pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int {
unimplemented!();
}
@@ -159,12 +172,12 @@ pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> libc::c_int
pub extern "C" fn pthread_cond_init(
cond: *mut pthread_cond_t,
attr: *const pthread_condattr_t,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_cond_signal(cond: *mut pthread_cond_t) -> libc::c_int {
pub extern "C" fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int {
unimplemented!();
}
@@ -173,7 +186,7 @@ pub extern "C" fn pthread_cond_timedwait(
cond: *mut pthread_cond_t,
mutex: *mut pthread_mutex_t,
abstime: *const timespec,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
@@ -181,33 +194,33 @@ pub extern "C" fn pthread_cond_timedwait(
pub extern "C" fn pthread_cond_wait(
cond: *mut pthread_cond_t,
mutex: *mut pthread_mutex_t,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> libc::c_int {
pub extern "C" fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_condattr_getpshared(
attr: *const pthread_condattr_t,
pshared: *mut libc::c_int,
) -> libc::c_int {
pshared: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> libc::c_int {
pub extern "C" fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_condattr_setpshared(
attr: *mut pthread_condattr_t,
pshared: libc::c_int,
) -> libc::c_int {
pshared: c_int,
) -> c_int {
unimplemented!();
}
@@ -215,74 +228,74 @@ pub extern "C" fn pthread_condattr_setpshared(
pub extern "C" fn pthread_create(
thread: *mut pthread_t,
attr: *const pthread_attr_t,
start_routine: Option<unsafe extern "C" fn(arg1: *mut libc::c_void) -> *mut libc::c_void>,
arg: *mut libc::c_void,
) -> libc::c_int {
start_routine: Option<unsafe extern "C" fn(arg1: *mut c_void) -> *mut c_void>,
arg: *mut c_void,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_detach(thread: pthread_t) -> libc::c_int {
pub extern "C" fn pthread_detach(thread: pthread_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_equal(t1: pthread_t, t2: pthread_t) -> libc::c_int {
pub extern "C" fn pthread_equal(t1: pthread_t, t2: pthread_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_exit(value_ptr: *mut libc::c_void) {
pub extern "C" fn pthread_exit(value_ptr: *mut c_void) {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_getconcurrency() -> libc::c_int {
pub extern "C" fn pthread_getconcurrency() -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_getschedparam(
thread: pthread_t,
policy: *mut libc::c_int,
policy: *mut c_int,
param: *mut sched_param,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_getspecific(key: pthread_key_t) -> *mut libc::c_void {
pub extern "C" fn pthread_getspecific(key: pthread_key_t) -> *mut c_void {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_join(thread: pthread_t, value_ptr: *mut *mut libc::c_void) -> libc::c_int {
pub extern "C" fn pthread_join(thread: pthread_t, value_ptr: *mut *mut c_void) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_key_create(
key: *mut pthread_key_t,
destructor: Option<unsafe extern "C" fn(arg1: *mut libc::c_void)>,
) -> libc::c_int {
destructor: Option<unsafe extern "C" fn(arg1: *mut c_void)>,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_key_delete(key: pthread_key_t) -> libc::c_int {
pub extern "C" fn pthread_key_delete(key: pthread_key_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> libc::c_int {
pub extern "C" fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_getprioceiling(
mutex: *const pthread_mutex_t,
prioceiling: *mut libc::c_int,
) -> libc::c_int {
prioceiling: *mut c_int,
) -> c_int {
unimplemented!();
}
@@ -290,105 +303,105 @@ pub extern "C" fn pthread_mutex_getprioceiling(
pub extern "C" fn pthread_mutex_init(
mutex: *mut pthread_mutex_t,
attr: *const pthread_mutexattr_t,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> libc::c_int {
pub extern "C" fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_setprioceiling(
mutex: *mut pthread_mutex_t,
prioceiling: libc::c_int,
old_ceiling: *mut libc::c_int,
) -> libc::c_int {
prioceiling: c_int,
old_ceiling: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> libc::c_int {
pub extern "C" fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> libc::c_int {
pub extern "C" fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> libc::c_int {
pub extern "C" fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_getprioceiling(
attr: *const pthread_mutexattr_t,
prioceiling: *mut libc::c_int,
) -> libc::c_int {
prioceiling: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_getprotocol(
attr: *const pthread_mutexattr_t,
protocol: *mut libc::c_int,
) -> libc::c_int {
protocol: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_getpshared(
attr: *const pthread_mutexattr_t,
pshared: *mut libc::c_int,
) -> libc::c_int {
pshared: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_gettype(
attr: *const pthread_mutexattr_t,
type_: *mut libc::c_int,
) -> libc::c_int {
type_: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> libc::c_int {
pub extern "C" fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_setprioceiling(
attr: *mut pthread_mutexattr_t,
prioceiling: libc::c_int,
) -> libc::c_int {
prioceiling: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_setprotocol(
attr: *mut pthread_mutexattr_t,
protocol: libc::c_int,
) -> libc::c_int {
protocol: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_setpshared(
attr: *mut pthread_mutexattr_t,
pshared: libc::c_int,
) -> libc::c_int {
pshared: c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_mutexattr_settype(
attr: *mut pthread_mutexattr_t,
type_: libc::c_int,
) -> libc::c_int {
type_: c_int,
) -> c_int {
unimplemented!();
}
@@ -396,12 +409,12 @@ pub extern "C" fn pthread_mutexattr_settype(
pub extern "C" fn pthread_once(
once_control: *mut pthread_once_t,
init_routine: Option<unsafe extern "C" fn()>,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
@@ -409,58 +422,58 @@ pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> libc:
pub extern "C" fn pthread_rwlock_init(
rwlock: *mut pthread_rwlock_t,
attr: *const pthread_rwlockattr_t,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_rdlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_rdlock(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_tryrdlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_tryrdlock(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_trywrlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_trywrlock(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_unlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_unlock(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlock_wrlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
pub extern "C" fn pthread_rwlock_wrlock(rwlock: *mut pthread_rwlock_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlockattr_destroy(rwlock: *mut pthread_rwlockattr_t) -> libc::c_int {
pub extern "C" fn pthread_rwlockattr_destroy(rwlock: *mut pthread_rwlockattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlockattr_getpshared(
rwlock: *const pthread_rwlockattr_t,
pshared: *mut libc::c_int,
) -> libc::c_int {
pshared: *mut c_int,
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlockattr_init(rwlock: *mut pthread_rwlockattr_t) -> libc::c_int {
pub extern "C" fn pthread_rwlockattr_init(rwlock: *mut pthread_rwlockattr_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_rwlockattr_setpshared(
rwlock: *mut pthread_rwlockattr_t,
pshared: libc::c_int,
) -> libc::c_int {
pshared: c_int,
) -> c_int {
unimplemented!();
}
@@ -470,34 +483,34 @@ pub extern "C" fn pthread_self() -> pthread_t {
}
// #[no_mangle]
pub extern "C" fn pthread_setcancelstate(state: libc::c_int, oldstate: *mut libc::c_int) -> libc::c_int {
pub extern "C" fn pthread_setcancelstate(state: c_int, oldstate: *mut c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_setcanceltype(type_: libc::c_int, oldtype: *mut libc::c_int) -> libc::c_int {
pub extern "C" fn pthread_setcanceltype(type_: c_int, oldtype: *mut c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_setconcurrency(new_level: libc::c_int) -> libc::c_int {
pub extern "C" fn pthread_setconcurrency(new_level: c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_setschedparam(
thread: pthread_t,
policy: libc::c_int,
policy: c_int,
param: *mut sched_param,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn pthread_setspecific(
key: pthread_key_t,
value: *const libc::c_void,
) -> libc::c_int {
value: *const c_void,
) -> c_int {
unimplemented!();
}
@@ -505,44 +518,3 @@ pub extern "C" fn pthread_setspecific(
pub extern "C" fn pthread_testcancel() {
unimplemented!();
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sched_param {
pub _address: u8,
}
impl Clone for sched_param {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sched_param {
pub _address: u8,
}
impl Clone for sched_param {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sched_param {
pub _address: u8,
}
impl Clone for sched_param {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sched_param {
pub _address: u8,
}
impl Clone for sched_param {
fn clone(&self) -> Self {
*self
}
}
-89
View File
@@ -1,89 +0,0 @@
// #[no_mangle]
pub extern "C" fn iswalnum(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswalpha(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswcntrl(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswdigit(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswgraph(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswlower(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswprint(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswpunct(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswspace(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswupper(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswxdigit(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswblank(wc: wint_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn wctype(property: *const libc::c_char, locale: locale_t) -> wctype_t {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn iswctype(wc: wint_t, desc: wctype_t, locale: locale_t) -> libc::c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn towlower(wc: wint_t, locale: locale_t) -> wint_t {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn towupper(wc: wint_t, locale: locale_t) -> wint_t {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn wctrans(property: *const libc::c_char, locale: locale_t) -> wctrans_t {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn towctrans(wc: wint_t, desc: wctrans_t, locale: locale_t) -> wint_t {
unimplemented!();
}
+7
View File
@@ -0,0 +1,7 @@
sys_includes = []
include_guard = "_AIO_H"
language = "C"
style = "Tag"
[enum]
prefix_with_name = true
@@ -1,34 +1,37 @@
use header::time::sigevent;
use platform::types::*;
pub struct aiocb {
pub aio_fildes: libc::c_int,
pub aio_lio_opcode: libc::c_int,
pub aio_reqprio: libc::c_int,
pub aio_buf: *mut libc::c_void,
pub aio_fildes: c_int,
pub aio_lio_opcode: c_int,
pub aio_reqprio: c_int,
pub aio_buf: *mut c_void,
pub aio_nbytes: usize,
pub aio_sigevent: sigevent,
}
// #[no_mangle]
pub extern "C" fn aio_read(aiocbp: *mut aiocb) -> libc::c_int {
pub extern "C" fn aio_read(aiocbp: *mut aiocb) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn aio_write(aiocbp: *mut aiocb) -> libc::c_int {
pub extern "C" fn aio_write(aiocbp: *mut aiocb) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn lio_listio(
mode: libc::c_int,
mode: c_int,
list: *const *const aiocb,
nent: libc::c_int,
nent: c_int,
sig: *mut sigevent,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn aio_error(aiocbp: *const aiocb) -> libc::c_int {
pub extern "C" fn aio_error(aiocbp: *const aiocb) -> c_int {
unimplemented!();
}
@@ -38,20 +41,20 @@ pub extern "C" fn aio_return(aiocbp: *mut aiocb) -> usize {
}
// #[no_mangle]
pub extern "C" fn aio_cancel(fildes: libc::c_int, aiocbp: *mut aiocb) -> libc::c_int {
pub extern "C" fn aio_cancel(fildes: c_int, aiocbp: *mut aiocb) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn aio_suspend(
list: *const *const aiocb,
nent: libc::c_int,
nent: c_int,
timeout: *const timespec,
) -> libc::c_int {
) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn aio_fsync(operation: libc::c_int, aiocbp: *mut aiocb) -> libc::c_int {
pub extern "C" fn aio_fsync(operation: c_int, aiocbp: *mut aiocb) -> c_int {
unimplemented!();
}
+1 -1
View File
@@ -5,8 +5,8 @@ use core::{mem, ptr};
use header::{errno, fcntl, unistd};
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
const DIR_BUF_SIZE: usize = mem::size_of::<dirent>() * 3;
+1 -1
View File
@@ -1,7 +1,7 @@
//! fcntl implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.h.html
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub use self::sys::*;
+21 -14
View File
@@ -8,7 +8,7 @@ pub const FNM_NOMATCH: c_int = 1;
pub const FNM_NOESCAPE: c_int = 1;
pub const FNM_PATHNAME: c_int = 2;
pub const FNM_PERIOD: c_int = 4;
pub const FNM_PERIOD: c_int = 4;
pub const FNM_CASEFOLD: c_int = 8;
#[derive(Debug)]
@@ -39,7 +39,7 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
}
*pattern = pattern.offset(1);
Token::Char(c)
},
}
b'?' => Token::Any,
b'*' => Token::Wildcard,
b'[' => {
@@ -47,7 +47,9 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
let invert = if **pattern as u8 == b'!' {
*pattern = pattern.offset(1);
true
} else { false };
} else {
false
};
loop {
let mut c = **pattern as u8;
@@ -64,8 +66,8 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
// Trailing backslash. Maybe error?
break;
}
},
_ => ()
}
_ => (),
}
if matches.len() >= 2 && matches[matches.len() - 1] == b'-' {
let len = matches.len();
@@ -81,13 +83,17 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
// Otherwise, there was no closing ]. Maybe error?
Token::Match(invert, matches)
},
c => Token::Char(c)
}
c => Token::Char(c),
})
}
#[no_mangle]
pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c_char, flags: c_int) -> c_int {
pub unsafe extern "C" fn fnmatch(
mut pattern: *const c_char,
mut input: *const c_char,
flags: c_int,
) -> c_int {
let pathname = flags & FNM_PATHNAME == FNM_PATHNAME;
let casefold = flags & FNM_CASEFOLD == FNM_CASEFOLD;
@@ -109,7 +115,7 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
return FNM_NOMATCH;
}
input = input.offset(1);
},
}
Some(Token::Char(c)) => {
let mut a = *input as u8;
if casefold && a >= b'a' && a <= b'z' {
@@ -126,14 +132,15 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
leading = true;
}
input = input.offset(1);
},
}
Some(Token::Match(invert, matches)) => {
if (pathname && *input as u8 == b'/') || matches.contains(&(*input as u8)) == invert {
if (pathname && *input as u8 == b'/') || matches.contains(&(*input as u8)) == invert
{
// Found it, but it's inverted! Or vise versa.
return FNM_NOMATCH;
}
input = input.offset(1);
},
}
Some(Token::Wildcard) => {
loop {
let c = *input as u8;
@@ -155,8 +162,8 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
}
}
unreachable!("nothing should be able to break out of the loop");
},
None => return FNM_NOMATCH // Pattern ended but there's still some input
}
None => return FNM_NOMATCH, // Pattern ended but there's still some input
}
}
}
+2
View File
@@ -1,3 +1,4 @@
pub mod aio;
pub mod arpa_inet;
pub mod ctype;
pub mod dirent;
@@ -10,6 +11,7 @@ pub mod grp;
pub mod inttypes;
pub mod locale;
pub mod netinet_in;
//pub mod pthread;
pub mod pwd;
pub mod semaphore;
pub mod setjmp;
+4 -4
View File
@@ -9,19 +9,19 @@ pub type in_port_t = u16;
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct in_addr {
pub s_addr: in_addr_t
pub s_addr: in_addr_t,
}
#[repr(C)]
pub struct in6_addr {
pub s6_addr: [u8; 16]
pub s6_addr: [u8; 16],
}
#[repr(C)]
pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr
pub sin_addr: in_addr,
}
#[repr(C)]
@@ -30,7 +30,7 @@ pub struct sockaddr_in6 {
pub sin6_port: in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: in6_addr,
pub sin6_scope_id: u32
pub sin6_scope_id: u32,
}
#[repr(C)]
+1 -1
View File
@@ -5,9 +5,9 @@ use core::ptr;
use header::{errno, fcntl};
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::RawFile;
use platform::{Pal, Sys};
#[repr(C)]
pub struct passwd {
+1 -1
View File
@@ -2,9 +2,9 @@
use core::fmt::Write;
use header::sys_ioctl::*;
use platform;
use platform::types::*;
use header::sys_ioctl::*;
#[no_mangle]
pub extern "C" fn gtty(fd: c_int, out: *mut sgttyb) -> c_int {
+6 -3
View File
@@ -4,8 +4,8 @@ use core::{mem, ptr};
use header::errno;
use platform;
use platform::{PalSignal, Sys};
use platform::types::*;
use platform::{PalSignal, Sys};
pub use self::sys::*;
@@ -147,7 +147,10 @@ extern "C" {
}
#[no_mangle]
pub extern "C" fn signal(sig: c_int, func: Option<extern "C" fn(c_int)>) -> Option<extern "C" fn(c_int)> {
pub extern "C" fn signal(
sig: c_int,
func: Option<extern "C" fn(c_int)>,
) -> Option<extern "C" fn(c_int)> {
let sa = sigaction {
sa_handler: func,
sa_flags: SA_RESTART as c_ulong,
@@ -229,5 +232,5 @@ pub const _signal_strings: [&'static str; 32] = [
"Window changed\0",
"I/O possible\0",
"Power failure\0",
"Bad system call\0"
"Bad system call\0",
];
+4 -9
View File
@@ -9,10 +9,12 @@ use va_list::VaList as va_list;
use header::errno::{self, STR_ERROR};
use header::fcntl;
use header::stdlib::mkstemp;
use header::string::strlen;
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{c_str, errno, Read, Write};
use platform::{Pal, Sys};
mod printf;
mod scanf;
@@ -220,7 +222,7 @@ impl<'a> Read for LockGuard<'a> {
let mut buf = [0];
match self.0.read(&mut buf) {
0 => Ok(None),
_ => Ok(Some(buf[0]))
_ => Ok(Some(buf[0])),
}
}
}
@@ -452,9 +454,6 @@ pub extern "C" fn fputc(c: c_int, stream: &mut FILE) -> c_int {
/// Insert a string into a stream
#[no_mangle]
pub extern "C" fn fputs(s: *const c_char, stream: &mut FILE) -> c_int {
extern "C" {
fn strlen(s: *const c_char) -> size_t;
}
let len = unsafe { strlen(s) };
(fwrite(s as *const c_void, 1, len, stream) == len) as c_int - 1
}
@@ -886,10 +885,6 @@ pub extern "C" fn tempnam(_dir: *const c_char, _pfx: *const c_char) -> *mut c_ch
#[no_mangle]
pub extern "C" fn tmpfile() -> *mut FILE {
extern "C" {
fn mkstemp(name: *mut c_char) -> c_int;
}
let mut file_name = *b"/tmp/tmpfileXXXXXX";
let file_name = file_name.as_mut_ptr() as *mut c_char;
let fd = unsafe { mkstemp(file_name) };
+2 -2
View File
@@ -44,9 +44,9 @@ unsafe fn inner_scanf<R: Read>(
byte = b;
count += 1;
true
},
}
Ok(None) => false,
Err(()) => return Err(-1)
Err(()) => return Err(-1),
}
}};
}
+31 -9
View File
@@ -6,15 +6,15 @@ use rand::prng::XorShiftRng;
use rand::rngs::JitterRng;
use rand::{Rng, SeedableRng};
use header::{ctype, errno, unistd};
use header::errno::*;
use header::fcntl::*;
use header::string::*;
use header::time::constants::CLOCK_MONOTONIC;
use header::wchar::*;
use header::{ctype, errno, unistd};
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
mod sort;
@@ -507,7 +507,11 @@ pub unsafe extern "C" fn putenv(insert: *mut c_char) -> c_int {
platform::inner_environ[i] = insert;
} else {
let i = platform::inner_environ.len() - 1;
assert_eq!(platform::inner_environ[i], ptr::null_mut(), "environ did not end with null");
assert_eq!(
platform::inner_environ[i],
ptr::null_mut(),
"environ did not end with null"
);
platform::inner_environ[i] = insert;
platform::inner_environ.push(ptr::null_mut());
platform::environ = platform::inner_environ.as_mut_ptr();
@@ -571,7 +575,11 @@ pub extern "C" fn seed48(seed16v: [c_ushort; 3]) -> c_ushort {
}
#[no_mangle]
pub unsafe extern "C" fn setenv(mut key: *const c_char, mut value: *const c_char, overwrite: c_int) -> c_int {
pub unsafe extern "C" fn setenv(
mut key: *const c_char,
mut value: *const c_char,
overwrite: c_int,
) -> c_int {
let mut key_len = 0;
while *key.offset(key_len) != 0 {
key_len += 1;
@@ -602,7 +610,11 @@ pub unsafe extern "C" fn setenv(mut key: *const c_char, mut value: *const c_char
}
} else {
let i = platform::inner_environ.len() - 1;
assert_eq!(platform::inner_environ[i], ptr::null_mut(), "environ did not end with null");
assert_eq!(
platform::inner_environ[i],
ptr::null_mut(),
"environ did not end with null"
);
platform::inner_environ.push(ptr::null_mut());
platform::environ = platform::inner_environ.as_mut_ptr();
i
@@ -664,9 +676,15 @@ pub unsafe extern "C" fn strtod(mut s: *const c_char, endptr: *mut *mut c_char)
let mut radix = 10;
let negative = match *s as u8 {
b'-' => { s = s.offset(1); true },
b'+' => { s = s.offset(1); false },
_ => false
b'-' => {
s = s.offset(1);
true
}
b'+' => {
s = s.offset(1);
false
}
_ => false,
};
if *s as u8 == b'0' && *s.offset(1) as u8 == b'x' {
@@ -855,7 +873,11 @@ pub unsafe extern "C" fn strtoull(
}
#[no_mangle]
pub unsafe extern "C" fn strtoll(s: *const c_char, endptr: *mut *mut c_char, base: c_int) -> c_long {
pub unsafe extern "C" fn strtoll(
s: *const c_char,
endptr: *mut *mut c_char,
base: c_int,
) -> c_long {
strtol(s, endptr, base)
}
+6 -5
View File
@@ -4,8 +4,8 @@ use core::mem;
use core::ptr;
use core::usize;
use header::signal;
use header::errno::*;
use header::signal;
use platform;
use platform::types::*;
@@ -179,14 +179,15 @@ pub unsafe fn inner_strspn(s1: *const c_char, s2: *const c_char, cmp: bool) -> s
let mut i = 0;
while *s2.offset(i) != 0 {
byteset[(*s2.offset(i) as usize) / BITSIZE] |=
1 << (*s2.offset(i) as usize & (BITSIZE-1));
1 << (*s2.offset(i) as usize & (BITSIZE - 1));
i += 1;
}
i = 0; // reset
while *s1.offset(i) != 0 &&
(byteset[(*s1.offset(i) as usize) / BITSIZE] &
1 << (*s1.offset(i) as usize & (BITSIZE-1)) != 0) == cmp {
while *s1.offset(i) != 0
&& (byteset[(*s1.offset(i) as usize) / BITSIZE]
& 1 << (*s1.offset(i) as usize & (BITSIZE - 1)) != 0) == cmp
{
i += 1;
}
i as size_t
+1 -1
View File
@@ -1,7 +1,7 @@
//! sys/file.h implementation
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub const LOCK_SH: usize = 1;
pub const LOCK_EX: usize = 2;
+2 -2
View File
@@ -1,6 +1,5 @@
//! ioctl implementation for linux
use platform::{Pal, Sys};
use platform::types::*;
// This is used from sgtty
@@ -15,7 +14,8 @@ pub struct sgttyb {
#[cfg(target_os = "linux")]
pub mod inner {
use super::*;
use platform::types::*;
use platform::{Pal, Sys};
#[repr(C)]
pub struct winsize {
+1 -1
View File
@@ -1,5 +1,5 @@
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub use self::sys::*;
+1 -1
View File
@@ -3,8 +3,8 @@
use header::sys_time::timeval;
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
// Exported in bits file
const RUSAGE_SELF: c_int = 0;
+1 -1
View File
@@ -1,7 +1,7 @@
//! sys/select.h implementation
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
// fd_set is defined in C because cbindgen is incompatible with mem::size_of booo
+1 -1
View File
@@ -3,8 +3,8 @@
use core::ptr;
use platform;
use platform::{PalSocket, Sys};
use platform::types::*;
use platform::{PalSocket, Sys};
mod constants;
+2 -2
View File
@@ -1,9 +1,9 @@
//! stat implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysstat.h.html
use header::fcntl::{O_PATH, O_NOFOLLOW};
use header::fcntl::{O_NOFOLLOW, O_PATH};
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub const S_IFMT: c_int = 0o0170000;
+1 -1
View File
@@ -1,8 +1,8 @@
//! sys/time implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/systime.h.html
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub const ITIMER_REAL: c_int = 0;
pub const ITIMER_VIRTUAL: c_int = 1;
+1 -1
View File
@@ -1,8 +1,8 @@
//! sys/times.h implementation
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
#[repr(C)]
pub struct tms {
+1 -1
View File
@@ -3,8 +3,8 @@
#[cfg(target_os = "linux")]
mod inner {
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
const UTSLENGTH: usize = 65;
+1 -1
View File
@@ -2,8 +2,8 @@
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/syswait.h.html
use header::sys_resource::rusage;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub const WNOHANG: c_int = 1;
pub const WUNTRACED: c_int = 2;
+2 -2
View File
@@ -1,8 +1,8 @@
//! termios implementation, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub type cc_t = u8;
pub type speed_t = u32;
@@ -19,7 +19,7 @@ pub struct termios {
c_line: cc_t,
c_cc: [cc_t; NCCS],
__c_ispeed: speed_t,
__c_ospeed: speed_t
__c_ospeed: speed_t,
}
#[no_mangle]
+1 -1
View File
@@ -4,8 +4,8 @@ use core::mem::transmute;
use header::errno::EIO;
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
use self::constants::*;
use self::helpers::*;
+3 -7
View File
@@ -1,15 +1,11 @@
use alloc::string::String;
use platform::{self, Write};
use platform::types::*;
use platform::{self, Write};
use super::tm;
pub unsafe fn strftime<W: Write>(
w: &mut W,
format: *const c_char,
t: *const tm,
) -> size_t {
pub unsafe fn strftime<W: Write>(w: &mut W, format: *const c_char, t: *const tm) -> size_t {
pub unsafe fn inner_strftime<W: Write>(
mut w: &mut W,
mut format: *const c_char,
@@ -73,7 +69,7 @@ pub unsafe fn strftime<W: Write>(
while *format != 0 {
if *format as u8 != b'%' {
w!(byte *format as u8);
w!(byte * format as u8);
format = format.offset(1);
continue;
}
+1 -1
View File
@@ -2,8 +2,8 @@ use core::ptr;
use header::errno::ENOMEM;
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
static mut BRK: *mut c_void = ptr::null_mut();
+5 -2
View File
@@ -4,8 +4,8 @@ use core::{ptr, slice};
use header::sys_time;
use platform;
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
pub use self::brk::*;
pub use self::getopt::*;
@@ -195,7 +195,10 @@ pub extern "C" fn getcwd(mut buf: *mut c_char, mut size: size_t) -> *mut c_char
}
if alloc {
let mut len = stack_buf.iter().position(|b| *b == 0).expect("no nul-byte in getcwd string") + 1;
let mut len = stack_buf
.iter()
.position(|b| *b == 0)
.expect("no nul-byte in getcwd string") + 1;
let mut heap_buf = unsafe { platform::alloc(len) as *mut c_char };
for i in 0..len {
unsafe {
+1 -1
View File
@@ -1,7 +1,7 @@
//! utime implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/utime.h.html
use platform::{Pal, Sys};
use platform::types::*;
use platform::{Pal, Sys};
#[repr(C)]
#[derive(Clone)]