```
cc ccan/ccan/fdpass/fdpass.c
ccan/ccan/fdpass/fdpass.c:16:12: error: use of undeclared identifier 'u_long'; did you mean 'long'?
char buf[CMSG_SPACE(sizeof(fd))];
^
/usr/include/sys/socket.h:577:25: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:16:12: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:577:25: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:16:12: error: use of undeclared identifier 'u_long'; did you mean 'long'?
/usr/include/sys/socket.h:577:58: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:16:12: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:577:58: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:26:19: error: use of undeclared identifier 'u_long'; did you mean 'long'?
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
^
/usr/include/sys/socket.h:578:23: note: expanded from macro 'CMSG_LEN'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:26:19: error: use of undeclared identifier 'u_long'
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
^
/usr/include/sys/socket.h:578:23: note: expanded from macro 'CMSG_LEN'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:26:19: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:578:23: note: expanded from macro 'CMSG_LEN'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:27:9: error: use of undeclared identifier 'u_long'; did you mean 'long'?
memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd));
^
/usr/include/sys/socket.h:554:6: note: expanded from macro 'CMSG_DATA'
_ALIGN(sizeof(struct cmsghdr)))
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:27:9: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:554:6: note: expanded from macro 'CMSG_DATA'
_ALIGN(sizeof(struct cmsghdr)))
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:53:12: error: use of undeclared identifier 'u_long'; did you mean 'long'?
char buf[CMSG_SPACE(sizeof(fd))];
^
/usr/include/sys/socket.h:577:25: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:53:12: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:577:25: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:53:12: error: use of undeclared identifier 'u_long'; did you mean 'long'?
/usr/include/sys/socket.h:577:58: note: expanded from macro 'CMSG_SPACE'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:74:27: error: use of undeclared identifier 'u_long'; did you mean 'long'?
|| cmsg->cmsg_len != CMSG_LEN(sizeof(fd))
^
/usr/include/sys/socket.h:578:23: note: expanded from macro 'CMSG_LEN'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:74:27: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:578:23: note: expanded from macro 'CMSG_LEN'
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:81:14: error: use of undeclared identifier 'u_long'; did you mean 'long'?
memcpy(&fd, CMSG_DATA(cmsg), sizeof(fd));
^
/usr/include/sys/socket.h:554:6: note: expanded from macro 'CMSG_DATA'
_ALIGN(sizeof(struct cmsghdr)))
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
ccan/ccan/fdpass/fdpass.c:81:14: error: use of undeclared identifier 'u_long'
/usr/include/sys/socket.h:554:6: note: expanded from macro 'CMSG_DATA'
_ALIGN(sizeof(struct cmsghdr)))
^
/usr/include/machine/_align.h:45:22: note: expanded from macro '_ALIGN'
^
16 errors generated.
gmake: *** [Makefile:994: ccan-fdpass.o] Error 1
```
Reported-by: https://github.com/21M4TW
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
#include <sys/socket.h>
#include <errno.h>
#include <string.h>
+#include <sys/types.h>
bool fdpass_send(int sockout, int fd)
{