This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sysdeps/unix/sysv/linux/lseek.c on ILP32 question


On Tue, 2017-02-21 at 21:45 +0100, Andreas Schwab wrote:
> On Feb 21 2017, Steve Ellcey <sellcey@caviumnetworks.com> wrote:
> 
> > 
> > OK, I see if I change:
> > 
> >   val = lseek(fd, -(sizeof(crmsg) - 1), 1);
> > 
> > to
> > 
> >   val = lseek(fd, -((off_t) sizeof(crmsg) - 1), 1);
> > 
> > I get the result I want.
> > 
> > But I am not entirely sure why, I guess it is a question of exactly
> > how
> > integer conversions are done.
> size_t is unsigned, and -size_t is still a positive value.
> 
> Andreas.

OK, thanks for the help. This is a bug in the LTP (linux test project)
sources and I submitted an issue for it.

https://github.com/linux-test-project/ltp/issues/135

Steve Ellcey
sellcey@cavium.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]