Skip site navigation (1)Skip section navigation (2)
Date:      01 Apr 1998 07:40:56 -0600
From:      Dave Marquardt <marquard@zilker.net>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/6184: No error if resulting file pos in lseek is negative
Message-ID:  <85wwd9d5hz.fsf@localhost.zilker.net>
In-Reply-To: Kent Boortz's message of "Tue, 31 Mar 1998 17:40:17 %2B0200 (CEST)"
References:  <199803311540.RAA18108@scotch.du.etx.ericsson.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Kent Boortz <kent@erix.ericsson.se> writes:
> >Number:         6184
> >Category:       kern
> >Synopsis:       No error if resulting file pos in lseek is negative
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       low
> >Responsible:    freebsd-bugs
> >State:          open
> >Quarter:
> >Keywords:
> >Date-Required:
> >Class:          sw-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Tue Mar 31 07:50:02 PST 1998
> >Last-Modified:
> >Originator:
> >Organization:
> Ericsson Software Technology
> >Release:        FreeBSD 2.2.5-STABLE i386
> >Environment:
>  
> >Description:
>  
> In FreeBSD 2.2.5 lseek moves the file position without any error
> checks. If the resulting position is negative we have the problem that
> the result value -1 can mean two things, that there was an error or
> that the file position was set to -1 and no error. We have to clear
> errno before the call and examine errno after the call to find out if
> there was an error or not.
>  
> If the resulting position is negative, Linux and Solaris will
> preserve the file position before the call to lseek and return an
> error.
>  
> Is this a bug in FreeBSD or a different interpretations of the POSIX
> standard?

I think this isn't an error until you actually try to read or write at
that negative. offset.  Then you have an error.

-Dave

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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