Created
April 29, 2018 01:51
-
-
Save adrianparvino/6ae8beb630dde1bb57845d4b7dc62ba1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <errno.h> | |
#include <limits.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
char *a; | |
//a = malloc(SIZE_MAX / 2); | |
a = malloc(SIZE_MAX); | |
//char *b = strerror(errno); | |
//write(2, b, strlen(b)); | |
perror("malloc error\n"); | |
memset(a, SIZE_MAX, 'a'); | |
for(size_t i = 0; i < SIZE_MAX; i += 4096) | |
printf("%c", a[i]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment