Last active
August 29, 2015 14:10
-
-
Save conorgriffin/d56d5d1512f8c5663c7c to your computer and use it in GitHub Desktop.
A really simple C program to get its own pid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from http://duartes.org/gustavo/blog/post/system-calls/ | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
int main() | |
{ | |
pid_t p = getpid(); | |
printf("%d\n", p); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment