Skip to content

Instantly share code, notes, and snippets.

@justinmeiners
Created May 21, 2021 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinmeiners/278b22ea131380d53b086fde7c5a3edd to your computer and use it in GitHub Desktop.
Save justinmeiners/278b22ea131380d53b086fde7c5a3edd to your computer and use it in GitHub Desktop.
// this shows the preprocessor you can use to detect whether to try pledge or not
//
#ifdef __OpenBSD__
#define HAS_PLEDGE 1
#endif
#ifdef HAS_PLEDGE
if (pledge("stdio", NULL) == -1)
{
return 1;
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment