Skip to content

Commit 80a7d2e

Browse files
authored
Merge pull request #3771 from jgarzik/confstr-pr
Add POSIX confstr API
2 parents ce2ccd5 + 31beed6 commit 80a7d2e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libc-test/semver/linux-gnu.txt

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ XSK_UNALIGNED_BUF_ADDR_MASK
511511
XDP_PKT_CONTD
512512
XENFS_SUPER_MAGIC
513513
XFS_SUPER_MAGIC
514+
_CS_GNU_LIBC_VERSION
515+
_CS_GNU_LIBPTHREAD_VERSION
516+
_CS_PATH
514517
_SC_2_C_VERSION
515518
_SC_BASE
516519
_SC_CHARCLASS_NAME_MAX
@@ -611,6 +614,7 @@ aio_write
611614
aiocb
612615
backtrace
613616
clock_adjtime
617+
confstr
614618
copy_file_range
615619
ctermid
616620
dlinfo

src/unix/linux_like/linux/gnu/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,9 @@ pub const TMP_MAX: ::c_uint = 238328;
826826
pub const FOPEN_MAX: ::c_uint = 16;
827827
pub const FILENAME_MAX: ::c_uint = 4096;
828828
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
829+
pub const _CS_GNU_LIBC_VERSION: ::c_int = 2;
830+
pub const _CS_GNU_LIBPTHREAD_VERSION: ::c_int = 3;
831+
pub const _CS_PATH: ::c_int = 0;
829832
pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
830833
pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
831834
pub const _SC_PII: ::c_int = 53;
@@ -1485,6 +1488,7 @@ extern "C" {
14851488
) -> ::size_t;
14861489
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
14871490

1491+
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
14881492
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
14891493
/// POSIX version of `basename(3)`, defined in `libgen.h`.
14901494
#[link_name = "__xpg_basename"]

0 commit comments

Comments
 (0)