home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / sysdeps / linux / i386 / __select.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-20  |  623 b   |  35 lines

  1. #include <errno.h>
  2. #include <sys/syscall.h>
  3. #include <sys/time.h>
  4.  
  5. int
  6. __select(int nd, fd_set * in, fd_set * out, fd_set * ex, 
  7.     struct timeval * tv)
  8. {
  9.     long __res;
  10. #if defined(__PIC__) || defined (__pic__)
  11.     __asm__ volatile ("pushl %%ebx\n\t"
  12.               "movl %%ecx,%%ebx\n\t"
  13.               "int $0x80\n\t"
  14.               "popl %%ebx"
  15.         : "=a" (__res)
  16.         : "0" (SYS_select),"c" ((long) &nd));
  17. #else
  18.     __asm__ volatile ("int $0x80"
  19.         : "=a" (__res)
  20.         : "0" (SYS_select),"b" ((long) &nd));
  21. #endif
  22.     if (__res >= 0)
  23.         return (int) __res;
  24.     errno = -__res;
  25.     return -1;
  26. }
  27.  
  28.  
  29. #include <gnu-stabs.h>
  30. #ifdef weak_alias
  31. weak_alias (__select, select);
  32. #endif
  33.  
  34.  
  35.