Hi Rajat, On Tue, Jan 11, 2011 at 2:10 AM, Rajat Sharma <fs.rajat@gmail.com> wrote:
is there any procedure in kernel to check for the interrupt vector number which caused it to be invoked? Its actually very architecture dependent, on x86, its 'int $0x80' which causes user space to call system calls handlers. Recent intel architectures have callgate mechanism to enter into system call, look for sysenter instruction. Anyways, are you interested in interrupt number or the system call number?
i mean like one of my friends said that when kernel is about to restart a syscall then it raises signal -ERESTARTSYS signal for signal handler.
Thats totally wrong. Like any other error code, its just an error code which waiting API return if process was interrupted while waiting on semaphore, e.g.
On the ARM platform, at least, if a syscall (like ioctl) returns -ERESTARTSYS, then the ioctl will be reissued after the signal handler runs. I know this to be true, as I've verified it's functionality emperically. This is further supported by the kernel documentation http://lxr.linux.no/linux+v2.6.37/Documentation/DocBook/kernel-hacking.tmpl#... Dave Hylands