Questions tagged [system-calls]

Questions concerning the details of how a program uses system calls to interact with the kernel API, what calls are available, how they work etc.

A system call is how a program requests a service from an operating system's kernel.

System calls can be roughly grouped into five major categories:

  1. Process Control

    • load
    • execute
    • end, abort
    • create process (for example, fork on Unix-like systems, or NtCreateProcess in the Windows NT Native API)
    • terminate process
    • get/set process attributes
    • wait for time, wait event, signal event
    • allocate, free memory
  2. File management

    • create file, delete file
    • open, close
    • read, write, reposition
    • get/set file attributes
  3. Device Management

    • request device, release device
    • read, write, reposition
    • get/set device attributes
    • logically attach or detach devices
  4. Information Maintenance

    • get/set time or date
    • get/set system data
    • get/set process, file, or device attributes
  5. Communication

    • create, delete communication connection
    • send, receive messages
    • transfer status information
    • attach or detach remote devices

Useful links System call @ wiki

348 questions
11
votes
3 answers

Why isn't something like compound syscalls implemented?

Syscalls (system calls) cause some performance penalty due to the isolation between kernel and user space. Therefore, it sounds like a good idea to reduce syscalls. So what I thought is, that we could pack together syscalls into a single one. So,…
drahnoel
  • 333
9
votes
2 answers

Why execve and brk(NULL) are always the first two system calls?

When I try strace ping google.com or strace ls or even strace curl The first two systemcalls are always, execve("/usr/bin/curl", ["curl", "google.com"], 0x7ffecf1bc378 /* 61 vars */) = 0 brk(NULL) =…
MaverickD
  • 359
9
votes
2 answers

Execute system calls directly

Provided a user is authorized to access something, how can he execute a system call directly, like geteuid() - get effective user ID (it's just an example) from bash, how could I do it?
Pierre B
  • 2,213
7
votes
4 answers

Using System calls directly

I have a big confusion regarding the system calls in OS. According to the book "operating systems concepts 9th ", it is mentioned (in page 63) that : Most programmers never see this level of detail, however. Typically, application developers design…
AAA
  • 207
3
votes
1 answer

What could be a cause for getdents returning different results on 2 systems?

I have a weird situation that on one server I am getting following results: vagrant@shopping:/vagrant/deployer-example$ uname -a Linux shopping 4.19.0-0.bpo.9-amd64 #1 SMP Debian 4.19.118-2+deb10u1~bpo9+1 (2020-06-09) x86_64 GNU/Linux …
gadelat
  • 505
2
votes
0 answers

System Call Rosetta Stone?

After seeing this remarkable reference (A Sysadmin's Unixersal Translator (ROSETTA STONE)) for sysadmins going between Unix systems, it made me wonder if anyone has put together such a similar reference for system calls between the many and various…
2
votes
1 answer

List the system calls used in an application

Is there any way to get a list of all system calls used in an application without running through all possible scenarios in the app?
UVV
  • 3,068
1
vote
1 answer

What is a channel?

http://www.di.uevora.pt/~lmr/syscalls.html In that reference about system calls, appears a function called dup(). It is said that it duplicates channels. Then my question is, what is a channel?
J L
  • 125
1
vote
1 answer

Implicit system calls in UNIX commands

I've been studying UNIX and system calls and I came across a low-level and tricky questions. The question asks what system calls are called for this command: grep word1 word2 > file.txt I did some research and I was unable to find a huge number of…
q.Then
  • 113
1
vote
1 answer

How to find the numbers of system calls?

Are the numbers for the system calls for every machine different? Does it depend on the processor, I mean will there be a difference for i586 and i386? If they are different for every machine, how can you find out the numbers for your machine? One…
Joey
  • 342
  • 5
  • 13
0
votes
1 answer

Which System Call provides an interface for sending messages to devices?

Question is above. I've looked through the man pages, but they are somewhat unclear on the topic. I'm not sure if I'm looking for sendmsg() or msgsend() or if I'm looking for something totally different
0
votes
1 answer

How find out through terminal that if any system command uses specific system call internally?

I am new to linux.I want to that how to find out through terminal that if any system command uses specific system call internally? Suppose hard linking is to be performed . So "ln" command uses li nk() system call internally. Likewise rm command…
sagar
  • 101
0
votes
2 answers

Kernel mode to user mode interrupt disabling

I read that RFE (return from exception) is a privileged instruction which helps to transition from kernel to user mode. As it is a privileged instruction, a software interrupt(trap) will be generated during it's execution. I want to know whether all…
Zephyr
  • 183
0
votes
1 answer

Table or list of system call failure modes?

I am wondering if there is a table or list of system call failure modes. A few examples: Can exit() fail due to the system being out of memory? Can open() fail due to the system reaching the max open files limit? Can system calls simply time out?…
cat pants
  • 435
-1
votes
2 answers

Importance of knowing if a standard library function is executing a system call

Is it actually important for a programmer to know if the standard library function he/she is using is actually executing a system call? If so, why? Intuitively I'm guessing the only importance is in knowing if the general standard function is a…
Jon Gan
  • 101