home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / compat / i386 / __old__uname.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-05  |  449 b   |  27 lines

  1. #include <errno.h>
  2. #include <linux/utsname.h>
  3. #include <sys/syscall.h>
  4.  
  5. int
  6. __old__uname (struct old_utsname *buf)
  7. {
  8.     register int res;
  9.  
  10. #if defined(__PIC__) || defined(__pic__)
  11.     __asm__("pushl %%ebx\n\t"
  12.         "movl %%ecx,%%ebx\n\t"
  13.         "int $0x80\n\t"
  14.         "popl %%ebx"
  15.         :"=a" (res)
  16.         :"0" (SYS_olduname),"c" (buf));
  17. #else
  18.     __asm__("int $0x80"
  19.         :"=a" (res)
  20.         :"0" (SYS_olduname),"b" (buf));
  21. #endif
  22.     if (res>=0)
  23.         return res;
  24.     errno = -res;
  25.     return -1;
  26. }
  27.