Skip to content

Commit 8edb82d

Browse files
committed
Auto merge of #3099 - devnexen:pidfile_fbsd, r=JohnTitor
pidfile util api for freebsd addition.
2 parents 38b9a40 + 48fae9e commit 8edb82d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,7 @@ fn test_freebsd(target: &str) {
22902290
// Those are private types
22912291
"memory_type" => true,
22922292
"memory_type_list" => true,
2293+
"pidfh" => true,
22932294

22942295
_ => false,
22952296
}

libc-test/semver/freebsd.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,12 @@ pause
17561756
pdfork
17571757
pdgetpid
17581758
pdkill
1759+
pidfh
1760+
pidfile_close
1761+
pidfile_fileno
1762+
pidfile_open
1763+
pidfile_remove
1764+
pidfile_write
17591765
pipe2
17601766
popen
17611767
posix_fadvise

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,11 @@ s! {
10141014
pub struct memory_type_list {
10151015
__priv: [::uintptr_t; 2],
10161016
}
1017+
1018+
pub struct pidfh {
1019+
__priva: [[::uintptr_t; 32]; 8],
1020+
__privb: [::uintptr_t; 2],
1021+
}
10171022
}
10181023

10191024
s_no_extra_traits! {
@@ -4504,6 +4509,17 @@ extern "C" {
45044509
pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
45054510

45064511
pub fn getlocalbase() -> *const ::c_char;
4512+
4513+
pub fn pidfile_open(
4514+
path: *const ::c_char,
4515+
mode: ::mode_t,
4516+
pidptr: *mut ::pid_t,
4517+
) -> *mut ::pidfh;
4518+
pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int;
4519+
pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int;
4520+
pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int;
4521+
pub fn pidfile_fileno(path: *const ::pidfh) -> ::c_int;
4522+
// FIXME: pidfile_signal in due time (both manpage present and updated image snapshot)
45074523
}
45084524

45094525
#[link(name = "procstat")]

0 commit comments

Comments
 (0)