pcap_dump_ftell(3)

pcap_dump_ftell3

Get the current file offset for a savefile being written

Usage

#include <pcap/pcap.h>

long pcap_dump_ftell(pcap_dumper_t *p); int64_t pcap_dump_ftell64(pcap_dumper_t *p);

Overview

pcap_dump_ftell() returns the current file position for the ``savefile'', representing the number of bytes written by pcap_dump_open(3) and pcap_dump(3). PCAP_ERROR is returned on error. If the current file position does not fit in a long, it will be truncated; this can happen on 32-bit UNIX-like systems with large file support and on Windows. pcap_dump_ftell64() returns the current file position in a int64_t, so if file offsets that don't fit in a long but that fit in a int64_t are supported, this will return the file offset without truncation. PCAP_ERROR is returned on error.

Backward compatibility

The function pcap_dump_ftell64() became available in libpcap release 1.9.0. In previous releases, there was no mechanism to obtain a file offset that is too large to fit in a long.

Releases

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

  1. 8.0–8.4
  2. 9.0–10.4
  3. 11.0
  4. 11.1–11.2
  5. 11.3
  6. 11.4
  7. 12.0–12.1
  8. 12.2–13.4
  9. 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.