Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
relibc
Commits
c44fda84
Commit
c44fda84
authored
2 years ago
by
David CARLIER
Browse files
Options
Downloads
Patches
Plain Diff
signal add few missing implementations
parent
673c1e3a
No related branches found
Branches containing commit
No related tags found
1 merge request
!376
signal add few missing implementations
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/header/signal/mod.rs
+24
-4
24 additions, 4 deletions
src/header/signal/mod.rs
with
24 additions
and
4 deletions
src/header/signal/mod.rs
+
24
−
4
View file @
c44fda84
//! signal implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html
use
core
::
mem
;
use
core
::
{
mem
,
ptr
}
;
use
cbitset
::
BitSet
;
...
...
@@ -157,17 +157,37 @@ pub extern "C" fn sigfillset(set: *mut sigset_t) -> c_int {
// #[no_mangle]
pub
extern
"C"
fn
sighold
(
sig
:
c_int
)
->
c_int
{
unimplemented!
();
let
mut
pset
=
mem
::
MaybeUninit
::
<
sigset_t
>
::
uninit
();
unsafe
{
sigemptyset
(
pset
.as_mut_ptr
())
};
let
mut
set
=
unsafe
{
pset
.assume_init
()
};
if
sigaddset
(
&
mut
set
,
sig
)
<
0
{
return
-
1
;
}
sigprocmask
(
SIG_BLOCK
,
&
set
,
ptr
::
null_mut
())
}
// #[no_mangle]
pub
extern
"C"
fn
sigignore
(
sig
:
c_int
)
->
c_int
{
unimplemented!
();
let
mut
psa
=
mem
::
MaybeUninit
::
<
sigaction
>
::
uninit
();
unsafe
{
sigemptyset
(
&
mut
(
*
psa
.as_mut_ptr
())
.sa_mask
)
};
let
mut
sa
=
unsafe
{
psa
.assume_init
()
};
sa
.sa_handler
=
unsafe
{
mem
::
transmute
(
SIG_IGN
)
};
sa
.sa_flags
=
0
;
unsafe
{
sigaction
(
sig
,
&
mut
sa
,
ptr
::
null_mut
())
}
}
// #[no_mangle]
pub
extern
"C"
fn
siginterrupt
(
sig
:
c_int
,
flag
:
c_int
)
->
c_int
{
unimplemented!
();
let
mut
psa
=
mem
::
MaybeUninit
::
<
sigaction
>
::
uninit
();
unsafe
{
sigaction
(
sig
,
ptr
::
null_mut
(),
psa
.as_mut_ptr
())
};
let
mut
sa
=
unsafe
{
psa
.assume_init
()
};
if
flag
!=
0
{
sa
.sa_flags
&=
!
SA_RESTART
as
c_ulong
;
}
else
{
sa
.sa_flags
|
=
SA_RESTART
as
c_ulong
;
}
unsafe
{
sigaction
(
sig
,
&
mut
sa
,
ptr
::
null_mut
())
}
}
#[no_mangle]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment