about summary refs log tree commit diff
path: root/sysdeps/unix/bsd
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-08-22 22:29:39 +0000
committerMark Kettenis <kettenis@gnu.org>2001-08-22 22:29:39 +0000
commit38bb8feb805a8696474dddbd2e56068601a9c900 (patch)
tree6909ca6406451dc39f9888a2fab5a5cc23c07f86 /sysdeps/unix/bsd
parent6106611a253467a76e3b8a32548a8a1caeb529fa (diff)
downloadglibc-38bb8feb805a8696474dddbd2e56068601a9c900.tar.gz
glibc-38bb8feb805a8696474dddbd2e56068601a9c900.tar.xz
glibc-38bb8feb805a8696474dddbd2e56068601a9c900.zip
* sysdeps/unix/bsd/bsd4.4/Makefile: New file. * sysdeps/unix/bsd/bsd4.4/Versions: New file. * sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c: New file. * sysdeps/unix/bsd/bsd4.4/bits/socket.h (__cmsg_nxthdr): Correct test for cmsg struct size.
2001-08-01  Mark Kettenis  <kettenis@gnu.org>

	* sysdeps/unix/bsd/bsd4.4/Makefile: New file.
	* sysdeps/unix/bsd/bsd4.4/Versions: New file.
	* sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c: New file.
	* sysdeps/unix/bsd/bsd4.4/bits/socket.h (__cmsg_nxthdr): Correct
	test for cmsg struct size.
Diffstat (limited to 'sysdeps/unix/bsd')
-rw-r--r--sysdeps/unix/bsd/bsd4.4/Makefile3
-rw-r--r--sysdeps/unix/bsd/bsd4.4/Versions6
-rw-r--r--sysdeps/unix/bsd/bsd4.4/bits/socket.h10
-rw-r--r--sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c2
4 files changed, 18 insertions, 3 deletions
diff --git a/sysdeps/unix/bsd/bsd4.4/Makefile b/sysdeps/unix/bsd/bsd4.4/Makefile
new file mode 100644
index 0000000000..208fd24484
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),socket)
+sysdep_routines += cmsg_nxthdr
+endif
diff --git a/sysdeps/unix/bsd/bsd4.4/Versions b/sysdeps/unix/bsd/bsd4.4/Versions
new file mode 100644
index 0000000000..99b386b670
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/Versions
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.2.5 {
+    # functions used in inline functions or macros
+    __cmsg_nxthdr;
+  }
+}
diff --git a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bits/socket.h
index dbd0f1e6a9..ef2a5bf86a 100644
--- a/sysdeps/unix/bsd/bsd4.4/bits/socket.h
+++ b/sysdeps/unix/bsd/bsd4.4/bits/socket.h
@@ -237,8 +237,8 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
-  if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
-					 + __mhdr->msg_controllen)
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
@@ -250,8 +250,12 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 /* Socket level message types.  */
 enum
   {
-    SCM_RIGHTS = 0x01		/* Access rights.  */
+    SCM_RIGHTS = 0x01,		/* Access rights (array of int).  */
 #define SCM_RIGHTS SCM_RIGHTS
+    SCM_TIMESTAMP = 0x02,	/* Timestamp (struct timeval).  */
+#define SCM_TIMESTAMP SCM_TIMESTAMP
+    SCM_CREDS = 0x03		/* Process creds (strcm cmsgcred).  */
+#define SCM_CREDS SCM_CREDS
   };
 
 
diff --git a/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c b/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c
new file mode 100644
index 0000000000..1a542fa01a
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c
@@ -0,0 +1,2 @@
+/* The Linux version is perfectly usable on 4.4 BSD.  */
+#include <sysdeps/unix/sysv/linux/cmsg_nxthdr.c>