Better DEFSYSCALL.
[iolib.git] / net.sockets / wrappers.lisp
blob4dbad64255e698643fbe0d02a12a957355340ae2
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Wrappers for socket-related C macros.
4 ;;;
6 (in-package :net.sockets)
8 (c "#if defined(__linux__)")
9 (define "_XOPEN_SOURCE" 600)
10 (define "_LARGEFILE_SOURCE")
11 (define "_LARGEFILE64_SOURCE")
12 (define "_FILE_OFFSET_BITS" 64)
13 (c "#endif")
15 (include "stdlib.h") ; needed on FreeBSD to define NULL
16 (include "sys/socket.h")
18 (defwrapper* ("cmsg_space" %cmsg-space) :unsigned-int
19 ((data-size :unsigned-int))
20 "return CMSG_SPACE(data_size);")
22 (defwrapper* ("cmsg_len" %cmsg-len) :unsigned-int
23 ((data-size :unsigned-int))
24 "return CMSG_LEN(data_size);")
26 (defwrapper* ("cmsg_firsthdr" %cmsg-firsthdr) :pointer
27 ((msg ("struct msghdr*" :pointer)))
28 "return CMSG_FIRSTHDR(msg);")
30 (defwrapper* ("cmsg_data" %cmsg-data) :pointer
31 ((cmsg ("struct cmsghdr*" :pointer)))
32 "return CMSG_DATA(cmsg);")