patch-2.4.0-test3 linux/include/net/sock.h

Next file: linux/init/main.c
Previous file: linux/include/net/slhc_vj.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/include/net/sock.h linux/include/net/sock.h
@@ -515,6 +515,8 @@
 				broadcast,
 				bsdism;
 	unsigned char		debug;
+	unsigned char		rcvtstamp;
+	unsigned char		userlocks;
 	int			proc;
 	unsigned long	        lingertime;
 
@@ -1222,7 +1224,7 @@
 
 extern __inline__ int sock_rcvlowat(struct sock *sk, int waitall, int len)
 {
-	return waitall ? len : min(sk->rcvlowat, len);
+	return (waitall ? len : min(sk->rcvlowat, len)) ? : 1;
 }
 
 /* Alas, with timeout socket operations are not restartable.
@@ -1231,6 +1233,15 @@
 extern __inline__ int sock_intr_errno(long timeo)
 {
 	return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR;
+}
+
+static __inline__ void
+sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
+{
+	if (sk->rcvtstamp)
+		put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(skb->stamp), &skb->stamp);
+	else
+		sk->stamp = skb->stamp;
 }
 
 /* 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)