What is the purpose of _dl_sysinfo_int80?

I mean, why not issue the statement int

directly?

Dump of assembler code for function execve:
   [omitted]
   0x0806c282 <+18>:    call   *0x80e99f0
   [omitted]
End of assembler dump.
(gdb) disas *0x80e99f0
Dump of assembler code for function _dl_sysinfo_int80:
   0x0806ed70 <+0>: int    $0x80
   0x0806ed72 <+2>: ret    
End of assembler dump.

      

From my inexperienced point of view, it _dl_sysinfo_int80

adds nothing but overhead.

+3


source to share


1 answer


There are various ways to make a system call. The oldest and slowest is int 0x80

. The advantage is that it works on all systems. Intel later provided sysenter

and amd provided instructions syscall

. Unfortunately, they are incompatible and only work with some features. A level of indirection has been added so that the best implementation can be used. The kernel typically provides the login code displayed in each process (part of the vDSO). As far as I can tell, _dl_sysinfo_int80

just used as a backup when the code provided by the kernel is not available for some reason.



+4


source







All Articles