Skip to content

Instantly share code, notes, and snippets.

@yohanes
Created October 26, 2014 11:50
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 yohanes/285a4eda1e6c8b6b43f5 to your computer and use it in GitHub Desktop.
Save yohanes/285a4eda1e6c8b6b43f5 to your computer and use it in GitHub Desktop.
Daemon 4 .so HITB2014
#define _GNU_SOURCE /* See feature_test_macros(7) */
#define _XOPEN_SOURCE /* See feature_test_macros(7) */
#include <time.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
time_t time(time_t *t)
{
char *t0 = getenv("TIME");
long tt = atol(t0);
return tt;
}
int strncmp(const char *s1, const char *s2, size_t c)
{
char *t0 = getenv("TIME");
FILE *f = fopen("timemap.txt", "a+");
fprintf(f, "%s %*s\n", t0, c, s1);
fclose(f);
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment