Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"int $0x80" still works for backwards compatibility, but it's not been used for making syscalls from modern code for many many years.


oh? on a recent glibc:

  $ objdump -D /lib/libc.so.6 | grep 'int[[:space:]]*$0x80' | wc -l
  447
what were you thinking they used instead? sysenter? iirc, this turns out to be slower than "int $0x80."


I was also trying to be Intel/AMD ISA independent. The Intel is SYSENTER, the AMD is SYSCALL. He's right though, I probably would have used SYSENTER in production code. You probably want to use int $0x80 in shellcode, though (fewer save registers).


On i386 perhaps, but on modern 64 bit machines like the one in the example code above it'll be using sysenter or another method.

$ objdump -D /lib64/libc.so.6 | grep 'int[[:space:]]+$0x80' | wc -l

0




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: