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 / setsockopt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-08  |  449 b   |  21 lines

  1. #include <syscall.h>
  2. #include <sys/socket.h>
  3. #include <sys/socketcall.h>
  4.  
  5. static inline
  6. _syscall2(long,socketcall,int,call,unsigned long *,args);
  7.  
  8. /* [sg]etsockoptions by bir7@leland.stanford.edu */
  9. int
  10. setsockopt (int fd, int level, int optname, const void *optval,
  11.     int optlen)
  12. {
  13.     unsigned long args[5];
  14.     args[0]=fd;
  15.     args[1]=level;
  16.     args[2]=optname;
  17.     args[3]=(unsigned long)optval;
  18.     args[4]=optlen;
  19.     return (socketcall (SYS_SETSOCKOPT, args));
  20. }
  21.