00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <agnix/agnix.h>
00015 #include <agnix/console.h>
00016 #include <agnix/tasks.h>
00017 #include <agnix/signals.h>
00018 #include <agnix/spinlock.h>
00019 #include <agnix/memory.h>
00020 #include <agnix/errno.h>
00021
00022 int do_sys_sigaction(int sig, struct sigaction_s *act, struct sigaction_s *oldact)
00023 {
00024 struct task_s *task = current_task;
00025
00026 if (act == NULL && oldact == NULL)
00027 return -EINVAL;
00028
00029 spin_lock_irq(&(task->signals_act.lock));
00030
00031 if (oldact != NULL)
00032 memcpy(oldact, &(task->signals_act.sigaction[sig]), sizeof(struct sigaction_s));
00033
00034 if (act != NULL)
00035 memcpy(&(task->signals_act.sigaction[sig]), act, sizeof(struct sigaction_s));
00036
00037 spin_unlock_irq(&(task->signals_act.lock));
00038
00039 return 0;
00040 }
00041
00042