RE: using function names of syscalls

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

 



Hi,

I would like to know what should I do to use function
names into my programs. I'm able only to use the
function syscall(<syscall number>) in my programs.

Thanks

Hi,
System calls do not work that way. The system calls are very much architecture dependent. So, each architecture has its own implementation. so, syscallx is put in asm folder.


In x86, int instruction is used for system call with syscall number in EAX. So, when you call int 0x80(linux syscall number). Processor searches IDT vector in IDTR register. searchs index no 0x80. There it finds entry point for syscall and the selector. so, it jumps to that entry point.

So, you cant simply use mycall() because it is just a call instruction to the address.

similarly in PowerPC you have an sc instruction for system call and syscall number is put in r0.

regards manish

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux