PERL: When does exec cause a pid switch?

My boss wrote some code (I know – dangerous territory) in perl years ago, and now it’s causing a problem – the pid changes, so the pidfile is no longer valid. Code: exec($0, "-f", "$configfile") I think there may be a shell invocation involved that is forking $0 (cloning probably), but he’s 1000% sure there’s… Read More PERL: When does exec cause a pid switch?

Syntax error from running another file by exec (language C)(edit)

I’m experimenting with the family exec. The first code is: int main(int argc, char *argv[]){ // Program changes permission because exec can’t execute the file if permission is not accurated chmod("src2/child.c", S_IRWXU | S_IRWXU); // Now program creates one child process pid_t pid = fork(); // If fork failed exit with error if (pid ==… Read More Syntax error from running another file by exec (language C)(edit)