Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated pull from rust-lang/libc #81

Merged
merged 5 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions ferrocene/library/libc/libc-test/semver/redox.txt
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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