Skip to content

Commit

Permalink
Enable copy_file_range on FreeBSD
Browse files Browse the repository at this point in the history
PR #2479 did this, but only in the freebsd13 and freebsd14 modules,
which was incorrect.  Those modules should only be used for functions
that change across FreeBSD versions, and therefore need different ELF
symbol versions.  Functions that were newly added since FreeBSD 11 can
still go in the base freebsd module.  It will cause no problems for them
to be there, and users will see an error at link time if they try to
use such a function in an environment that is too old to support it.
  • Loading branch information
asomers committed Nov 30, 2022
1 parent e4b8fd4 commit e5fd29b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -1517,6 +1517,7 @@ clearerr
clock_getcpuclockid
clock_getres
clock_settime
copy_file_range
cmsgcred
cmsghdr
cpuset
Expand Down
9 changes: 0 additions & 9 deletions src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
Expand Up @@ -527,15 +527,6 @@ extern "C" {
policy: ::c_int,
) -> ::c_int;

pub fn copy_file_range(
infd: ::c_int,
inoffp: *mut ::off_t,
outfd: ::c_int,
outoffp: *mut ::off_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;

pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
Expand Down
9 changes: 0 additions & 9 deletions src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
Expand Up @@ -527,15 +527,6 @@ extern "C" {
policy: ::c_int,
) -> ::c_int;

pub fn copy_file_range(
infd: ::c_int,
inoffp: *mut ::off_t,
outfd: ::c_int,
outoffp: *mut ::off_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;

pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
Expand Down
9 changes: 9 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -3954,6 +3954,15 @@ extern "C" {
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int;

pub fn copy_file_range(
infd: ::c_int,
inoffp: *mut ::off_t,
outfd: ::c_int,
outoffp: *mut ::off_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;

pub fn devname_r(
dev: ::dev_t,
mode: ::mode_t,
Expand Down

0 comments on commit e5fd29b

Please sign in to comment.