My understanding is that threads and processes are really the same entity on Linux, the difference being in what memory is shared between them. I’m finding that it’s…difficult to ensure that child processes are properly cleaned up without explicit communication between the parent and child. I’d like to be able to run sub-processes with a similar mental model as threads,
Tag: linux-kernel
Pointers given from user space to kernel space are null
Sorry if this question has been asked before as it seems kind of basic, but I can’t find it anywhere on this site. I’m doing OS programming with linux (debian) and I’m trying to give a pointer from my user space to my kernel space function. Namely in the userspace I do and in the kernel space file kernel_function.c I
Linux filesystem nesting and syscall hooking
Using 2.6.32 linux kernel, I need to use a specific filesystem on a block device partition and I wan’t to hook open/write/read/close (and few others) syscalls to read/write, in an other fashion that the specific filesystem, what should be written on this partition. It would be only for this partition, others partitions using this filesystem would act as usual. Fuse
linux kernel: is vfs_write thread safe?
In my program, I need to write file in kernel space due to some special reason although I know it’s not recommended. I’m using vfs_write to write files in kernel space and it works fine. In one case, there are two threads need to write to the same file. From the internet, it seems that user-space write is thread safe,
What happened to USB MTP gadget driver in mainline Linux kernel?
I’m trying to make a embedded device work as a MTP device, using USB gadget driver. I know have Android switched from mass storage gadget to MTP gadget for quite a while, and found the source code for MTP gadget driver in a few Android repositories. However in the mainline kernel code I didn’t find that particular file, nor equivalents.
Which system calls are not interrupted by a signal?
AFAIK, most of the system calls on linux/unix are interrupted when a signal is received. According to the blog post below, there are some system calls that are not interrupted: In general function that return immediately (don’t wait for any I/O operation to complete or sleep) are not interruptible like socket(2) which just allocates a socket and doesn’t wait for
Completely Fair Scheduler (CFS): vruntime of long running processes
If vruntime is counted since creation of a process how come such a process even gets a processor if it is competing with a newly created processor-bound process which is younger let say by days? As I’ve read the rule is simple: pick the leftmost leaf which is a process with the lowest runtime. Thanks! Answer The kernel documentation for
How tar xvfz works in cygwin?
I tried tar with xvfz and -xvfc both didn’t work in Cygwin on Windows. Here cmd tar with ‘-‘ Question : 1 . How does tar works with – or without _ ? Please suggest to execute tar -xvfz sshpass-1.0.5.tar.gz. Answer tar has 3 types of syntax (according to this ): long options (–file) short options (-f) old options (f)
Where is the src code point where Linux kernel establish mapping virtual-physical address?
As I know, when program try to access virtual address that the corresponding PTE is NO present , kernel will trigger page fault and page fault handler will handle it. In handler, if fault is caused by no physical mapping to the PTE, kernel should allocate free physical page and write physical address to PTE. I found many functions like
How to create light weight kernel thread?
When I create a kernel thread (kthread_run), it becomes a new process.(I could see it using top command) . How can I create a light weight kernel thread(like the one we have in user space)? If I am not wrong, kthread_create will eventually call fork() which will call clone() with appropriate configuration to create a new process/lw process. Is it