Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Sep 2004 12:18:16 +0900
From:      Jun Kuriyama <kuriyama@imgsrc.co.jp>
To:        arch@FreeBSD.org
Subject:   stderr is seekable? (lseek(2))
Message-ID:  <7macvto7wn.wl@black.imgsrc.co.jp>

next in thread | raw e-mail | index | archive | help

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@imgsrc.co.jp> // IMG SRC, Inc.
             <kuriyama@FreeBSD.org> // FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7macvto7wn.wl>