Skip to content

Commit fce5767

Browse files
committed
Expose some more C types
1 parent cfeed11 commit fce5767

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
extern crate libc;
77

8+
// Re-export some libc constants
9+
pub use libc::{c_int, c_void};
10+
811
pub use errno::{SysResult, SysError};
912

1013
#[cfg(target_os = "linux")]

src/sys/socket.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ pub fn connect(sockfd: Fd, addr: &SockAddr) -> SysResult<()> {
288288
from_ffi(res)
289289
}
290290

291+
#[repr(C)]
292+
pub struct linger {
293+
pub l_onoff: c_int,
294+
pub l_linger: c_int
295+
}
296+
291297
pub fn getsockopt<T>(fd: Fd, level: SockLevel, opt: SockOpt, val: &mut T) -> SysResult<uint> {
292298
let mut len = mem::size_of::<T>() as socklen_t;
293299

0 commit comments

Comments
 (0)