Skip to content

Commit

Permalink
Merge #81
Browse files Browse the repository at this point in the history
81: Automated pull from `rust-lang/libc` r=tshepang a=github-actions[bot]

This PR pulls the following changes from the [`rust-lang/libc`](https://github.com/rust-lang/libc) repository:

* rust-lang/libc#3421
* rust-lang/libc#3400


Co-authored-by: David Carlier <devnexen@gmail.com>
Co-authored-by: Ian Douglas Scott <ian@iandouglasscott.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
5 people committed Nov 3, 2023
2 parents a76df3b + 3e9edc3 commit 2650a98
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ferrocene/library/libc/libc-test/semver/redox.txt
Expand Up @@ -180,6 +180,7 @@ bsearch
chroot
clearerr
difftime
endgrent
endpwent
endservent
epoll_create
Expand All @@ -191,7 +192,10 @@ explicit_bzero
fchdir
fmemopen
getdtablesize
getgrent
getgrgid
getgrgid_r
getgrnam
getgrnam_r
getgrouplist
getline
Expand All @@ -212,6 +216,7 @@ pipe2
pthread_condattr_setclock
qsort
reallocarray
setgrent
setpwent
setrlimit
setservent
Expand Down
33 changes: 33 additions & 0 deletions ferrocene/library/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -60,6 +60,39 @@ impl siginfo_t {
self.si_addr
}

pub unsafe fn si_code(&self) -> ::c_int {
self.si_code
}

pub unsafe fn si_errno(&self) -> ::c_int {
self.si_errno
}

pub unsafe fn si_pid(&self) -> ::pid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
}

pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
_uid: ::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
}

pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
Expand Down
39 changes: 38 additions & 1 deletion ferrocene/library/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -548,12 +548,46 @@ impl siginfo_t {
self.si_addr
}

pub unsafe fn si_value(&self) -> ::sigval {
pub unsafe fn si_code(&self) -> ::c_int {
self.si_code
}

pub unsafe fn si_errno(&self) -> ::c_int {
self.si_errno
}

pub unsafe fn si_pid(&self) -> ::pid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
}

pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
}

pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
value: ::sigval,
Expand Down Expand Up @@ -1652,6 +1686,9 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;

pub const TMPFS_ARGS_VERSION: ::c_int = 1;

const SI_MAXSZ: ::size_t = 128;
const SI_PAD: ::size_t = (SI_MAXSZ / ::mem::size_of::<::c_int>()) - 3;

pub const MAP_STACK: ::c_int = 0x4000;
pub const MAP_CONCEAL: ::c_int = 0x8000;

Expand Down
5 changes: 5 additions & 0 deletions ferrocene/library/libc/src/unix/redox/mod.rs
Expand Up @@ -1080,13 +1080,18 @@ extern "C" {
pub fn getdtablesize() -> ::c_int;

// grp.h
pub fn getgrent() -> *mut ::group;
pub fn setgrent();
pub fn endgrent();
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
Expand Down

0 comments on commit 2650a98

Please sign in to comment.