1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h> #include <thread> #include <unistd.h> static void print_pid() { fprintf(stderr, "PID: %d\n", getpid()); } static void sleep() { std::this_thread::sleep_for(std::chrono::seconds(10)); } int main(int argc, char **argv) { print_pid(); puts("break here\n"); sleep(); return 0; }