Re: OT: gas question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I Rattan wrote:

> Probably it may not be the group to ask the question.
> The following assembly code works on Linux on P4 but
> segfaults om Solaris-10 on AMD64 box. The instruction
> in question is int $0x80.

The syscall interface is highly OS-specific, you can't expect things to
be the same at this low level.  Look at sys/trap.h on Solaris and you'll
see that it uses int 0x91 for syscalls (assuming it's not configured to
use sysenter or whatnot.)  And besides, even if the interrupt number
happened to be the same there's no guarantee that the syscall numbers
are the same between the two operating systems.  If you want portability
while still mucking about at this level you need to use the C API, e.g.
syscall (SYS_exit, 0).

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux