From 1cfd88096fbd2a4593dfe3fa7e26e973a833a82d Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 3 May 2020 04:22:29 +0000 Subject: nt32|nt64: move msghdr and cmsghdr out of bits/socket.h as needed. [while maintaining compatibility with older musl versions] [cf. musl commit a0252bc75b8546008c6b87e58344c4340683d5eb] --- arch/nt32/bits/socket.h | 17 ----------------- arch/nt32/bits/socket.h.in | 17 +++++++++++++++++ arch/nt64/bits/socket.h | 18 ------------------ arch/nt64/bits/socket.h.in | 18 ++++++++++++++++++ project/headers.mk | 5 +++++ 5 files changed, 40 insertions(+), 35 deletions(-) delete mode 100644 arch/nt32/bits/socket.h create mode 100644 arch/nt32/bits/socket.h.in delete mode 100644 arch/nt64/bits/socket.h create mode 100644 arch/nt64/bits/socket.h.in diff --git a/arch/nt32/bits/socket.h b/arch/nt32/bits/socket.h deleted file mode 100644 index 36febbc..0000000 --- a/arch/nt32/bits/socket.h +++ /dev/null @@ -1,17 +0,0 @@ -struct msghdr -{ - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen; - void *msg_control; - socklen_t msg_controllen; - int msg_flags; -}; - -struct cmsghdr -{ - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; -}; diff --git a/arch/nt32/bits/socket.h.in b/arch/nt32/bits/socket.h.in new file mode 100644 index 0000000..36febbc --- /dev/null +++ b/arch/nt32/bits/socket.h.in @@ -0,0 +1,17 @@ +struct msghdr +{ + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen; + void *msg_control; + socklen_t msg_controllen; + int msg_flags; +}; + +struct cmsghdr +{ + socklen_t cmsg_len; + int cmsg_level; + int cmsg_type; +}; diff --git a/arch/nt64/bits/socket.h b/arch/nt64/bits/socket.h deleted file mode 100644 index eb81356..0000000 --- a/arch/nt64/bits/socket.h +++ /dev/null @@ -1,18 +0,0 @@ -struct msghdr -{ - void *msg_name; - socklen_t msg_namelen; - struct iovec *msg_iov; - int msg_iovlen, __pad1; - void *msg_control; - socklen_t msg_controllen, __pad2; - int msg_flags; -}; - -struct cmsghdr -{ - socklen_t cmsg_len; - int cmsg_level; - int cmsg_type; - int __pad1; -}; diff --git a/arch/nt64/bits/socket.h.in b/arch/nt64/bits/socket.h.in new file mode 100644 index 0000000..eb81356 --- /dev/null +++ b/arch/nt64/bits/socket.h.in @@ -0,0 +1,18 @@ +struct msghdr +{ + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen, __pad1; + void *msg_control; + socklen_t msg_controllen, __pad2; + int msg_flags; +}; + +struct cmsghdr +{ + socklen_t cmsg_len; + int cmsg_level; + int cmsg_type; + int __pad1; +}; diff --git a/project/headers.mk b/project/headers.mk index 77f7cf1..db8aab0 100644 --- a/project/headers.mk +++ b/project/headers.mk @@ -103,6 +103,11 @@ build/headers.tag: $(ARCH_HEADERS) touch $@ headers.tag: build/headers.tag $(ARCH_GEN_H) + grep 'struct msghdr {' $(SOURCE_DIR)/include/sys/socket.h \ + || cat $(PORT_DIR)/arch/$(ARCH)/bits/socket.h.in \ + > build/include/bits/socket.h \ + || cat $(PORT_DIR)/arch/$(ARCH)/bits/socket.h \ + > build/include/bits/socket.h grep -v '^@@@' build/include/bits/ioctl.h \ > build/include/bits/ioctl.h.tmp grep 'struct winsize' $(SOURCE_DIR)/include/sys/ioctl.h \ -- cgit v1.2.3