dect
/
libpcap
Archived
13
0
Fork 0

Handle the case where mmap()ped access to the USB buffer is used;

hopefully I'm inferring correctly from the mon_bin_poll() routine that,
even with purely-mmapped access, you can use select() or poll() to wait
for packets to arrive.
This commit is contained in:
guy 2007-12-14 08:02:40 +00:00
parent 25ccbe6e86
commit 1952d35b37
1 changed files with 7 additions and 1 deletions

View File

@ -34,7 +34,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.19 2007-12-14 07:52:32 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.20 2007-12-14 08:02:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -232,6 +232,12 @@ usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errms
handle->stats_op = usb_stats_linux_bin;
handle->read_op = usb_read_linux_mmap;
handle->close_op = usb_close_linux_mmap;
/*
* "handle->fd" is a real file, so "select()" and
* "poll()" work on it.
*/
handle->selectable_fd = handle->fd;
return handle;
}