Created
October 2, 2019 14:09
-
-
Save irevoire/6fea0b6b9985360a9cacf8ecd0e27c85 to your computer and use it in GitHub Desktop.
son truc
This file contains 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
#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