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.

learn more… | top users | synonyms

1
vote
1answer
40 views

How can a file descriptor be reclaimed and reused later?

In context of C and C++, is the close() system call the only way for kernel to reclaim the fd and reuse it later when calling open() in the same process lifetime? What about multi-threaded programs?
0
votes
0answers
7 views

How is kstkesp determined for each process? [migrated]

I'm working on a tool that sometimes hijacks application execution, including working in a different stack. I'm trying to get the kernel to always see the application stack when performing certain ...
2
votes
2answers
48 views

Is there any Syscall table just like Interrupt Table?

Are the system calls like fork(), exit() saved in some kind of function pointer table , just like the Interrupt Descriptor Table ? where does my OS go when I call my fork() or exit() ? I guess this ...
1
vote
2answers
46 views

What are unimplemented system calls?

I was revising Linux system calls. I found that a few calls are unimplemented system calls. For example: afs_syscall. I don't understand why they are included in man pages if they are not yet ...
1
vote
1answer
70 views

Relation between system calls and shell commands/utilities

In POSIX, Does a system call function often but not always have a command or utility in shell? Is there some rule of thumb about what kinds of system calls have corresponding commands or utilities ...
0
votes
1answer
54 views

Is the PTTY inside the Kernel or Userspace?

I read, that drivers are a way to expand the Kernels abilities to communicate with hardware devices, since there are so many and will be even more the Kernel has to be expandable. In order to ...
0
votes
0answers
15 views

using man command for a system call close [duplicate]

So if we have an executable program called close on linux, and theres also a system call close. How can i generate a command that makes sure i get the manual for the system call "close" rather than ...
1
vote
3answers
112 views

What is the reason for having numbers within the brackets of a function ? [duplicate]

I have seen on many occasions a name of a function (frankly speaking I just call it function because of it typical appearance, they are though sometimes named commands or system calls but I do not ...
0
votes
1answer
98 views

Few questions about system calls and kernel modules (kernel services in parallel)

I have few questions about system calls and kernel modules. Let's assume we have two applications (A and B) and each of them is running on a different core. (A-CPU 0, B-CPU 1) When two applications ...
0
votes
2answers
85 views

do processes access cpu and memory by system calls to the kernel?

If I am correct, processes access devices by system calls to the kernel. CPU and memory are also devices. when a process starts to run, does it get cpu and memory by system calls to the kernel? ...
1
vote
1answer
48 views

How do I get linux-gate.dso on a newer linux system?

I would like to find out which method my 32bit QEMU guest is using for system calls. There's an excellent article explaining linux-gate.dso (http://www.trilithium.com/johan/2005/08/linux-gate/). ...
1
vote
2answers
111 views

Is system call the only way that a user program can intentionally affect the state of a Linux kernel?

I think there are several ways that a user program can intentionally affect the state of a Linux kernel. By invoking a system call; By invoking mmap() and writing the memory that has been mapped to ...
6
votes
1answer
236 views

Some basic questions about Linux kernel's security [closed]

I don't know much about Linux kernel, and I have some questions. What is the main purpose of separating kernel memory from user-space memory? To make sure that a user application cannot do anything ...
1
vote
1answer
176 views

open() return new file descriptor posix [closed]

I have to set the return values for open() in posix. How do I return "the new file descriptor" as it is said in the Linux man pages: RETURN VALUE open(), openat(), and creat() return the new ...
4
votes
3answers
419 views

System calls supported in running Kernel

Is there a way to get the number of or list of system calls supported by currently running Linux Kernel? So I want to find a way to 'read' the syscall table of a running kernel.
2
votes
1answer
178 views

Strace Hello World program

So I am trying to understand systemcalls with the following "Hello World!" program: #include <stdio.h> int main(){ printf("Hello World!\n"); return 0; } and then I run strace on the ...
2
votes
1answer
93 views

How to log all the system calls made by a program, say chrome, using linux auditing?

autrace can log the system calls made by a program by running it. I want to log the system calls of already running programs. It can be done by finding the process id, but is there any other elegant ...
0
votes
1answer
145 views

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?
1
vote
1answer
38 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 ...
0
votes
0answers
55 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 ...
7
votes
1answer
293 views

Why are rmdir and unlink two separate system calls?

Here's something that kept me wondering for a while: [15:40:50][/tmp]$ mkdir a [15:40:52][/tmp]$ strace rmdir a execve("/usr/bin/rmdir", ["rmdir", "a"], [/* 78 vars */]) = 0 brk(0) ...
2
votes
1answer
84 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
7
votes
2answers
1k views

Which is more efficient, ls or ls -l?

As I understand, the ls command calls getdents, which returns up to x number of directory entries. Are there any other system calls involved? If I run ls -l, are there any more system calls? I am ...
2
votes
1answer
412 views

What is the use of “magic arguments” in Linux reboot system call?

As I was reading Linux source code, and more specifically the system calls code, I came across sys_reboot implementation: http://lxr.free-electrons.com/source/kernel/reboot.c#L199. 199 ...
2
votes
2answers
224 views

Low level system call [closed]

C provides library functions such as write(),read().. for system calls.How to make a system call without using any library in linux in C ?
0
votes
3answers
1k views

System calls source code

C library provides functions such as write(),read(),open()...that we can use in our C program to make system calls. where can I find source code for these functions?
1
vote
1answer
79 views

System calls in linux

Generally, systems provide a library or API that sits between normal programs and the operating system. On Unix-like systems, that API is usually part of an implementation of the C library (libc), ...
0
votes
1answer
156 views

Process's father after setpgid(0,0);

I have a process P1 (child of some parent process P0) both in the same process group. P1 somewhere in his code runs: setpgid(0,0); then a new process group is created (where the group leader is P1). ...
3
votes
1answer
119 views

Get device with major number 0 (btrfs subvolume)

When I stat a file on a btrfs subvolume I get a major device number of 0. Is there a reliable way to find the mount point of this device, without knowing in advance it is a btrfs subvolume? e.g. I'd ...
1
vote
1answer
102 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 ...
11
votes
5answers
2k views

What is meant by “a system call” if not the implementation in the programing language?

I would like to understand the term "system call". I am familiar that system calls are used to get kernel services from a userspace application. The part i need clarification with is the difference ...
2
votes
2answers
335 views

Are system calls the only way to interact with the Linux kernel from user land?

Are there any other interfaces, e.g. the /proc filesystem?
1
vote
1answer
687 views

Too Much System Time

I have observed that when running CESM (a weather modeling application), the top command shows a great deal of time is spent on system calls, about 25% to 60%, and only 40% to 75% is used in user ...
3
votes
1answer
58 views

Result from kernel returned to what process?

When a process requires actions that require kernel mode, it uses a system call. So, how are the results returned to the process?
2
votes
3answers
202 views

In what shared library is read()?

I'm a Linux rookie and want to know where the system call read() is. Which shared library is linked when I call read()?
1
vote
2answers
156 views

How to notice log file changes with Linux standard tools? [duplicate]

I need something that does not need to be installed. It's on an embedded system with very little space on the HD. I can't instal anything. I need to do it with something that is already included. I ...
3
votes
3answers
194 views

API with no system calls

The book 'Understanding Linux Kernel' says that 'for something abstract such as math functions, there may be no reason to make system calls'. Can any one please explain how is a system call not ...
0
votes
1answer
672 views

Occasional error from bash on AIX: Interrupted system call

I am experiencing problems with process substitution in bash on AIX It happens very rarely, apparently only when the server is loaded. An example error message is: line 9: /tmp//sh-np-7841523: ...
1
vote
1answer
216 views

what is a Kernel? [closed]

I'm learning Unix from the Unix Architecture book by Maurice J Bach. So if my question seems too stupid, please do bear with it. I read a few related questions but I would like a more simple ...
1
vote
0answers
101 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 ...
1
vote
1answer
111 views

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?
0
votes
1answer
54 views

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

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 ...
21
votes
2answers
3k views

Where is the fork() on the fork bomb :(){ :|: & };:?

Warning: Running this command in most shells will result in a broken system that will need a forced shutdown to fix I understand the recursive function :(){ :|: & };: and what it does. But I ...
5
votes
2answers
2k views

Which file in kernel specifies fork(), vfork()… to use sys_clone() system call

When ltrace is used for tracing the system calls, I could see that fork() uses sys_clone() rather than sys_fork(). But I couldnt find the linux source where it is defined. My program is ...
5
votes
2answers
106 views

Making a process read a different file for the same filename

I have an application that reads a file. Let's call it processname and the file ~/.configuration. When processname runs it always reads ~/.configuration and can't be configured differently. There are ...
12
votes
2answers
2k views

Equivalent of “truss -T” and “truss -U” on Linux?

Is there an equivalent of what the -T and -U option of the truss Solaris utility does on Linux. Those are to specify a system call (-T) or library function (-U) which when called by the traced ...
0
votes
0answers
426 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 ...
-1
votes
1answer
130 views

System call tracing [closed]

I am working on system call tracing for host based IDS, i need to trace a process as soon as it entered in the system (a new entry in /proc). Is there any interrupt or signal or kernel datastructure ...
-1
votes
2answers
82 views

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

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 ...
0
votes
1answer
303 views

Understanding a XINU system call - getstk.c [closed]

I am having trouble conceptually understanding what is going on towards the end of this system call, and why. I understand the getstk.c method returns the highest memory address of available space, ...