Tag Info

New answers tagged


To open a file, you use a construct like the following: int fd; if ((fd = open(path, flags)) < 0) { /* An error occurred, the reason is in errno */ int _errno = errno; /* Save errno value */ fprintf(stderr, "Failed opening file '%s': %s\n", path, strerror(_errno)); return; } /* The file was successfully opened */ So, you have only one ...


library call - invokes a subroutine linked into application (via including or adding library). system call - transfers control to OS ( user->system proc-> OS), and puts the processor in privileged mode


All answers are fine. If you are looking for a specific System Call name : $ cat /proc/kallsyms | grep <sys_call_name> If you are looking for list of all System Calls : $ cat /proc/kallsyms


The file /proc/kallsyms lists all the symbols of the running kernel. By convention, system calls have a name that begin with sys_. On a 64-bit system, system calls for 32-bit programs have a name that begin with sys32_. Strictly speaking, this lists internal kernel functions, not system call, but I think that the correspondence does work (every system call ...


TL;DR I kept finding new alternatives when writing this answer, so I just wrote a bit of details about each of them, and made some stats. Basically, you can either: Read Gilles' answer, which provides a clean and fast way to do it (relies on /proc). Use the documentation resources. Use your system's C header files. Use the kernel source code itself. Use ...

Top 50 recent answers are included