Visit The New, Modern Unix Linux Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #625
Difficulty: Medium
Functions are defined using the defineFunction reserved keyword in Python.
True or False?
Linux & Unix Commands - Search Man Pages

intro(2) [linux 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), errno(3), feature_test_macros(7), standards(7) COLOPHON
This page is part of release 3.27 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-09-10 INTRO(2)

Check Out this Related Man Page

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

NAME
io_destroy - destroy an asynchronous I/O context SYNOPSIS
#include <linux/aio_abi.h> /* Defines needed types */ int io_destroy(aio_context_t ctx_id); Note: There is no glibc wrapper for this system call; see NOTES. DESCRIPTION
The io_destroy() system call will attempt to cancel all outstanding asynchronous I/O operations against ctx_id, will block on the comple- tion of all operations that could not be canceled, and will destroy the ctx_id. RETURN VALUE
On success, io_destroy() returns 0. For the failure return, see NOTES. ERRORS
EFAULT The context pointed to is invalid. EINVAL The AIO context specified by ctx_id is invalid. ENOSYS io_destroy() is not implemented on this architecture. VERSIONS
The asynchronous I/O system calls first appeared in Linux 2.5. CONFORMING TO
io_destroy() is Linux-specific and should not be used in programs that are intended to be portable. NOTES
Glibc does not provide a wrapper function for this system call. You could invoke it using syscall(2). But instead, you probably want to use the io_destroy() wrapper function provided by libaio. Note that the libaio wrapper function uses a different type (io_context_t) for the ctx_id argument. Note also that the libaio wrapper does not follow the usual C library conventions for indicating errors: on error it returns a negated error number (the negative of one of the values listed in ERRORS). If the system call is invoked via syscall(2), then the return value follows the usual conventions for indicating an error: -1, with errno set to a (positive) value that indicates the error. SEE ALSO
io_cancel(2), io_getevents(2), io_setup(2), io_submit(2), aio(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 IO_DESTROY(2)

Featured Tech Videos