-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added timer_create and related calls #1900
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ type __pthread_spin_t = __cpu_simple_lock_nv_t; | |
pub type vm_size_t = ::uintptr_t; | ||
pub type lwpid_t = ::c_uint; | ||
pub type shmatt_t = ::c_uint; | ||
pub type timer_t = *mut ::c_void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, seems it's defined as |
||
|
||
impl siginfo_t { | ||
pub unsafe fn si_value(&self) -> ::sigval { | ||
|
@@ -341,6 +342,11 @@ s! { | |
pub time_state: ::c_int, | ||
} | ||
|
||
pub struct itimerspec { | ||
pub it_interval: ::timespec, | ||
pub it_value: ::timespec, | ||
} | ||
|
||
} | ||
|
||
s_no_extra_traits! { | ||
|
@@ -1759,6 +1765,24 @@ extern "C" { | |
nitems: ::c_int, | ||
sevp: *mut sigevent, | ||
) -> ::c_int; | ||
|
||
pub fn timer_create( | ||
clockid: ::clockid_t, | ||
sevp: *mut ::sigevent, | ||
timerid: *mut ::timer_t, | ||
) -> ::c_int; | ||
pub fn timer_settime( | ||
timerid: ::timer_t, | ||
flags: ::c_int, | ||
new_value: *const ::itimerspec, | ||
old_value: *mut ::itimerspec, | ||
) -> ::c_int; | ||
pub fn timer_gettime( | ||
timerid: ::timer_t, | ||
curr_value: *mut ::itimerspec, | ||
) -> ::c_int; | ||
pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int; | ||
pub fn timer_delete(timerid: ::timer_t) -> ::c_int; | ||
} | ||
|
||
extern "C" { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pub type tcflag_t = ::c_uint; | |
pub type clockid_t = ::c_int; | ||
pub type key_t = ::c_int; | ||
pub type id_t = ::c_uint; | ||
pub type timer_t = *mut ::c_void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems Android and Linux define |
||
|
||
#[cfg_attr(feature = "extra_traits", derive(Debug))] | ||
pub enum timezone {} | ||
|
@@ -201,6 +202,11 @@ s! { | |
pub msg_hdr: ::msghdr, | ||
pub msg_len: ::c_uint, | ||
} | ||
|
||
pub struct itimerspec { | ||
pub it_interval: ::timespec, | ||
pub it_value: ::timespec, | ||
} | ||
} | ||
|
||
s_no_extra_traits! { | ||
|
@@ -1566,6 +1572,24 @@ extern "C" { | |
flags: ::c_int, | ||
) -> ::ssize_t; | ||
pub fn uname(buf: *mut ::utsname) -> ::c_int; | ||
|
||
pub fn timer_create( | ||
clockid: ::clockid_t, | ||
sevp: *mut ::sigevent, | ||
timerid: *mut ::timer_t, | ||
) -> ::c_int; | ||
pub fn timer_settime( | ||
timerid: ::timer_t, | ||
flags: ::c_int, | ||
new_value: *const ::itimerspec, | ||
old_value: *mut ::itimerspec, | ||
) -> ::c_int; | ||
pub fn timer_gettime( | ||
timerid: ::timer_t, | ||
curr_value: *mut ::itimerspec, | ||
) -> ::c_int; | ||
pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int; | ||
pub fn timer_delete(timerid: ::timer_t) -> ::c_int; | ||
} | ||
|
||
cfg_if! { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
timer_t
c_void
on DragonFlyBSD as well?I only found this: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/85f00d18bcc1ab1d11df7193b597e70a43e0896d/sys/cpu/x86_64/include/stdint.h#L125