Skip to content

Commit 94a0ccd

Browse files
authored
Merge pull request #3936 from sunshowers/illumos-rsync
[solarish/freebsd] add a few missing constants and functions
2 parents 113efbf + 52e81a8 commit 94a0ccd

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

libc-test/semver/freebsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ PL_FLAG_SI
10271027
PM_STR
10281028
POLLINIGNEOF
10291029
POLLRDBAND
1030+
POLLRDHUP
10301031
POLLRDNORM
10311032
POLLSTANDARD
10321033
POLLWRBAND

libc-test/semver/illumos.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
O_RSYNC
2+
POLLRDHUP
3+
POSIX_FADV_DONTNEED
4+
POSIX_FADV_NOREUSE
5+
POSIX_FADV_NORMAL
6+
POSIX_FADV_RANDOM
7+
POSIX_FADV_SEQUENTIAL
8+
POSIX_FADV_WILLNEED
9+
posix_fadvise
10+
posix_fallocate
111
pthread_attr_get_np
212
pthread_attr_getstackaddr
313
pthread_attr_setstack

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,6 +2851,7 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
28512851
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
28522852

28532853
pub const POLLINIGNEOF: ::c_short = 0x2000;
2854+
pub const POLLRDHUP: ::c_short = 0x4000;
28542855

28552856
pub const EVFILT_READ: i16 = -1;
28562857
pub const EVFILT_WRITE: i16 = -2;

src/unix/solarish/illumos.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ pub const EFD_SEMAPHORE: ::c_int = 0x1;
2828
pub const EFD_NONBLOCK: ::c_int = 0x800;
2929
pub const EFD_CLOEXEC: ::c_int = 0x80000;
3030

31+
pub const POLLRDHUP: ::c_short = 0x4000;
32+
3133
pub const TCP_KEEPIDLE: ::c_int = 34;
3234
pub const TCP_KEEPCNT: ::c_int = 35;
3335
pub const TCP_KEEPINTVL: ::c_int = 36;
@@ -56,6 +58,13 @@ pub const SOL_FILTER: ::c_int = 0xfffc;
5658

5759
pub const MADV_PURGE: ::c_int = 9;
5860

61+
pub const POSIX_FADV_NORMAL: ::c_int = 0;
62+
pub const POSIX_FADV_RANDOM: ::c_int = 1;
63+
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
64+
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
65+
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
66+
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
67+
5968
pub const B1000000: ::speed_t = 24;
6069
pub const B1152000: ::speed_t = 25;
6170
pub const B1500000: ::speed_t = 26;
@@ -96,6 +105,7 @@ extern "C" {
96105
stackaddr: *mut ::c_void,
97106
) -> ::c_int;
98107

108+
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int;
99109
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
100110
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
101111
-> ::ssize_t;

src/unix/solarish/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ pub const O_RDWR: ::c_int = 2;
12931293
pub const O_NDELAY: ::c_int = 0x04;
12941294
pub const O_APPEND: ::c_int = 8;
12951295
pub const O_DSYNC: ::c_int = 0x40;
1296+
pub const O_RSYNC: ::c_int = 0x8000;
12961297
pub const O_CREAT: ::c_int = 256;
12971298
pub const O_EXCL: ::c_int = 1024;
12981299
pub const O_NOCTTY: ::c_int = 2048;
@@ -2832,6 +2833,7 @@ extern "C" {
28322833
#[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")]
28332834
pub fn globfree(pglob: *mut ::glob_t);
28342835

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

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

0 commit comments

Comments
 (0)