mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Fix sys$sigaction() to return the old action metadata if requested.
This commit is contained in:
parent
0b3e927597
commit
e088121b3a
2 changed files with 7 additions and 1 deletions
|
@ -59,7 +59,7 @@ WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
|
|||
FLAVOR_FLAGS = -mregparm=3 -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
|
||||
OPTIMIZATION_FLAGS = -Os -fno-asynchronous-unwind-tables
|
||||
INCLUDE_FLAGS = -I.. -I.
|
||||
SUGGEST_FLAGS = -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override
|
||||
SUGGEST_FLAGS = -Wsuggest-attribute=noreturn -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override
|
||||
|
||||
DEFINES = -DSERENITY -DKERNEL -DSANITIZE_PTRS
|
||||
|
||||
|
|
|
@ -1564,6 +1564,12 @@ int Process::sys$sigaction(int signum, const Unix::sigaction* act, Unix::sigacti
|
|||
VALIDATE_USER_READ(act, sizeof(Unix::sigaction));
|
||||
InterruptDisabler disabler; // FIXME: This should use a narrower lock.
|
||||
auto& action = m_signal_action_data[signum];
|
||||
if (old_act) {
|
||||
VALIDATE_USER_WRITE(old_act, sizeof(Unix::sigaction));
|
||||
old_act->sa_flags = action.flags;
|
||||
old_act->sa_restorer = (decltype(old_act->sa_restorer))action.restorer.get();
|
||||
old_act->sa_sigaction = (decltype(old_act->sa_sigaction))action.handler_or_sigaction.get();
|
||||
}
|
||||
action.restorer = LinearAddress((dword)act->sa_restorer);
|
||||
action.flags = act->sa_flags;
|
||||
action.handler_or_sigaction = LinearAddress((dword)act->sa_sigaction);
|
||||
|
|
Loading…
Add table
Reference in a new issue