Skip to content

Commit 3f52f57

Browse files
committed
bsd reallocarray and reallocarr for netbsd.
1 parent 4fcfa55 commit 3f52f57

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

libc-test/semver/freebsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,7 @@ readdir_r
15841584
readlinkat
15851585
realhostname
15861586
realhostname_sa
1587+
reallocarray
15871588
recvmmsg
15881589
recvmsg
15891590
regcomp

libc-test/semver/netbsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,8 @@ qsort
12211221
rand
12221222
readdir_r
12231223
readlinkat
1224+
reallocarr
1225+
reallocarray
12241226
recvmmsg
12251227
recvmsg
12261228
regcomp

libc-test/semver/openbsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,7 @@ qsort
10221022
rand
10231023
readdir_r
10241024
readlinkat
1025+
reallocarray
10251026
recvmsg
10261027
regcomp
10271028
regerror

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,8 @@ extern "C" {
16921692
pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
16931693
-> *mut cap_rights_t;
16941694
pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
1695+
1696+
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
16951697
}
16961698

16971699
#[link(name = "util")]

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,10 @@ extern "C" {
736736
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
737737
}
738738

739+
extern "C" {
740+
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
741+
}
742+
739743
cfg_if! {
740744
if #[cfg(target_os = "netbsd")] {
741745
mod netbsd;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,8 @@ extern "C" {
18721872
rqtp: *const ::timespec,
18731873
rmtp: *mut ::timespec,
18741874
) -> ::c_int;
1875+
1876+
pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
18751877
}
18761878

18771879
#[link(name = "rt")]

0 commit comments

Comments
 (0)