Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2300.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `F_OFD_SETLK`, `F_OFD_SETLKW`, and `F_OFD_GETLK` fcntl commands on macOS
12 changes: 6 additions & 6 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,15 +751,15 @@ pub enum FcntlArg<'a> {
/// Get the first lock that blocks the lock description
F_GETLK(&'a mut libc::flock),
/// Acquire or release an open file description lock
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_SETLK(&'a libc::flock),
/// Like [`F_OFD_SETLK`] except that if a conflicting lock is held on
/// the file, then wait for that lock to be released.
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_SETLKW(&'a libc::flock),
/// Determine whether it would be possible to create the given lock. If not, return details
/// about one existing lock that would prevent it.
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_GETLK(&'a mut libc::flock),
/// Add seals to the file
#[cfg(any(
Expand Down Expand Up @@ -879,11 +879,11 @@ pub fn fcntl<Fd: std::os::fd::AsFd>(fd: Fd, arg: FcntlArg) -> Result<c_int> {
F_SETLKW(flock) => libc::fcntl(fd, libc::F_SETLKW, flock),
#[cfg(not(target_os = "redox"))]
F_GETLK(flock) => libc::fcntl(fd, libc::F_GETLK, flock),
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock),
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock),
#[cfg(linux_android)]
#[cfg(any(linux_android, macos))]
F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock),
#[cfg(any(
linux_android,
Expand Down
1 change: 0 additions & 1 deletion src/sys/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::errno::Errno;
use crate::sys::time::{TimeSpec, TimeVal};
use crate::Result;
use libc::{self, c_int};
use std::convert::TryFrom;
use std::iter::FusedIterator;
use std::mem;
use std::ops::Range;
Expand Down
4 changes: 2 additions & 2 deletions test/test_sendfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ fn test_sendfile_dragonfly() {
fn test_sendfile_darwin() {
// Declare the content
let header_strings =
vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"];
["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"];
let body = "Xabcdef123456";
let body_offset = 1;
let trailer_strings = vec!["\n", "Served by Make Believe\n"];
let trailer_strings = ["\n", "Served by Make Believe\n"];

// Write the body to a file
let mut tmp = tempfile().unwrap();
Expand Down