Skip to content

Tag: c++

How to get Linux command location in C?

I am using execv in C, but it demands to get the path of the command to get it executed, For example: To execute ls I must have char* command = “/bin/ls”; To execute gedit I must have char* command = “/usr/bin/gedit”; My question is how to get the string “/bin” or “/u…

add another timer on already running loop

Given the following program – The second timer handle is never run on the loop, since the loop is already running, and “Timer2 called” is never printed. So I tried stopping the loop temporarily after running it and then adding the second timer – But this again didn’t work, probab…

Reading in kernel second time overrides first instance

I have written a read function to read a file into buffer in Kernel space. Now, this function works really well and I am able to read contents of filename into buf by calling this function from my system call Then, I am calling this function again to read contents of secondfile into secondbuffer. The problem …