Sponsored Content
Top Forums UNIX for Advanced & Expert Users Handling Signals in System Calls Post 302761659 by rupeshkp728 on Saturday 26th of January 2013 10:37:22 AM
Old 01-26-2013
Handling Signals in System Calls

What will happen if signal comes while a system call is being executed?
How it will be handled?
 

10 More Discussions You Might Find Interesting

1. Programming

handling-create new SIGNALS

Hi, i cannot find in which file and function the signals are handled by default.Can anyone help me? How can i create a 33th signal? Thanks (3 Replies)
Discussion started by: Panos
3 Replies

2. UNIX for Dummies Questions & Answers

System Calls

What does the system call "dup" do? What is the difference between dup and dup2 I have a fair idea of what it does but I am confused when its coming down to the exact details... Please help me!:confused: (2 Replies)
Discussion started by: clickonline1
2 Replies

3. UNIX for Dummies Questions & Answers

System calls for cp and mv

Which system calls are made for operations cp and mv (2 Replies)
Discussion started by: gaurava99
2 Replies

4. Programming

System calls

why user is not able to switch from user to kernel mode by writing the function whose code is identical to system call. (1 Reply)
Discussion started by: joshighanshyam
1 Replies

5. Shell Programming and Scripting

Gen. Question - Script calls multiple programs - Return Code Handling?

General Question: If a script calls multiple external programs (external to the script, but still on unix), where do the return codes go? Let's say one of external programs fails, does the entire script fail and send a non-zero return code to the job scheduling software, or is the return code sent... (1 Reply)
Discussion started by: jnanasakti
1 Replies

6. UNIX for Dummies Questions & Answers

About system calls.

Hi all, I am new here . I want to know about system call in detail. As system calls are also function .How system identifies it.:) (2 Replies)
Discussion started by: vishwasrao
2 Replies

7. UNIX for Advanced & Expert Users

Ignored signals & blocking system calls

If I explicity ignore a signal (for example, SIGALRM), and this signal is generated during a blocking system call (for example, a recvfrom() ), what happens to the system call? Does it abort, or does it remain blocked until its end? (2 Replies)
Discussion started by: hurricane
2 Replies

8. UNIX for Dummies Questions & Answers

handling signals without race conditions

Greetings, I am writing a small program in C on UNIX, in which I am using (POSIX reliable) signals. 1. Suppose I have a signal : SIGX, and the corresponding signal handler : sigx_handler. It is possible to receive SIGX in my process, and, while executing sigx_handler, to receive again... (0 Replies)
Discussion started by: aigoia
0 Replies

9. AIX

How to create core through program at the time of crash by handling signals?

I am in process of writing a library which can make any application of my product capable of creating core in the application's log folder with a product friendly core file name programatically. In my library I am registering for certain signals e.g. SIGILL, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGABRT... (1 Reply)
Discussion started by: rajeev_ks
1 Replies

10. Solaris

How to create core through program at the time of crash by handling signals?

I am in process of writing a library which can make any application of my product capable of creating core in the application's log folder with a product friendly core file name programatically. In my library I am registering for certain signals e.g. SIGILL, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGABRT... (5 Replies)
Discussion started by: rajeev_ks
5 Replies
RESTART_SYSCALL(2)					     Linux Programmer's Manual						RESTART_SYSCALL(2)

NAME
restart_syscall - restart a system call after interruption by a stop signal SYNOPSIS
int restart_syscall(void); Note: There is no glibc wrapper for this system call; see NOTES. DESCRIPTION
The restart_syscall() system call is used to restart certain system calls after a process that was stopped by a signal (e.g., SIGSTOP or SIGTSTP) is later resumed after receiving a SIGCONT signal. This system call is designed only for internal use by the kernel. restart_syscall() is used for restarting only those system calls that, when restarted, should adjust their time-related parameters--namely poll(2) (since Linux 2.6.24), nanosleep(2) (since Linux 2.6), clock_nanosleep(2) (since Linux 2.6), and futex(2), when employed with the FUTEX_WAIT (since Linux 2.6.22) and FUTEX_WAIT_BITSET (since Linux 2.6.31) operations. restart_syscall() restarts the interrupted system call with a time argument that is suitably adjusted to account for the time that has already elapsed (including the time where the process was stopped by a signal). Without the restart_syscall() mechanism, restarting these system calls would not correctly deduct the already elapsed time when the process continued execution. RETURN VALUE
The return value of restart_syscall() is the return value of whatever system call is being restarted. ERRORS
errno is set as per the errors for whatever system call is being restarted by restart_syscall(). VERSIONS
The restart_syscall() system call is present since Linux 2.6. CONFORMING TO
This system call is Linux-specific. NOTES
There is no glibc wrapper for this system call, because it is intended for use only by the kernel and should never be called by applica- tions. The kernel uses restart_syscall() to ensure that when a system call is restarted after a process has been stopped by a signal and then resumed by SIGCONT, then the time that the process spent in the stopped state is counted against the timeout interval specified in the original system call. In the case of system calls that take a timeout argument and automatically restart after a stop signal plus SIGCONT, but which do not have the restart_syscall() mechanism built in, then, after the process resumes execution, the time that the process spent in the stop state is not counted against the timeout value. Notable examples of system calls that suffer this problem are ppoll(2), select(2), and pselect(2). From user space, the operation of restart_syscall() is largely invisible: to the process that made the system call that is restarted, it appears as though that system call executed and returned in the usual fashion. SEE ALSO
sigaction(2), sigreturn(2), signal(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 RESTART_SYSCALL(2)
All times are GMT -4. The time now is 02:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy