Created
July 21, 2012 01:50
-
-
Save jedisct1/3154219 to your computer and use it in GitHub Desktop.
Yay, glibc!
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
// C libraries print the file size. | |
// well, except glibc, that always prints 0. | |
#include <stdio.h> | |
int main(void) | |
{ | |
FILE *fp = fopen("/tmp/aaa", "a+"); | |
printf("%ld\n", ftell(fp)); | |
fputc('x', fp); | |
fclose(fp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment