diff options
author | David Carlier <devnexen@gmail.com> | 2023-02-02 19:41:19 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2023-02-02 19:41:19 +0000 |
commit | 48fae9e9cc1192e8d130339c9f7ebb36a3367fd8 (patch) | |
tree | 104807cd18ed20155ab3888d25748244d6e89109 /src | |
parent | 106b57a796145c42f9a385a2a8cf764abbc66624 (diff) | |
download | rust-libc-48fae9e9cc1192e8d130339c9f7ebb36a3367fd8.tar.gz |
pidfile util api for freebsd addition.
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 27caa93608..493ab30f49 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1014,6 +1014,11 @@ s! { pub struct memory_type_list { __priv: [::uintptr_t; 2], } + + pub struct pidfh { + __priva: [[::uintptr_t; 32]; 8], + __privb: [::uintptr_t; 2], + } } s_no_extra_traits! { @@ -4496,6 +4501,17 @@ extern "C" { pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int; pub fn getlocalbase() -> *const ::c_char; + + pub fn pidfile_open( + path: *const ::c_char, + mode: ::mode_t, + pidptr: *mut ::pid_t, + ) -> *mut ::pidfh; + pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_fileno(path: *const ::pidfh) -> ::c_int; + // FIXME: pidfile_signal in due time (both manpage present and updated image snapshot) } #[link(name = "procstat")] |