diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-10-29 22:59:44 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-10-30 14:26:03 -0700 |
commit | d6e07e27340741d319e313e72341ca2aa9a9843b (patch) | |
tree | 9a7eec3cc6dd71898cae785222ab3780746699aa /src/unix | |
parent | 1effc23b90d9c3994fc88d46fef3938ee33f0cce (diff) | |
download | rust-libc-d6e07e27340741d319e313e72341ca2aa9a9843b.tar.gz |
Define dirent_t on all platforms
Diffstat (limited to 'src/unix')
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 9 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/mod.rs | 8 | ||||
-rw-r--r-- | src/unix/bsd/openbsdlike/mod.rs | 10 | ||||
-rw-r--r-- | src/unix/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/notbsd/android/mod.rs | 8 | ||||
-rw-r--r-- | src/unix/notbsd/linux/mod.rs | 8 |
6 files changed, 45 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 7aefcab271..e50eb49ade 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -83,11 +83,20 @@ s! { pub st_qspare: [::int64_t; 2], } + pub struct dirent { + pub d_ino: u64, + pub d_seekoff: u64, + pub d_reclen: u16, + pub d_namlen: u16, + pub d_type: u8, + pub d_name: [::c_char; 1024], + } pub struct pthread_mutex_t { __sig: ::c_long, __opaque: [u8; __PTHREAD_MUTEX_SIZE__], } + pub struct pthread_mutexattr_t { __sig: ::c_long, __opaque: [u8; 8], diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 043eb64afa..d4342eae3c 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -16,6 +16,14 @@ pub type pthread_key_t = ::c_int; pub enum timezone {} s! { + pub struct dirent { + pub d_fileno: u32, + pub d_reclen: u16, + pub d_type: u8, + pub d_namelen: u8, + pub d_name: [::c_char; 256], + } + pub struct glob_t { pub gl_pathc: ::size_t, __unused1: ::size_t, diff --git a/src/unix/bsd/openbsdlike/mod.rs b/src/unix/bsd/openbsdlike/mod.rs index ecd1579e0c..d78c4171fa 100644 --- a/src/unix/bsd/openbsdlike/mod.rs +++ b/src/unix/bsd/openbsdlike/mod.rs @@ -22,6 +22,16 @@ pub type rlim_t = u64; pub enum timezone {} s! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + pub d_namelen: u8, + __d_padding: [u8; 4], + pub d_name: [::c_char; 256], + } + pub struct siginfo_t { pub si_signo: ::c_int, pub si_code: ::c_int, diff --git a/src/unix/mod.rs b/src/unix/mod.rs index c78058674d..cb45123f9e 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -10,6 +10,8 @@ pub type in_addr_t = u32; pub type in_port_t = u16; pub type sighandler_t = ::size_t; +pub enum DIR {} + s! { pub struct utimbuf { pub actime: time_t, diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index e26bceac30..6187f31585 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -43,6 +43,14 @@ s! { pub st_ino: ::c_ulonglong, } + pub struct dirent { + pub d_ino: u64, + pub d_off: i64, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + pub struct pthread_attr_t { pub flags: ::uint32_t, pub stack_base: *mut ::c_void, diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index 6606b41c9c..67d7d7c833 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -7,6 +7,14 @@ pub type pthread_t = c_ulong; pub type mode_t = u32; s! { + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + pub struct glob_t { pub gl_pathc: ::size_t, pub gl_pathv: *mut *mut c_char, |