Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2004 20:31:10 -0700 (PDT)
From:      Doug White <dwhite@gumbysoft.com>
To:        Jun Kuriyama <kuriyama@imgsrc.co.jp>
Cc:        arch@FreeBSD.org
Subject:   Re: stderr is seekable? (lseek(2))
Message-ID:  <20040913203044.X34536@carver.gumbysoft.com>
In-Reply-To: <7macvto7wn.wl@black.imgsrc.co.jp>
References:  <7macvto7wn.wl@black.imgsrc.co.jp>

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

On Tue, 14 Sep 2004, Jun Kuriyama wrote:

>
> 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?

You might poke -standards about this, someone there probably has a copy
of POSIX and can see waht the required behavior is.

I'm inclined to call this a "bonus feature" on our part :)

>
> -----
> #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;
> }
> -----
>
>
>

-- 
Doug White                    |  FreeBSD: The Power to Serve
dwhite@gumbysoft.com          |  www.FreeBSD.org



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