netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4 - 2.6.15]net: 32 bit (socket layer) ioctl emulation for 64 bit kernels
@ 2006-01-12  6:02 Shaun Pereira
  2006-01-12 19:24 ` Arnd Bergmann
  0 siblings, 1 reply; 16+ messages in thread
From: Shaun Pereira @ 2006-01-12  6:02 UTC (permalink / raw)
  To: Arnd Bergmann, Arnaldo Carvalho de Melo, Andi Kleen, linux-kenel,
	x25 maintainer, David S. Miller, netdev
  Cc: SP

The second part of this series. 

This routine is needed by the x25 module (32-64 bit patch), as
recommended it has been added to compat.c

diff -uprN -X dontdiff linux-2.6.15-vanilla/include/net/compat.h
linux-2.6.15/include/net/compat.h
--- linux-2.6.15-vanilla/include/net/compat.h	2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/include/net/compat.h	2006-01-12 16:01:09.000000000
+1100
@@ -23,6 +23,8 @@ struct compat_cmsghdr {
 	compat_int_t	cmsg_type;
 };
 
+extern int compat_sock_get_timestamp(struct sock *, struct timeval
__user *);
+
 #else /* defined(CONFIG_COMPAT) */
 #define compat_msghdr	msghdr		/* to avoid compiler warnings */
 #endif /* defined(CONFIG_COMPAT) */
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/compat.c
linux-2.6.15/net/compat.c
--- linux-2.6.15-vanilla/net/compat.c	2006-01-03 14:21:10.000000000
+1100
+++ linux-2.6.15/net/compat.c	2006-01-12 16:01:09.000000000 +1100
@@ -503,6 +503,20 @@ static int do_get_sock_timeout(int fd, i
 	return err;
 }
 
+int compat_sock_get_timestamp(struct sock *sk, struct timeval __user
*userstamp)
+{
+	struct compat_timeval __user *ctv;
+	ctv = (struct compat_timeval __user*) userstamp;
+	if(!sock_flag(sk, SOCK_TIMESTAMP))
+		sock_enable_timestamp(sk);
+	if(sk->sk_stamp.tv_sec == -1)
+		return -ENOENT;
+	if(sk->sk_stamp.tv_sec == 0)
+		do_gettimeofday(&sk->sk_stamp);
+	return copy_to_user(ctv, &sk->sk_stamp, sizeof(struct
compat_timeval)) ?
+			-EFAULT : 0;
+}
+
 asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
 				char __user *optval, int __user *optlen)
 {
@@ -602,3 +616,5 @@ asmlinkage long compat_sys_socketcall(in
 	}
 	return ret;
 }
+
+EXPORT_SYMBOL(compat_sock_get_timestamp);

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-01-19  1:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12  6:02 [PATCH 2/4 - 2.6.15]net: 32 bit (socket layer) ioctl emulation for 64 bit kernels Shaun Pereira
2006-01-12 19:24 ` Arnd Bergmann
2006-01-13  3:14   ` Shaun Pereira
2006-01-13 11:46     ` Arnd Bergmann
2006-01-16  5:59       ` Shaun Pereira
2006-01-16  6:41         ` YOSHIFUJI Hideaki / 吉藤英明
     [not found]           ` <200601161043.31742.arnd@arndb.de>
2006-01-16 23:11             ` [PATCH 1/4 - 2.6.15 ]net : " Shaun Pereira
2006-01-16 23:11             ` [PATCH 2/4 - 2.6.15]net: " Shaun Pereira
2006-01-16 23:12             ` [PATCH 3/4 -2.6.15]:x25: " Shaun Pereira
2006-01-17  0:15               ` Arnd Bergmann
2006-01-17  4:20                 ` [PATCH 3/4 -2.6.15- RESEND]:x25: " Shaun Pereira
2006-01-18  6:56                 ` Shaun Pereira
2006-01-19  0:57                   ` Arnd Bergmann
2006-01-19  1:05                     ` David S. Miller
2006-01-16 23:12             ` [PATCH 4/4]x25: " Shaun Pereira
2006-01-16  9:39         ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).