422 questions
-1
votes
0
answers
91
views
ProcessID from ETW always return 0xFFFFFFFF
I am using Event Tracing for Windows to monitor disk io and network usage of processes. I have used ETW with KERNEL_LOGGER_NAME , EVENT_TRACE_FLAG_PROCESS , EVENT_TRACE_FLAG_DISK_IO, ...
1
vote
0
answers
86
views
Why does this C code return `SG!` string twice as a reaction on two subsequent SIGUSR1 signals raised by the `kill -SIGUSR1 [PID]` command?
I expected that SA_RESETHAND flag would remove custom signal handler before or after the first execution. So, whare I was wrong?
#include <unistd.h>
#include <stdio.h>
#include <signal....
1
vote
0
answers
144
views
Go runtime getsockopt for linux 386
Is there a way to call getsockopt passing arbitrary byte buffer from a user program in golang for linux 386?
There are several exported functions regarding getsockopt in syscall_unix.go in unix ...
0
votes
0
answers
42
views
Problem with File Descriptor Handling in a C Command Line Interpreter Using Pipes
I'm building a simple command line interpreter in C, and I've encountered an issue with handling file descriptors when using pipes. The interpreter is supposed to support piped commands, but I'm ...
0
votes
1
answer
180
views
Filling a sk_buff with content of recieved frame
I'm writing an kernel network module and when I receive an Ethernet DIX frame, which is represented as continuous sequence of bytes, I have to properly put all content of recieved packet into sk_buff. ...
1
vote
1
answer
173
views
Segmentation fault when calling alloc_netdev
I am having trouble with coding linux driver. When try to allocate netdev in this line:
dev = alloc_netdev(sizeof(struct dev_priv),"super_giga_interface",NET_NAME_UNKNOWN,ipsec_setup);
I ...
0
votes
1
answer
110
views
my code doesn't execute after first command?
INPUT
echo "/bin/ls
/bin/ls
/bin/ls
/bin/ls " | ./hsh
OUTPUT
Only first /bin/ls
I want to know why it doesn't execute other commands?
I used strtok to split string input as i ...
1
vote
1
answer
609
views
How does stdin buffer mode works?
I know how stdout buffer mode works,that is:
unbuffered: no buffer.
line buffered: flush the buffer when encounter a newline character.
block buffered: flush when the buffer is full.
I can understand ...
0
votes
1
answer
116
views
Pthread Specific Data In Linux System
In the Linux System we can use pthread for multithread programming and in the pthread there was a pthread specific data where we should first create a key. But what is the purpose of pthread specific ...
0
votes
0
answers
323
views
Hidden PCI device
I'm trying to access eMMC soldered to Intel SDIO controller on Intel Atom z8350 platform.
The documentation says that there are 3 controllers in the SoC, but PCI scanning finds only one one that is ...
0
votes
1
answer
681
views
Why do glibc's `system()` and `posix_spawn()` deal with signals?
The current POSIX-wide implementation of system() in glibc for the parent process:
1.a sets the process-wide signal handlers for SIGINT and SIGQUIT to ignore
1.b and blocks SIGCHLD.
The current Linux-...
0
votes
1
answer
45
views
why does the process yield control flow to kernel when it knows how to handle?
My understanding is as follows.
The program raises runtime errors (e.g., division by zero, or invalid memory reference)
The program executes 'fault' instruction and give control to the
kernel
The ...
0
votes
1
answer
611
views
Managing processes in C
I am trying to test how to create and manage processes with a program what should create a process and execute a command 2 times (each time executing a different command).
What I am trying to do ...
0
votes
0
answers
116
views
Having issues when using dup2 twice within the same process
I cannot figure out why does this program display only garbage characters when trying to print (at the standard output) some data read from both a file and a pipe. It is interesting that this problem ...
0
votes
1
answer
82
views
How are kernels made?
From my understanding, your program does everything using syscalls. But if everything is done with syscalls, then how are kernels coded? If every function just runs a stscall then how are you supposed ...
0
votes
0
answers
28
views
In Linux system programming with C language, how does the main program periodically check the global variable which is setted by signal_handler?
I know the basic principles of writing signal processing functions. The simpler the better, the global variables are set in the function body, and the rest of the work is left to the main program to ...
0
votes
1
answer
84
views
Reason for using linked list implementations on stack vs heap
I was reviewing some libraries in C for a systems programming class, and I noticed their implementation of a doubly linked list did not require dynamically allocated data. Instead a list of a ...
0
votes
0
answers
86
views
Memory segment permissions per user/group - any way to achieve this?
We know there are rwxp/s permissions on memory segments of an elf executable.
Now, I have a user or a group, and I would like them to see .text segment (read access) of a certain executable but ...
0
votes
1
answer
2k
views
What is the difference between Message Queues and files in Linux. Also, what is the significance of priorities in message queues?
In Linux, Message queues are a form of IPC. However, I don't understand how they are different from a file. Instead of writing into a message queues, the processes can just write into a file right? ...
0
votes
1
answer
52
views
Operating Systems Mutexes
Question
Assume that you have two mutexes, guard_mtx_1 and guard_mtx_2, that guards the access to the global lists, list_1 and list_2 in two threads that both run the following code snippet:
...
lock(...
1
vote
2
answers
190
views
Impact of zombies processes on an embedded linux [closed]
I'm developing a program (Grand parent process) that automatically relaunch a process (parent process) that calls two other processes (children processes) in case of errors.
If one of the children ...
0
votes
1
answer
806
views
Network interfaces status tracking on FreeBSD
I'm porting some software to FreeBSD 12 (it's never been run on FreeBSD). The software needs to track the system network interfaces and react immediately on status changes. It's assumed to run with ...
1
vote
0
answers
251
views
CSAPP 3rd edition practice problem 8.8, using signal handlers
The following code is taken from practice problem 8.8 from CS:APP3e on page number 809
volatile long counter = 2;
void handler1(int sig)
{
sigset_t mask, prev_mask;
Sigfillset(&mask);
...
0
votes
2
answers
1k
views
fcntl not working (doesn't lock the file) in multi-threaded programme
fcntl using code
Hi. I'm trying to access a file with multiple threads,
trying to get synchronization with record lock(fcntl).
The problem is, fcntl doesn't lock the file.
result
I've tried:
each ...
0
votes
2
answers
260
views
Semaphore deadlock when using unnamed semaphores in POSIX with shared memory
I have 2 semaphores. I have a shared memory segment. I am trying to synchronize processes so that they wait for each other until a certain task is finished but when sem_post_util( sem_sync ) is used ...