Home

ESPIPE

ESPIPE is an errno value used by POSIX and other Unix-like systems to indicate an illegal seek operation. It is raised when a process attempts to reposition the file offset on a non-seekable data stream, such as a pipe, FIFO, or network socket, using functions like lseek or fseeko. Regular files and other seekable objects support repositioning, so lseek on those descriptors succeeds.

In POSIX, ESPIPE is defined as part of the set of error numbers (errno values) and is

Programmatically, encountering ESPIPE typically means the caller is using a non-seekable descriptor in a context that

See also: ENOTTY, ENXIO, EINVAL, and the general errno mechanism in C and POSIX.

described
by
the
message
"Illegal
seek."
The
exact
numeric
value
varies
by
system;
for
example,
Linux
commonly
defines
ESPIPE
as
29.
Some
systems
may
map
similar
conditions
to
different
codes,
but
the
semantic
meaning
remains
the
same:
the
operation
is
not
supported
for
the
underlying
object.
requires
seeking.
One
cannot
reliably
move
to
an
arbitrary
offset
in
a
pipe
or
socket,
so
programs
must
either
avoid
seeking,
switch
to
sequential
processing,
or
use
alternative
mechanisms
to
manage
data
position.