Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
syscall
Commits
7c805d2a
Commit
7c805d2a
authored
Jan 05, 2018
by
Jeremy Soller
Browse files
Add more wait related calls
parent
7ab7dbe3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Cargo.toml
View file @
7c805d2a
[package]
name
=
"redox_syscall"
version
=
"0.1.3
6
"
version
=
"0.1.3
7
"
description
=
"A Rust library to access raw Redox system calls"
license
=
"MIT"
authors
=
[
"Jeremy Soller <jackpot51@gmail.com>"
]
...
...
src/call.rs
View file @
7c805d2a
...
...
@@ -349,29 +349,3 @@ pub fn write(fd: usize, buf: &[u8]) -> Result<usize> {
pub
fn
sched_yield
()
->
Result
<
usize
>
{
unsafe
{
syscall0
(
SYS_YIELD
)
}
}
/// If wifsignaled(status), the terminating signal.
#[inline(always)]
pub
fn
wtermsig
(
status
:
usize
)
->
usize
{
status
&
0x7f
}
/// True if status indicates normal termination.
#[inline(always)]
pub
fn
wifexited
(
status
:
usize
)
->
bool
{
wtermsig
(
status
)
==
0
}
/// True if status indicates the child is stopped.
#[inline(always)]
pub
fn
wifstopped
(
status
:
usize
)
->
bool
{
(
status
&
0xff
)
==
0x7f
}
/// True if status indicates the child continued after a stop.
#[inline(always)]
pub
fn
wifcontinued
(
status
:
usize
)
->
bool
{
status
==
0xffff
}
/// True if STATUS indicates termination by a signal.
#[inline(always)]
pub
fn
wifsignaled
(
status
:
usize
)
->
bool
{
((
status
&
0x7f
)
+
1
)
as
i8
>=
2
}
src/flag.rs
View file @
7c805d2a
...
...
@@ -106,3 +106,43 @@ pub const SA_RESETHAND: usize = 0x80000000;
pub
const
WNOHANG
:
usize
=
0x01
;
pub
const
WUNTRACED
:
usize
=
0x02
;
pub
const
WCONTINUED
:
usize
=
0x08
;
/// True if status indicates the child is stopped.
pub
fn
wifstopped
(
status
:
usize
)
->
bool
{
(
status
&
0xff
)
==
0x7f
}
/// If wifstopped(status), the signal that stopped the child.
pub
fn
wstopsig
(
status
:
usize
)
->
usize
{
(
status
>>
8
)
&
0xff
}
/// True if status indicates the child continued after a stop.
pub
fn
wifcontinued
(
status
:
usize
)
->
bool
{
status
==
0xffff
}
/// True if STATUS indicates termination by a signal.
pub
fn
wifsignaled
(
status
:
usize
)
->
bool
{
((
status
&
0x7f
)
+
1
)
as
i8
>=
2
}
/// If wifsignaled(status), the terminating signal.
pub
fn
wtermsig
(
status
:
usize
)
->
usize
{
status
&
0x7f
}
/// True if status indicates normal termination.
pub
fn
wifexited
(
status
:
usize
)
->
bool
{
wtermsig
(
status
)
==
0
}
/// If wifexited(status), the exit status.
pub
fn
wexitstatus
(
status
:
usize
)
->
usize
{
(
status
>>
8
)
&
0xff
}
/// True if status indicates a core dump was created.
pub
fn
wcoredump
(
status
:
usize
)
->
bool
{
(
status
&
0x80
)
!=
0
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment