Skip to content

Instantly share code, notes, and snippets.

@conorgriffin
Last active August 29, 2015 14:10
Show Gist options
  • Save conorgriffin/d56d5d1512f8c5663c7c to your computer and use it in GitHub Desktop.
Save conorgriffin/d56d5d1512f8c5663c7c to your computer and use it in GitHub Desktop.
A really simple C program to get its own pid
// 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