C   25

pid getpid

Guest on 24th January 2023 02:11:13 PM


  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <unistd.h>
  4.  
  5. int
  6. main(void)
  7. {
  8.         int i;
  9.  
  10.         printf("pid %d\n", getpid());
  11.  
  12.         i = 0;
  13.         while (1) {
  14.                 printf("%d\n", i);
  15.                 i++;
  16.                 sleep(1);
  17.         }
  18.         return (0);
  19. }

Raw Paste


Login or Register to edit or fork this paste. It's free.

">