lkml.org 
[lkml]   [1996]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: test version of 2.1.0 available
From
Date
Linus Torvalds <torvalds@cs.helsinki.fi> writes:

> Instead of testing the sign bit, the low-level system call should
> probably do something like this:
>
> ... do system call, return in %eax ...
> movl %eax,%edx
> addl $4095,%edx
> jc error error if return was -1 .. -4095

If you're only testing the carry flag with the "jc" instruction and
not using it later, use this instead. Remember "jae" is unsigned, and
-4095 is a huge unsigned number:

cmpl $-4095,%eax
jae error

Or in C:

if ((unsigned) eax >= (unsigned)-4095) {
goto error;
}
Tom.

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.163 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site