Skip to content

Instantly share code, notes, and snippets.

@tuxmartin
Last active December 24, 2015 23:40
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 tuxmartin/73a0f4e2ea98a1450093 to your computer and use it in GitHub Desktop.
Save tuxmartin/73a0f4e2ea98a1450093 to your computer and use it in GitHub Desktop.
// gcc -std=c99 -O3 -pedantic -Werror -static -o usleep usleep.c
// ./usleep 1000000
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
signed int intvar = 0;
if (sscanf (argv[1], "%i", &intvar)!=1)
{
printf ("error - not an integer\n");
return 1;
}
usleep(intvar);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment