From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1143c4,ed31b9cc68ef708d,start X-Google-Attributes: gid1143c4,public X-Google-Thread: 111c93,ed31b9cc68ef708d,start X-Google-Attributes: gid111c93,public From: Brian Hazzard Subject: tcpdump/packet_ioctl: SIOCGSTAMP Date: 1999/07/20 Message-ID: <37948138.FFE86A21@ll.mit.edu>#1/1 X-Deja-AN: 503131788 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@ll.mit.edu X-Trace: llnews 932478898 155.34.60.83 (Tue, 20 Jul 1999 09:54:58 EDT) MIME-Version: 1.0 NNTP-Posting-Date: Tue, 20 Jul 1999 09:54:58 EDT Newsgroups: linux.dev.kernel,comp.os.linux.alpha Hi, I am running tcpdump on an alpha running linux 2.2.10. The tcpdump timestamp is in seconds. Has anyone been able to get usec timestamps on linux alphas??? Thanks, Brian PS. I am running tcpdump-3.4 and libpcap-0.4. libpcap makes an ioctl to packet_ioctl (in af_packet.c) to get the timestamp (passing a reference to a timeval structure). Inserting a printk in af_packet.c for the SIOCGSTAMP ioctl shows both the sk->stamp.tv_sec and sk->stamp.tv_usec fields are filled in. Unfortunately, inserting a printf after the ioctl call in libpcap shows the usec field is zero. Is there a problem with passing data structures this way using copy_to_user for alphas? from libpcap ----------------- /* Get timestamp */ if (ioctl(p->fd, SIOCGSTAMP, &h.ts) < 0) { sprintf(p->errbuf, "SIOCGSTAMP: %s", pcap_strerror(errno)); return (-1); } from af_packet.c ----------------- case SIOCGSTAMP: if(sk->stamp.tv_sec==0) return -ENOENT; err = -EFAULT; if (!copy_to_user((void *)arg, &sk->stamp, sizeof(struct timeval))) err = 0; return err;