diff options
author | Shaun Pereira <spereira@tusc.com.au> | 2006-03-22 02:59:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-22 02:59:39 -0500 |
commit | f0ac2614412e2b597e2d5bfbd3960b4f73718b41 (patch) | |
tree | b1d6c3fabc0f143eec1dcb1ce7c5f6d2bcb64ee1 /net/compat.c | |
parent | 89bbfc95d65839d6ae23ddab8a3cc5af4ae88383 (diff) |
[NET]: socket timestamp 32 bit handler for 64 bit kernel
Get socket timestamp handler function that does not use the
ioctl32_hash_table.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/compat.c b/net/compat.c index 13177a1a4b39..8fd37cd7b501 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -543,6 +543,25 @@ static int compat_sock_getsockopt(struct socket *sock, int level, int optname, | |||
543 | return sock_getsockopt(sock, level, optname, optval, optlen); | 543 | return sock_getsockopt(sock, level, optname, optval, optlen); |
544 | } | 544 | } |
545 | 545 | ||
546 | int compat_sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp) | ||
547 | { | ||
548 | struct compat_timeval __user *ctv = | ||
549 | (struct compat_timeval __user*) userstamp; | ||
550 | int err = -ENOENT; | ||
551 | |||
552 | if (!sock_flag(sk, SOCK_TIMESTAMP)) | ||
553 | sock_enable_timestamp(sk); | ||
554 | if (sk->sk_stamp.tv_sec == -1) | ||
555 | return err; | ||
556 | if (sk->sk_stamp.tv_sec == 0) | ||
557 | do_gettimeofday(&sk->sk_stamp); | ||
558 | if (put_user(sk->sk_stamp.tv_sec, &ctv->tv_sec) || | ||
559 | put_user(sk->sk_stamp.tv_usec, &ctv->tv_usec)) | ||
560 | err = -EFAULT; | ||
561 | return err; | ||
562 | } | ||
563 | EXPORT_SYMBOL(compat_sock_get_timestamp); | ||
564 | |||
546 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | 565 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, |
547 | char __user *optval, int __user *optlen) | 566 | char __user *optval, int __user *optlen) |
548 | { | 567 | { |