Lines Matching defs:close
466 let _ = close(fd);
1040 /// Be aware that many Rust types implicitly close-on-drop, including
1042 /// a double-close condition, which can cause confusing `EBADF` errors in
1044 /// [close(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html).
1050 /// use nix::unistd::close;
1053 /// close(f.as_raw_fd()).unwrap(); // Bad! f will also close on drop!
1058 /// use nix::unistd::close;
1061 /// close(f.into_raw_fd()).unwrap(); // Good. into_raw_fd consumes f
1063 pub fn close(fd: RawFd) -> Result<()> {
1064 let res = unsafe { libc::close(fd) };
1165 /// - `O_CLOEXEC`: Set the close-on-exec flag for the new file descriptors.