Skip to content

Instantly share code, notes, and snippets.

@sajith
Created March 11, 2019 20:43
Show Gist options
  • Save sajith/4c4e359ab712f860aab83a336c49b859 to your computer and use it in GitHub Desktop.
Save sajith/4c4e359ab712f860aab83a336c49b859 to your computer and use it in GitHub Desktop.
//
// pthread_t is usually an unsigned long, at least on Linux, but POSIX
// does not guarantee this.
//
#include <pthread.h>
#include <iostream>
int main()
{
std::cout << "sizeof(int) : " << sizeof(int) << "\n"
<< "sizeof(long) : " << sizeof(long) << "\n"
<< "sizeof(ulong) : " << sizeof(unsigned long) << "\n"
<< "sizeof(pthread_t) : " << sizeof(pthread_t) << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment