1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
3 ;;; --- Wrappers for socket-related C macros.
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)
16 (include "sys/socket.h")
18 (defwrapper* ("cmsg_space" %cmsg-space
) ("unsigned" :unsigned-int
)
19 ((data-size ("unsigned" :unsigned-int
)))
20 "return CMSG_SPACE(data_size);")
22 (defwrapper* ("cmsg_len" %cmsg-len
) ("unsigned" :unsigned-int
)
23 ((data-size ("unsigned" :unsigned-int
)))
24 "return CMSG_LEN(data_size);")
26 (defwrapper* ("cmsg_firsthdr" %cmsg-firsthdr
) ("void*" :pointer
)
27 ((msg ("struct msghdr*" :pointer
)))
28 "return CMSG_FIRSTHDR(msg);")
30 (defwrapper* ("cmsg_data" %cmsg-data
) ("void*" :pointer
)
31 ((cmsg ("struct cmsghdr*" :pointer
)))
32 "return CMSG_DATA(cmsg);")