summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs2
-rw-r--r--src/unix/bsd/apple/mod.rs9
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs8
-rw-r--r--src/unix/bsd/openbsdlike/mod.rs10
-rw-r--r--src/unix/mod.rs2
-rw-r--r--src/unix/notbsd/android/mod.rs8
-rw-r--r--src/unix/notbsd/linux/mod.rs8
7 files changed, 45 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 797c5394f9..5df3b5b38f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -101,8 +101,6 @@ pub type ssize_t = isize;
pub enum FILE {}
pub enum fpos_t {}
-pub enum DIR {}
-pub enum dirent {}
extern {
pub fn isalnum(c: c_int) -> c_int;
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,