Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
2answers
640 views

select(2) on FIFO on macOS

On Linux the included program returns from select and exits: $ gcc -Wall -Wextra select_test.c -o select_test $ ./select_test reading from read end closing write end first read returned 0 second read ...
0
votes
2answers
65 views

Where does a blocking system call show up in CPU readings?

Of the user, system, and idle readings provided by "top", which would reflect the time spent in a blocking system call? I have read that blocking disk i/o calls are reflected as idle time, but not so ...
2
votes
1answer
250 views

Non blocking system call and mode switch

Suppose we invoke a system call for asynchronous IO. At the time of invoking system call, the mode changes from user mode to kernel mode . After invocation, the mode should immediately change back to ...
2
votes
1answer
417 views

Is there a system call to bind a file descriptor directly into another?

A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious
1
vote
1answer
3k views

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 ...
1
vote
1answer
121 views

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 ...
1
vote
1answer
399 views

Capture information of system-call

I have a QEMU-KVM hypervisor (ubuntu) with several VMs. What I want to do is capture all information of VMs system call to hypervisor (without any intervention to VM whatsoever) in real time within a ...
0
votes
1answer
293 views

Why could a call to `getaddrinfo()` fail with `EAI_SYSTEM` and errno set to `EBUSY` (“Device or resource busy”)?

I'm seeing this error when running apt update in containers, if that is useful information. apt spits out: System error resolving 'archive.ubuntu.com:80' - getaddrinfo (16: Device or resource busy) ...
0
votes
1answer
441 views

Does hypercall take the same time as a linux system call?

From Xen website, A hypercall is to a syscall what a hypervisor is to an OS. Alternatively, a hypercall is to a hypervisor what a syscall is to a kernel. A hypercall is a software trap from a ...
-8
votes
1answer
96 views

How can we tell if a signal can interrupt the execution of a system call?

From The Linux Programming Interface a signal is delivered at one of the following times: when the process is rescheduled after it earlier timed out (i.e., at the start of a time slice); or ...
3
votes
0answers
370 views

Documentation on Device Mapper ioctls?

In the Red Hat documentation on Device Mapper, it reads: "the application interface to the Device Mapper is the ioctl system call." So far, I understand that the ioctls are sent to /dev/mapper/...
2
votes
0answers
102 views

How do I make my own Linux system call output to the process's terminal instead of to the kernel log?

I wrote a system call that outputs system information to the kernel log. Here is an example program that invokes my system call. #include <stdio.h> #include <linux/unistd.h> int main() { ...
2
votes
0answers
94 views

Time lost as pselect system call returns from kernel?

Background: I am using a pselect system call in user-space code to wait on a GPIO pin to toggle. I know that it should take no more than 5 milliseconds for this toggle to occur, and I've verified ...
2
votes
0answers
130 views

Difference between syscalls and raw_syscalls events?

AFAIK different linux tracing tools gather information from /sys/kernel/debug/tracing/events directory where different events are logged. Can anyone explain the difference between "syscalls" event and ...
2
votes
0answers
256 views

What hardware support is needed for linux to do `gettimeofday` / `clock_gettime` in userspace using `hped`?

On reasonably modern systems Linux can service "system" calls like gettimeofday and clock_gettime entirely in userspace through the linux-vdso.so (or linux-gate.so) virtual library, so it does not ...
1
vote
0answers
396 views

Shell command on terminal vs system() call

I am using NMAP for port scanning on a host. When I run the following command on terminal, it gives the results within a minute most of the times. $ nmap -p 1-65535 10.180.5.237 | awk --posix '{ ...
1
vote
0answers
371 views

Which aspect of simple system call (getTimeOfDay) to Linux Kernel is most expensive in terms of required CPU time?

Is it entering and exiting the Kernel? or executing the actual system routine to determine the time, or is it making the function call, or is it storing the system call's returned value?
1
vote
0answers
111 views

auditd misses execution on some commands

I've placed an auditd rule on the jcmd command as follows: auditctl -w /usr/bin/jcmd -p x -k jvm_debug However, when I execute it, it writes nothing to log. Looking at guides and previous questions ...
1
vote
0answers
144 views

code generating /proc file system

In my assignment, I have added "casper" flag to task descriptor and it takes only 0, 1, 2 and 3 (default 0). I asked to "modify the code that generates the /proc filesystem so that its behavior is ...
1
vote
0answers
366 views

Which Unixes support cross-device filesystem links (in particular for rename)?

Just read the following on the FreeBSD man page for the rename syscall: ... [EXDEV] The link named by to and the file named by from are on different logical devices (file systems). Note that ...
0
votes
0answers
81 views

execve(2) not launching system commands

I am trying to implement a container, and for that I create a process using the clone(2) system call with the appropriate flags: if ((child_pid = clone(child_main, process_struct.Stack + ...
0
votes
0answers
56 views

system call to peek next byte from serial port

have a program that does an open() on /dev/ttyACM0. I know how to get bytes available using ioctl(), but I want to know what is the next available byte's value, without grabbing it. (A peek). Is by ...
0
votes
0answers
353 views

Intercept GNU/Linux system calls

Context I am trying to design a tool that would more or less automatically generate a Makefile from a standard shell script. The idea would be that for each command executed by the script: I ...
0
votes
0answers
255 views

Find system idle time using any system call in microseconds

For the perf analysis and to make decision based on system and app performance I need to find the idle time of system. I want the precise value in microseconds. I know that I can get the value in ...
0
votes
0answers
113 views

Are system calls available in a chroot environment?

I'm experiencing a lot of compilation errors regarding missing system calls (e.g. error: '__NR_name_to_handle_at' undeclared (first use in this function)) with different projects (ganesha 2.1.0 (https:...
0
votes
0answers
612 views

Tracing system call on Ubuntu 12.04

The main task I have to carry out, is to trace the system call of processes in ubuntu 12.04 LTS. Problem is, I am unable to trace them continuously, i.e. as soon as they are added to the system, they ...