Dump a linux process’s memory to file

I’m not sure how you dump all the memory to a file without doing this repeatedly (if anyone knows an automated way to get gdb to do this please let me know), but the following works for any one batch of memory assuming you know the pid: $ cat /proc/[pid]/maps This will be in the … Read more

Keeping a linux process running after I logout

The best method is to start the process in a terminal multiplexer. Alternatively you can make the process not receive the HUP signal. A terminal multiplexer provides “virtual” terminals which run independent from the “real” terminal (actually all terminals today are “virtual” but that is another topic for another day). The virtual terminal will keep … Read more

Difference between user-level and kernel-supported threads?

Edit: The question was a little confusing, so I’m answering it two different ways. OS-level threads vs Green Threads For clarity, I usually say “OS-level threads” or “native threads” instead of “Kernel-level threads” (which I confused with “kernel threads” in my original answer below.) OS-level threads are created and managed by the OS. Most languages … Read more

Difference between exec, execvp, execl, execv?

Summary: In your case I would recommend to use execvp. To find out the differences between the exec* functions you should read the documentation:https://linux.die.net/man/3/exechttps://linux.die.net/man/2/execve The difference between execl* and execv* is the argument passing. execl* require a list of arguments while execv* require a vector of arguments.A list of arguments is useful if you know … Read more