Skip to content

Commit

Permalink
Auto merge of #2988 - SteveLauC:XATTR-constants-on-NetBSD, r=JohnTitor
Browse files Browse the repository at this point in the history
add extended attributes constants on NetBSD

Add three EA-related constants on NetBSD:
1. [XATTR_CREATE](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/xattr.h#L54)
2. [XATTR_REPLACE](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/xattr.h#L55)
3. [EXTATTR_NAMESPACE_EMPTY](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/extattr.h#L44)

And include `sys/xattr.h` in the test.
  • Loading branch information
bors committed Nov 3, 2022
2 parents 1ca1c41 + 1422cee commit d99e55f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions libc-test/build.rs
Expand Up @@ -1038,6 +1038,7 @@ fn test_netbsd(target: &str) {
"string.h",
"sys/endian.h",
"sys/exec_elf.h",
"sys/xattr.h",
"sys/extattr.h",
"sys/file.h",
"sys/ioctl.h",
Expand Down
5 changes: 4 additions & 1 deletion libc-test/semver/netbsd.txt
Expand Up @@ -1534,4 +1534,7 @@ vm_size_t
wait4
waitid
dirname
basename
basename
XATTR_CREATE
XATTR_REPLACE
EXTATTR_NAMESPACE_EMPTY
6 changes: 6 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -2315,6 +2315,12 @@ pub const _REG_RFLAGS: ::c_int = 23;
pub const _REG_RSP: ::c_int = 24;
pub const _REG_SS: ::c_int = 25;

// sys/xattr.h
pub const XATTR_CREATE: ::c_int = 0x01;
pub const XATTR_REPLACE: ::c_int = 0x02;
// sys/extattr.h
pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;

const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
Expand Down

0 comments on commit d99e55f

Please sign in to comment.