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
20284eb2
Verified
Commit
20284eb2
authored
9 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Fix rlct_clone.
parent
42c24dd7
No related branches found
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
redox-rt/src/arch/x86_64.rs
+1
-1
1 addition, 1 deletion
redox-rt/src/arch/x86_64.rs
redox-rt/src/thread.rs
+6
-30
6 additions, 30 deletions
redox-rt/src/thread.rs
with
7 additions
and
31 deletions
redox-rt/src/arch/x86_64.rs
+
1
−
1
View file @
20284eb2
...
...
@@ -106,7 +106,7 @@ asmfunction!(__relibc_internal_fork_ret: ["
pop rbp
ret
"
]
<=
[]);
asmfunction!
(
__relibc_internal_rlct_clone_ret
->
usize
:
[
"
asmfunction!
(
__relibc_internal_rlct_clone_ret
:
[
"
# Load registers
pop rax
pop rdi
...
...
This diff is collapsed.
Click to expand it.
redox-rt/src/thread.rs
+
6
−
30
View file @
20284eb2
...
...
@@ -19,13 +19,13 @@ pub unsafe fn rlct_clone_impl(stack: *mut usize) -> Result<usize> {
let
buf
=
create_set_addr_space_buf
(
*
cur_addr_space_fd
,
__relibc_internal_rlct_clone_ret
()
as
usize
,
__relibc_internal_rlct_clone_ret
as
usize
,
stack
as
usize
,
);
let
_
=
syscall
::
write
(
*
new_addr_space_sel_fd
,
&
buf
)
?
;
}
// Inherit file table
// Inherit
reference to
file table
{
let
cur_filetable_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
cur_pid_fd
,
b"filetable"
)
?
);
let
new_filetable_sel_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"current-filetable"
)
?
);
...
...
@@ -36,34 +36,10 @@ pub unsafe fn rlct_clone_impl(stack: *mut usize) -> Result<usize> {
)
?
;
}
// Inherit sigactions (on Linux, CLONE_THREAD requires CLONE_SIGHAND which implies the sigactions
// table is reused).
{
let
cur_sigaction_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
cur_pid_fd
,
b"sigactions"
)
?
);
let
new_sigaction_sel_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"current-sigactions"
)
?
);
let
_
=
syscall
::
write
(
*
new_sigaction_sel_fd
,
&
usize
::
to_ne_bytes
(
*
cur_sigaction_fd
),
)
?
;
}
// Inherit sighandler, but not the sigaltstack.
{
let
new_sighandler_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"sighandler"
)
?
);
let
data
=
SetSighandlerData
{
user_handler
:
sighandler_function
(),
excp_handler
:
0
,
thread_control_addr
:
0
,
// TODO
proc_control_addr
:
0
,
// TODO
};
let
_
=
syscall
::
write
(
*
new_sighandler_fd
,
&
data
)
?
;
}
// Sigprocmask starts as "block all", and is initialized when the thread has actually returned
// from clone_ret.
// TODO: Should some of these registers be inherited?
//copy_env_regs(*cur_pid_fd, *new_pid_fd)?;
// Since the signal handler is not yet initialized, signals specifically targeting the thread
// (relibc is only required to implement thread-specific signals that already originate from
// the same process) will be discarded. Process-specific signals will ignore this new thread,
// until it has initialized its own signal handler.
// Unblock context.
let
start_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"start"
)
?
);
...
...
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