tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lseek on tty



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 </dev/tty
$ 

On Linux, this fails.

I'm trying to think of why seeking on a terminal
would make sense.  Anybody have an idea?

-Jan


Home | Main Index | Thread Index | Old Index