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
Peter Limkilde Svendsen
relibc
Commits
43e95a9b
Commit
43e95a9b
authored
6 years ago
by
Michael Aaron Murphy
Browse files
Options
Downloads
Patches
Plain Diff
Implement kill() and killpg()
parent
5f9170d8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/platform/src/linux/mod.rs
+8
-0
8 additions, 0 deletions
src/platform/src/linux/mod.rs
src/platform/src/redox/mod.rs
+8
-0
8 additions, 0 deletions
src/platform/src/redox/mod.rs
src/signal/src/lib.rs
+2
-2
2 additions, 2 deletions
src/signal/src/lib.rs
with
18 additions
and
2 deletions
src/platform/src/linux/mod.rs
+
8
−
0
View file @
43e95a9b
...
@@ -115,6 +115,14 @@ pub fn getuid() -> uid_t {
...
@@ -115,6 +115,14 @@ pub fn getuid() -> uid_t {
e
(
unsafe
{
syscall!
(
GETUID
)
})
e
(
unsafe
{
syscall!
(
GETUID
)
})
}
}
pub
fn
kill
(
pid
:
pid_t
,
sig
:
c_int
)
->
c_int
{
e
(
unsafe
{
syscall!
(
KILL
,
pid
,
sig
)
})
as
c_int
}
pub
fn
killpg
(
pgrp
:
pid_t
,
sig
:
c_int
)
->
c_int
{
e
(
unsafe
{
syscall!
(
KILL
,
-
(
pgrp
as
isize
)
as
pid_t
,
sig
)
})
as
c_int
}
pub
fn
link
(
path1
:
*
const
c_char
,
path2
:
*
const
c_char
)
->
c_int
{
pub
fn
link
(
path1
:
*
const
c_char
,
path2
:
*
const
c_char
)
->
c_int
{
e
(
unsafe
{
syscall!
(
LINKAT
,
AT_FDCWD
,
path1
,
AT_FDCWD
,
path2
,
0
)
})
as
c_int
e
(
unsafe
{
syscall!
(
LINKAT
,
AT_FDCWD
,
path1
,
AT_FDCWD
,
path2
,
0
)
})
as
c_int
}
}
...
...
This diff is collapsed.
Click to expand it.
src/platform/src/redox/mod.rs
+
8
−
0
View file @
43e95a9b
...
@@ -119,6 +119,14 @@ pub fn getuid() -> uid_t {
...
@@ -119,6 +119,14 @@ pub fn getuid() -> uid_t {
e
(
syscall
::
getuid
())
as
pid_t
e
(
syscall
::
getuid
())
as
pid_t
}
}
pub
fn
kill
(
pid
:
pid_t
,
sig
:
c_int
)
->
c_int
{
e
(
syscall
::
kill
(
pid
,
sig
as
usize
))
as
c_int
}
pub
fn
killpg
(
pgrp
:
pid_t
,
sig
:
c_int
)
->
c_int
{
e
(
syscall
::
kill
(
-
(
pgrp
as
isize
)
as
pid_t
,
sig
as
usize
))
as
c_int
}
pub
fn
link
(
path1
:
*
const
c_char
,
path2
:
*
const
c_char
)
->
c_int
{
pub
fn
link
(
path1
:
*
const
c_char
,
path2
:
*
const
c_char
)
->
c_int
{
let
path1
=
unsafe
{
c_str
(
path1
)
};
let
path1
=
unsafe
{
c_str
(
path1
)
};
let
path2
=
unsafe
{
c_str
(
path2
)
};
let
path2
=
unsafe
{
c_str
(
path2
)
};
...
...
This diff is collapsed.
Click to expand it.
src/signal/src/lib.rs
+
2
−
2
View file @
43e95a9b
...
@@ -27,12 +27,12 @@ pub type sigset_t = sys_sigset_t;
...
@@ -27,12 +27,12 @@ pub type sigset_t = sys_sigset_t;
#[no_mangle]
#[no_mangle]
pub
extern
"C"
fn
kill
(
pid
:
pid_t
,
sig
:
c_int
)
->
c_int
{
pub
extern
"C"
fn
kill
(
pid
:
pid_t
,
sig
:
c_int
)
->
c_int
{
unimplemented!
();
platform
::
kill
(
pid
,
sig
)
}
}
#[no_mangle]
#[no_mangle]
pub
extern
"C"
fn
killpg
(
pgrp
:
pid_t
,
sig
:
c_int
)
->
c_int
{
pub
extern
"C"
fn
killpg
(
pgrp
:
pid_t
,
sig
:
c_int
)
->
c_int
{
unimplemented!
();
platform
::
killpg
(
pgrp
,
sig
)
}
}
#[no_mangle]
#[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