Fork me on GitHub

root/kernel/syscalls/old_select.c

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

DEFINITIONS

This source file includes following definitions.
  1. old_select

   1 /*
   2  * fiwix/kernel/syscalls/old_select.c
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #include <fiwix/types.h>
   9 #include <fiwix/syscalls.h>
  10 #include <fiwix/fs.h>
  11 #include <fiwix/sleep.h>
  12 #include <fiwix/sched.h>
  13 
  14 #ifdef __DEBUG__
  15 #include <fiwix/stdio.h>
  16 #include <fiwix/process.h>
  17 #endif /*__DEBUG__ */
  18 
  19 int old_select(unsigned long int *params)
  20 {
  21         int nfds;
  22         fd_set *readfds;
  23         fd_set *writefds;
  24         fd_set *exceptfds;
  25         struct timeval *timeout;
  26         int errno;
  27 
  28 #ifdef __DEBUG__
  29         printk("(pid %d) old_select(0x%08x)\n", current->pid, (int)params);
  30 #endif /*__DEBUG__ */
  31 
  32         if((errno = check_user_area(VERIFY_READ, (void *)params, sizeof(unsigned int) * 5))) {
  33                 return errno;
  34         }
  35         nfds = *(int *)params;
  36         readfds = *(fd_set **)(params + 1);
  37         writefds = *(fd_set **)(params + 2);
  38         exceptfds = *(fd_set **)(params + 3);
  39         timeout = *(struct timeval **)(params + 4);
  40 
  41         return sys_select(nfds, readfds, writefds, exceptfds, timeout);
  42 }

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