summaryrefslogtreecommitdiff
path: root/src/unistd.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2016-07-25 02:41:24 +0000
committerPhilipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de>2016-08-10 21:12:53 +0200
commitbae5a373391eced579c7574fda942b9db4a55c3f (patch)
tree893458cbcf2759ef43f805618def664dc0120cd3 /src/unistd.rs
parentcdecd1a9cc37263a27a86957fa9159c3597c83ca (diff)
downloadnix-bae5a373391eced579c7574fda942b9db4a55c3f.zip
Fix the sethostname binding on FreeBSD and DragonflyBSD
Diffstat (limited to 'src/unistd.rs')
-rw-r--r--src/unistd.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/unistd.rs b/src/unistd.rs
index 6ab1d920..d4da60da 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -176,7 +176,10 @@ pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> {
pub fn sethostname(name: &[u8]) -> Result<()> {
// Handle some differences in type of the len arg across platforms.
cfg_if! {
- if #[cfg(any(target_os = "macos", target_os = "ios"))] {
+ if #[cfg(any(target_os = "dragonfly",
+ target_os = "freebsd",
+ target_os = "ios",
+ target_os = "macos", ))] {
type sethostname_len_t = c_int;
} else {
type sethostname_len_t = size_t;