]> git.ozlabs.org Git - ccan/commitdiff
fdpass: fix complilation on FreeBSD. master
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 13 Jun 2025 02:13:20 +0000 (11:43 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 13 Jun 2025 02:13:20 +0000 (11:43 +0930)
```
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>
ccan/fdpass/fdpass.c

index 7331468f98f5c0b7f5e3718a6152e6e1d3421477..af1a7fdb9ab09341d8f496b50d5301aa15b156e7 100644 (file)
@@ -3,6 +3,7 @@
 #include <sys/socket.h>
 #include <errno.h>
 #include <string.h>
+#include <sys/types.h>
 
 bool fdpass_send(int sockout, int fd)
 {