Relative Content

Tag Archive for linux

This code can be a HOOK system function in 5.15.0-73, but it is invalid at 5.15.0-113

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this
In the 5.15.0-113, 5.15.0-119 kernel, try the information of the Hook system calling table and replace it with a custom function. But after modification, it does not take effect normally.can I still use other ways to implement it?

Multi cores/CPUs with locks

I’m not sure how the locks will work with multi processors/cores, I’m going to use shared memory in my application or FIFO, what worries me is the locks, I have a server with 2-CPU, how the lock will be able to lock a variable on one CPU while the another operation went to the 2nd CPU for the same variable?
I’m in Linux environment using C, I’ve searched the web for some useful info, appreciate your help

“Read” a file without using a file pointer

I was asked this question in an interview. I’m somehow supposed to “read” a file into my C program as input without using a file pointer (including “f” functions, e.g. fgets, fscanf etc.). I’m also not allowed to redirect it using the terminal, i.e. no system or exec calls. The program will not get the file during runtime.

Multiple readers on FIFO

I’ve asked a question here before about multiple writers on a FIFO, and I know now that the write is thread safe as long as I write less than the PIPE_BIF, here is the link for that limit.

Where Should I Put Configuration Files?

I’m creating a project that I want to be able to distribute across platforms. I’m writing in Java and AWT which already gives me a pretty large range of devices, but I’m mostly interested in Windows and Linux (Debian/Ubuntu).

hash with file instead of array

Is it possible to use hash function but with File instead of Array, and it’s gonna be saving the record in a file position and then search will fseek to that position, but I’m not sure how to open a file with let’s say 1000 line, do you think that method could work?