summaryrefslogtreecommitdiff
path: root/src/unix/bsd/mod.rs
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2022-11-30 00:02:38 +0000
committerDavid Carlier <devnexen@gmail.com>2022-12-01 12:34:38 +0000
commit27cc898f59e64579b51fae82a381c99566810e05 (patch)
treef4b5e49e623c4531fb314f0f358da2fb21aba071 /src/unix/bsd/mod.rs
parente4b8fd4f59a87346c870295c8125469c672998aa (diff)
downloadrust-libc-27cc898f59e64579b51fae82a381c99566810e05.tar.gz
adding getopt_long for unixes.
Diffstat (limited to 'src/unix/bsd/mod.rs')
-rw-r--r--src/unix/bsd/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 50177015a9..d49e3c4402 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -115,6 +115,13 @@ s! {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
+
+ pub struct option {
+ pub name: *const ::c_char,
+ pub has_arg: ::c_int,
+ pub flag: *mut ::c_int,
+ pub val: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -885,6 +892,13 @@ extern "C" {
pub fn srand48(seed: ::c_long);
pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
pub fn lcong48(p: *mut ::c_ushort);
+ pub fn getopt_long(
+ argc: ::c_int,
+ argv: *const *mut c_char,
+ optstring: *const c_char,
+ longopts: *const option,
+ longindex: *mut ::c_int,
+ ) -> ::c_int;
}
cfg_if! {