remove redundant feature test macro checks in sys/time.h
[musl] / include / sys / socket.h
index a4db940..8664779 100644 (file)
@@ -20,15 +20,13 @@ extern "C" {
 #include <bits/socket.h>
 
 #ifdef _GNU_SOURCE
-struct ucred
-{
+struct ucred {
        pid_t pid;
        uid_t uid;
        gid_t gid;
 };
 
-struct mmsghdr
-{
+struct mmsghdr {
        struct msghdr msg_hdr;
        unsigned int  msg_len;
 };
@@ -39,8 +37,7 @@ int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int);
 int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *);
 #endif
 
-struct linger
-{
+struct linger {
        int l_onoff;
        int l_linger;
 };
@@ -109,7 +106,9 @@ struct linger
 #define PF_ALG          38
 #define PF_NFC          39
 #define PF_VSOCK        40
-#define PF_MAX          41
+#define PF_KCM          41
+#define PF_QIPCRTR      42
+#define PF_MAX          43
 
 #define AF_UNSPEC       PF_UNSPEC
 #define AF_LOCAL        PF_LOCAL
@@ -155,6 +154,8 @@ struct linger
 #define AF_ALG          PF_ALG
 #define AF_NFC          PF_NFC
 #define AF_VSOCK        PF_VSOCK
+#define AF_KCM          PF_KCM
+#define AF_QIPCRTR      PF_QIPCRTR
 #define AF_MAX          PF_MAX
 
 #ifndef SO_DEBUG
@@ -220,7 +221,9 @@ struct linger
 #define SO_INCOMING_CPU         49
 #define SO_ATTACH_BPF           50
 #define SO_DETACH_BPF           SO_DETACH_FILTER
-
+#define SO_ATTACH_REUSEPORT_CBPF 51
+#define SO_ATTACH_REUSEPORT_EBPF 52
+#define SO_CNX_ADVICE           53
 
 #ifndef SOL_SOCKET
 #define SOL_SOCKET      1
@@ -237,6 +240,21 @@ struct linger
 #define SOL_ATM         264
 #define SOL_AAL         265
 #define SOL_IRDA        266
+#define SOL_NETBEUI     267
+#define SOL_LLC         268
+#define SOL_DCCP        269
+#define SOL_NETLINK     270
+#define SOL_TIPC        271
+#define SOL_RXRPC       272
+#define SOL_PPPOL2TP    273
+#define SOL_BLUETOOTH   274
+#define SOL_PNPIPE      275
+#define SOL_RDS         276
+#define SOL_IUCV        277
+#define SOL_CAIF        278
+#define SOL_ALG         279
+#define SOL_NFC         280
+#define SOL_KCM         281
 
 #define SOMAXCONN       128
 
@@ -257,6 +275,7 @@ struct linger
 #define MSG_NOSIGNAL  0x4000
 #define MSG_MORE      0x8000
 #define MSG_WAITFORONE 0x10000
+#define MSG_BATCH     0x40000
 #define MSG_FASTOPEN  0x20000000
 #define MSG_CMSG_CLOEXEC 0x40000000
 
@@ -265,9 +284,9 @@ struct linger
 #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
 
 #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
-#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (struct cmsghdr *)0 : \
-        (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (struct cmsghdr *)0 : \
-        ((struct cmsghdr *)__CMSG_NEXT(cmsg))))
+#define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) || \
+       __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
+       ? 0 : (struct cmsghdr *)__CMSG_NEXT(cmsg))
 #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
 
 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
@@ -277,17 +296,15 @@ struct linger
 #define SCM_RIGHTS      0x01
 #define SCM_CREDENTIALS 0x02
 
-struct sockaddr
-{
+struct sockaddr {
        sa_family_t sa_family;
        char sa_data[14];
 };
 
-struct sockaddr_storage
-{
+struct sockaddr_storage {
        sa_family_t ss_family;
+       char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)];
        unsigned long __ss_align;
-       char __ss_padding[128-2*sizeof(unsigned long)];
 };
 
 int socket (int, int, int);