Main Page | Directories | File List | Globals

sigaction.c

Go to the documentation of this file.
00001 /*
00002  * kernel_super/signals/sigaction.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/04
00008  * Author:      Lukasz Dembinski
00009  * Info:        sigaction.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
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 
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix