stderr is seekable? (lseek(2))

Jun Kuriyama kuriyama at imgsrc.co.jp
Mon Sep 13 20:18:19 PDT 2004


When I tested this program, it finished successfully.  But on Linux,
lseek(2) returns -1 and errno is ESPIPE.

I expected to be returned ESPIPE as Linux did.  Is our behavior
correct, or there is something wrong?

-----
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>

int
main(int argc, char **argv)
{
  off_t r = lseek(2, 1, SEEK_CUR);
  printf("r=%d\n", r);
  if (r == -1) {
    printf("errno=%d, %s\n", errno, strerror(errno));
  }
  return 0;
}
-----


-- 
Jun Kuriyama <kuriyama at imgsrc.co.jp> // IMG SRC, Inc.
             <kuriyama at FreeBSD.org> // FreeBSD Project


More information about the freebsd-arch mailing list