I have a C code that runs on Linux that creates a certain amount of threads. In one of the threads, I want it so that if it runs into a certain condition, it should terminate the entire process. I looked up the exit() command but didn’t really understand how to use it.
Share
There’s little not to understand about
exit(). Just do:and gone’s your process.
EXIT_FAILUREbecomes the exit status of your program; this is the same as returning a value frommain().