Skip to content

Commit c0fab38

Browse files
committed
NetBSD: correct link_name of some time-related functions
The futimes(), lutimes(), mq_timedreceive(), and mq_timedsend() functions were linking against legacy library symbols that need 32-bit time_t in structures, resulting in an ABI mismatch with 64-bit time_t.
1 parent 2c063c2 commit c0fab38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/unix/bsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ extern {
444444
flags: ::c_int, addr: *mut ::sockaddr,
445445
addrlen: *mut ::socklen_t) -> ::ssize_t;
446446
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
447+
#[cfg_attr(target_os = "netbsd", link_name = "__futimes50")]
447448
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
448449
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
449450

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ extern {
10041004
pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
10051005
nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
10061006

1007+
#[link_name = "__lutimes50"]
10071008
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
10081009
pub fn getnameinfo(sa: *const ::sockaddr,
10091010
salen: ::socklen_t,
@@ -1055,11 +1056,13 @@ extern {
10551056
pub fn mq_setattr(mqd: ::mqd_t,
10561057
newattr: *const ::mq_attr,
10571058
oldattr: *mut ::mq_attr) -> ::c_int;
1059+
#[link_name = "__mq_timedreceive50"]
10581060
pub fn mq_timedreceive(mqd: ::mqd_t,
10591061
msg_ptr: *mut ::c_char,
10601062
msg_len: ::size_t,
10611063
msq_prio: *mut ::c_uint,
10621064
abs_timeout: *const ::timespec) -> ::ssize_t;
1065+
#[link_name = "__mq_timedsend50"]
10631066
pub fn mq_timedsend(mqd: ::mqd_t,
10641067
msg_ptr: *const ::c_char,
10651068
msg_len: ::size_t,

0 commit comments

Comments
 (0)