pcap_fileno(3)

pcap_fileno3

Get the file descriptor for a live capture

Usage

#include <pcap/pcap.h>

int pcap_fileno(pcap_t *p);

Overview

If p refers to a network device that was opened for a live capture using a combination of pcap_create(3) and pcap_activate(3), or using pcap_open_live(3), pcap_fileno() returns the file descriptor from which captured packets are read.

If p refers to a ``savefile'' that was opened using functions such as pcap_open_offline(3) or pcap_fopen_offline(3), a ``dead'' pcap_t opened using pcap_open_dead(3), or a pcap_t that was created with pcap_create() but that has not yet been activated with pcap_activate(), it returns PCAP_ERROR.

Releases

39 releases since FreeBSD 8.0-RELEASE; the text changed 9 times.

  1. 8.0–8.4
  2. 9.0
  3. 9.1–10.4
  4. 11.0
  5. 11.1–11.2
  6. 11.3
  7. 11.4
  8. 12.0–12.1
  9. 12.2–13.4
  10. 13.5–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's man source.