Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jun 2001 08:49:15 +0800 (CST)
From:      Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
To:        John Polstra <jdp@polstra.com>
Cc:        <stable@freebsd.org>
Subject:   Re: lseek(SEEK_END) then read()... bug of feature?
Message-ID:  <Pine.BSF.4.33.0106290847460.79626-100000@www.mmlab.cse.yzu.edu.tw>
In-Reply-To: <200106281452.f5SEqxf93857@vashon.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Jun 2001, John Polstra wrote:
[...]
> > 	off_t		offset;
> > 	int		ret, fd = open("/kernel", O_RDONLY);
> >
> > 	offset = 0 - sizeof(int);
>
> Due to C's type promotion rules, this assigns the value 4294967292
> to "offset".  Change it to this:
>
>   	offset = (off_t)0 - sizeof(int);
>
> and your program works fine.
>
Ah, that did the trick! Thanks a lot for your information.


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.33.0106290847460.79626-100000>