From 2cb8a4395d259a5e6328b4f76e19673b651569c7 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 19 Sep 2021 15:36:16 +0100 Subject: BSD add utrace calls --- libc-test/build.rs | 6 ++++++ libc-test/semver/dragonfly.txt | 1 + libc-test/semver/freebsd.txt | 1 + libc-test/semver/netbsd.txt | 1 + libc-test/semver/openbsd.txt | 1 + src/unix/bsd/freebsdlike/mod.rs | 1 + src/unix/bsd/netbsdlike/netbsd/mod.rs | 1 + src/unix/bsd/netbsdlike/openbsd/mod.rs | 1 + 8 files changed, 13 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index f568affc7d..afef1af570 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -428,10 +428,13 @@ fn test_openbsd(target: &str) { "sys/file.h", "sys/ioctl.h", "sys/mman.h", + "sys/param.h", "sys/resource.h", "sys/shm.h", "sys/socket.h", "sys/time.h", + "sys/uio.h", + "sys/ktrace.h", "sys/un.h", "sys/wait.h", "unistd.h", @@ -969,6 +972,7 @@ fn test_netbsd(target: &str) { "sys/file.h", "sys/ioctl.h", "sys/ioctl_compat.h", + "sys/ktrace.h", "sys/mman.h", "sys/mount.h", "sys/ptrace.h", @@ -1185,6 +1189,7 @@ fn test_dragonflybsd(target: &str) { "sys/file.h", "sys/ioctl.h", "sys/ipc.h", + "sys/ktrace.h", "sys/mman.h", "sys/mount.h", "sys/ptrace.h", @@ -1815,6 +1820,7 @@ fn test_freebsd(target: &str) { "sys/types.h", "sys/ucontext.h", "sys/uio.h", + "sys/ktrace.h", "sys/un.h", "sys/user.h", "sys/utsname.h", diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 903f3f981e..c6dc07cd39 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -1462,6 +1462,7 @@ uselocale utimensat utmpx utmpxname +utrace uuid uuid_t vm_size_t diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 99aa6dd80a..7cab6f1739 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1756,6 +1756,7 @@ useconds_t uselocale utimensat utmpx +utrace vm_size_t wait4 waitid diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index a2b44a5d33..17f2953242 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -1392,6 +1392,7 @@ utmp utmpx utmpxname utpname +utrace vm_size_t wait4 waitid diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 228c617fa8..6a736ab964 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -1119,5 +1119,6 @@ useconds_t uselocale utimensat utmp +utrace wait4 xucred diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 05648c9a9b..72ac633cb9 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1567,6 +1567,7 @@ extern "C" { pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int; pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int; + pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int; pub fn pututxline(ut: *const utmpx) -> *mut utmpx; pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index e38f224186..18d6137041 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2147,6 +2147,7 @@ extern "C" { ) -> ::c_int; pub fn mq_unlink(name: *const ::c_char) -> ::c_int; pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int; + pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int; pub fn pthread_setname_np( t: ::pthread_t, name: *const ::c_char, diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 4812db6f5c..0b28514e60 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1561,6 +1561,7 @@ extern "C" { pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: caddr_t, data: ::c_int) -> ::c_int; + pub fn utrace(label: *const ::c_char, addr: *const ::c_void, len: ::size_t) -> ::c_int; pub fn memmem( haystack: *const ::c_void, haystacklen: ::size_t, -- cgit v1.2.1