Fork me on GitHub

root/kernel/syscalls/sigreturn.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. sys_sigreturn

   1 /*
   2  * fiwix/kernel/syscalls/sigreturn.c
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #include <fiwix/process.h>
   9 #include <fiwix/sigcontext.h>
  10 #include <fiwix/string.h>
  11 
  12 #ifdef __DEBUG__
  13 #include <fiwix/stdio.h>
  14 #endif /*__DEBUG__ */
  15 
  16 int sys_sigreturn(unsigned int signum, int arg2, int arg3, int arg4, int arg5, struct sigcontext *sc)
  17 {
  18 #ifdef __DEBUG__
  19         printk("(pid %d) sys_sigreturn(0x%08x)\n", current->pid, signum);
  20 #endif /*__DEBUG__ */
  21 
  22         current->sigblocked &= ~current->sigexecuting;
  23         current->sigexecuting = 0;
  24         memcpy_b(sc, &current->sc[signum - 1], sizeof(struct sigcontext));
  25 
  26         /*
  27          * We return here the value that the syscall was returning when it was
  28          * interrupted by a signal.
  29          */
  30         return current->sc[signum - 1].eax;
  31 }

/* [previous][next][first][last][top][bottom][index][help] */