thanks  rajat,<br>and of course mulyadi , sorry for the confusion.<br>@ mulyadi : u got me right as u always do. :)<br>except system dependencies is there anything which should be taken care of before implementing this  task??<br>
<br><div class="gmail_quote">On Tue, Jan 11, 2011 at 3:40 PM, Rajat Sharma <span dir="ltr">&lt;<a href="mailto:fs.rajat@gmail.com">fs.rajat@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">&gt; is there any procedure in kernel to check for the interrupt vector number which caused it to be invoked?<br>
</div>Its actually very architecture dependent, on x86, its &#39;int $0x80&#39;<br>
which causes user space to call system calls handlers. Recent intel<br>
architectures have callgate mechanism to enter into system call, look<br>
for sysenter instruction.<br>
Anyways, are you interested in interrupt number or the system call number?<br>
<div class="im"><br>
&gt; i mean like one of my friends said that when  kernel is about to restart a<br>
&gt; syscall then it raises signal -ERESTARTSYS signal for signal handler.<br>
<br>
</div>Thats totally wrong. Like any other error code, its just an error code<br>
which waiting API return if process was interrupted while waiting on<br>
semaphore, e.g.<br>
<br>
rc = wait_event_inetrruptible(..);<br>
if (rc == -ERESTARTSYS) {<br>
    /*<br>
     * your driver should take corrective measure, may be to retry the<br>
code path again,<br>
     * or do some error recovery and send appropriate error code to user space.<br>
     * Note that conventionally -ERESTARTSYS should never be returned<br>
to user space<br>
     */<br>
}<br>
<br>
Although name is misleading, its an internal kernel error and is not<br>
at all related to system call restart.<br>
<br>
Rajat<br>
<div><div></div><div class="h5"><br>
On Tue, Jan 11, 2011 at 1:09 PM, Mulyadi Santosa<br>
&lt;<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>&gt; wrote:<br>
&gt; just to avoid confusion 1st...<br>
&gt;<br>
&gt; On Tue, Jan 11, 2011 at 14:06, mohit verma &lt;<a href="mailto:mohit89mlnc@gmail.com">mohit89mlnc@gmail.com</a>&gt; wrote:<br>
&gt;&gt; i mean like one of my friends said that when  kernel is about to restart a<br>
&gt;&gt; syscall then it raises signal -ERESTARTSYS signal for signal handler. but i<br>
&gt;&gt; think it is for<br>
&gt;&gt; something went wrong and kernel wanna start the syscall again. but in<br>
&gt;&gt; between a syscall  routine is it possible to get vector number (i repeat<br>
&gt;&gt; ,sorry) ??<br>
&gt;<br>
&gt; allow me to rephrase it: if an interrupt crosses by during the<br>
&gt; execution of that code path, you wanna find out the interrupt number?<br>
&gt;<br>
&gt; --<br>
&gt; regards,<br>
&gt;<br>
&gt; Mulyadi Santosa<br>
&gt; Freelance Linux trainer and consultant<br>
&gt;<br>
&gt; blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
&gt; training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Kernelnewbies mailing list<br>
&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
&gt;<br>
</blockquote></div><br><br clear="all"><br>-- <br>........................<div><i>MOHIT VERMA</i></div><br>