Date: Tue, 4 May 2021 09:28:04 -0400
From: Chet Ramey <chet.ramey@case.edu>
Message-ID: <c8b1b097-d430-e840-017d-52a1a6a393d0@case.edu>
| The issue with the BSDs and terminal devices is that the current code
| only checks for -1/ESPIPE, but they return a different value for errno
| (EINVAL? I forget.)
On traditional unix, since forever, lseek() on a terminal is simply a no-op.
(The seek() sys call that preceded it, on 6th edition and earlier was the
same.) No error, no effect -- or no useful effect, the "file offset" might
get set, so you can't even:
pos = lseek(0,somewhere,0);
if (lseek(0, pos, 0) != somewhere)
/* unseekable */
as that would probably (seem to) succeed, but terminals don't use it.