Skip to content

Commit

Permalink
Merge pull request #3936 from sunshowers/illumos-rsync
Browse files Browse the repository at this point in the history
[solarish/freebsd] add a few missing constants and functions
  • Loading branch information
tgross35 authored Oct 15, 2024
2 parents 113efbf + 52e81a8 commit 94a0ccd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ PL_FLAG_SI
PM_STR
POLLINIGNEOF
POLLRDBAND
POLLRDHUP
POLLRDNORM
POLLSTANDARD
POLLWRBAND
Expand Down
10 changes: 10 additions & 0 deletions libc-test/semver/illumos.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
O_RSYNC
POLLRDHUP
POSIX_FADV_DONTNEED
POSIX_FADV_NOREUSE
POSIX_FADV_NORMAL
POSIX_FADV_RANDOM
POSIX_FADV_SEQUENTIAL
POSIX_FADV_WILLNEED
posix_fadvise
posix_fallocate
pthread_attr_get_np
pthread_attr_getstackaddr
pthread_attr_setstack
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,7 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;

pub const POLLINIGNEOF: ::c_short = 0x2000;
pub const POLLRDHUP: ::c_short = 0x4000;

pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
Expand Down
10 changes: 10 additions & 0 deletions src/unix/solarish/illumos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub const EFD_SEMAPHORE: ::c_int = 0x1;
pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const EFD_CLOEXEC: ::c_int = 0x80000;

pub const POLLRDHUP: ::c_short = 0x4000;

pub const TCP_KEEPIDLE: ::c_int = 34;
pub const TCP_KEEPCNT: ::c_int = 35;
pub const TCP_KEEPINTVL: ::c_int = 36;
Expand Down Expand Up @@ -56,6 +58,13 @@ pub const SOL_FILTER: ::c_int = 0xfffc;

pub const MADV_PURGE: ::c_int = 9;

pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;

pub const B1000000: ::speed_t = 24;
pub const B1152000: ::speed_t = 25;
pub const B1500000: ::speed_t = 26;
Expand Down Expand Up @@ -96,6 +105,7 @@ extern "C" {
stackaddr: *mut ::c_void,
) -> ::c_int;

pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ pub const O_RDWR: ::c_int = 2;
pub const O_NDELAY: ::c_int = 0x04;
pub const O_APPEND: ::c_int = 8;
pub const O_DSYNC: ::c_int = 0x40;
pub const O_RSYNC: ::c_int = 0x8000;
pub const O_CREAT: ::c_int = 256;
pub const O_EXCL: ::c_int = 1024;
pub const O_NOCTTY: ::c_int = 2048;
Expand Down Expand Up @@ -2832,6 +2833,7 @@ extern "C" {
#[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")]
pub fn globfree(pglob: *mut ::glob_t);

pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;

pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
Expand Down

0 comments on commit 94a0ccd

Please sign in to comment.