Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

intro(2) [debian man page]

INTRO(2)						     Linux Programmer's Manual							  INTRO(2)

NAME
intro - introduction to system calls DESCRIPTION
Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel. Usually, system calls are not invoked directly: instead, most system calls have corresponding C library wrapper functions which perform the steps required (e.g., trapping to kernel mode) in order to invoke the system call. Thus, making a system call looks the same as invoking a normal library func- tion. For a list of the Linux system calls, see syscalls(2). RETURN VALUE
On error, most system calls return a negative error number (i.e., the negated value of one of the constants described in errno(3)). The C library wrapper hides this detail from the caller: when a system call returns a negative value, the wrapper copies the absolute value into the errno variable, and returns -1 as the return value of the wrapper. The value returned by a successful system call depends on the call. Many system calls return 0 on success, but some can return nonzero values from a successful call. The details are described in the individual manual pages. In some cases, the programmer must define a feature test macro in order to obtain the declaration of a system call from the header file specified in the man page SYNOPSIS section. (Where required, these feature test macros must be defined before including any header files.) In such cases, the required macro is described in the man page. For further information on feature test macros, see fea- ture_test_macros(7). CONFORMING TO
Certain terms and abbreviations are used to indicate UNIX variants and standards to which calls in this section conform. See standards(7). NOTES
Calling Directly In most cases, it is unnecessary to invoke a system call directly, but there are times when the Standard C library does not implement a nice wrapper function for you. In this case, the programmer must manually invoke the system call using syscall(2). Historically, this was also possible using one of the _syscall macros described in _syscall(2). Authors and Copyright Conditions Look at the header of the manual page source for the author(s) and copyright conditions. Note that these can be different from page to page! SEE ALSO
_syscall(2), syscall(2), syscalls(2), errno(3), intro(3), capabilities(7), credentials(7), feature_test_macros(7), mq_overview(7), path_resolution(7), pipe(7), pty(7), sem_overview(7), shm_overview(7), signal(7), socket(7), standards(7), svipc(7), symlink(7), time(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-11-11 INTRO(2)

Check Out this Related Man Page

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 deduce 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. From user space, the operation of restart_syscall(2) 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
sigreturn(2), sigaction(2), signal(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2013-07-30 RESTART_SYSCALL(2)
Man Page