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
8f66730d
Verified
Commit
8f66730d
authored
8 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Set child sighandler *after* cloning address space.
parent
20284eb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
redox-rt/src/proc.rs
+9
-6
9 additions, 6 deletions
redox-rt/src/proc.rs
with
9 additions
and
6 deletions
redox-rt/src/proc.rs
+
9
−
6
View file @
8f66730d
...
...
@@ -713,12 +713,6 @@ pub fn fork_inner(initial_rsp: *mut usize) -> Result<usize> {
let
cur_pid_fd
=
FdGuard
::
new
(
syscall
::
open
(
"thisproc:current/open_via_dup"
,
O_CLOEXEC
)
?
);
(
new_pid_fd
,
new_pid
)
=
new_context
()
?
;
// Reuse the same sigaltstack and signal entry (all memory will be re-mapped CoW later).
{
let
new_sighandler_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"sighandler"
)
?
);
let
_
=
syscall
::
write
(
*
new_sighandler_fd
,
&
crate
::
signal
::
current_setsighandler_struct
())
?
;
}
copy_str
(
*
cur_pid_fd
,
*
new_pid_fd
,
"name"
)
?
;
// Copy existing files into new file table, but do not reuse the same file table (i.e. new
...
...
@@ -801,6 +795,15 @@ pub fn fork_inner(initial_rsp: *mut usize) -> Result<usize> {
}
}
// Reuse the same sigaltstack and signal entry (all memory will be re-mapped CoW later).
//
// Do this after the address space is cloned, since the kernel will get a shared
// reference to the TCB and whatever pages stores the signal proc control struct.
{
let
new_sighandler_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
new_pid_fd
,
b"sighandler"
)
?
);
let
_
=
syscall
::
write
(
*
new_sighandler_fd
,
&
crate
::
signal
::
current_setsighandler_struct
())
?
;
}
let
buf
=
create_set_addr_space_buf
(
*
new_addr_space_fd
,
__relibc_internal_fork_ret
as
usize
,
...
...
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