Skip to content

Commit 5e7cda0

Browse files
committed
Auto merge of #2489 - rtzoeller:dfly_devname_r, r=JohnTitor
DragonFly's devname_r takes a size_t len parameter #2435 introduced this function on DragonFly BSD with FreeBSD's signature, which is incorrect. Deprecate it, to be fixed in a subsequent release. https://github.com/DragonFlyBSD/DragonFlyBSD/blob/c163a4d7ee9c6857ee4e04a3a2cbb50c3de29da1/include/stdlib.h#L285
2 parents daea213 + 1501cad commit 5e7cda0

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,14 @@ extern "C" {
13701370

13711371
pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int;
13721372

1373+
#[deprecated(since = "0.2.107", note = "len should be of type size_t")]
1374+
pub fn devname_r(
1375+
dev: ::dev_t,
1376+
mode: ::mode_t,
1377+
buf: *mut ::c_char,
1378+
len: ::c_int,
1379+
) -> *mut ::c_char;
1380+
13731381
pub fn waitid(
13741382
idtype: idtype_t,
13751383
id: ::id_t,

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

+7
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,13 @@ extern "C" {
20382038
) -> ::c_int;
20392039
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
20402040

2041+
pub fn devname_r(
2042+
dev: ::dev_t,
2043+
mode: ::mode_t,
2044+
buf: *mut ::c_char,
2045+
len: ::c_int,
2046+
) -> *mut ::c_char;
2047+
20412048
pub fn extattr_delete_fd(
20422049
fd: ::c_int,
20432050
attrnamespace: ::c_int,

src/unix/bsd/freebsdlike/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1416,12 +1416,6 @@ extern "C" {
14161416
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
14171417

14181418
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
1419-
pub fn devname_r(
1420-
dev: ::dev_t,
1421-
mode: ::mode_t,
1422-
buf: *mut ::c_char,
1423-
len: ::c_int,
1424-
) -> *mut ::c_char;
14251419
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
14261420
pub fn accept4(
14271421
s: ::c_int,

0 commit comments

Comments
 (0)