Skip to content

Instantly share code, notes, and snippets.

@irevoire
Created October 2, 2019 14:09
Show Gist options
  • Save irevoire/6fea0b6b9985360a9cacf8ecd0e27c85 to your computer and use it in GitHub Desktop.
Save irevoire/6fea0b6b9985360a9cacf8ecd0e27c85 to your computer and use it in GitHub Desktop.
son truc
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#define panic(s) \
{ \
perror(s); \
exit(-1); \
}
void usage()
{
fprintf(stderr, "usage:\n"
"\t./%s [nb_thread]\n", __FILE__);
exit(-1);
}
int main(int argc, char **argv)
{
unsigned nb_thread;
if (argc != 2)
usage();
nb_thread = strtoul(argv[1], NULL, 10); // base 10
if (nb_thread == 0 && errno != 0)
panic("unable to parse input");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment