On Mon, Sep 18, 2023 at 04:20:28PM -0400, Jan Schaumann wrote:
> I'm trying to think of why seeking on a terminal
> would make sense. Anybody have an idea?
Somebody at a historical GUUG or EUUUG* meeting told the story of a
student at his work Uni who had did the mainframe equivalent of
lseek(
>>> On NetBSD and macOS, lseek(2) on a tty succeeds:
>>> if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1 )
>> Some devices are incapable of seeking. The value of the
>> pointer associated with such a device is undefined.
>> So I'm guessing it depends on whether you think of adding s
Mouse wrote:
> > On NetBSD and macOS, lseek(2) on a tty succeeds:
>
> > if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1 )
>
> > On Linux, this fails.
>
> > I'm trying to think of why seeking on a terminal would make sense.
> > Anybody have an idea?
>
> Quoting from lseek(2) on a handy machi
On Mon, Sep 18, 2023 at 04:20:28PM -0400, Jan Schaumann wrote:
> On NetBSD and macOS, lseek(2) on a tty succeeds:
> On Linux, this fails.
>
> I'm trying to think of why seeking on a terminal
> would make sense. Anybody have an idea?
This is historical UNIX behaviour ‒
the file offset is modified,
> On NetBSD and macOS, lseek(2) on a tty succeeds:
> if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1 )
> On Linux, this fails.
> I'm trying to think of why seeking on a terminal would make sense.
> Anybody have an idea?
Quoting from lseek(2) on a handy machine:
Some devices are inca
Hi,
On NetBSD and macOS, lseek(2) on a tty succeeds:
int main() {
if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1 )
fprintf(stderr, "cannot seek\n");
}
$ ./a.out