Skip to content

Instantly share code, notes, and snippets.

@tomty89
Created December 10, 2020 11:15
Show Gist options
  • Save tomty89/b945364b3c25d0a0dcc7ea7e534c1acc to your computer and use it in GitHub Desktop.
Save tomty89/b945364b3c25d0a0dcc7ea7e534c1acc to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main() {
size_t sz;
void * buf;
sz = sysconf(_SC_PAGESIZE);
buf = malloc(sz);
memset(buf, 0xff, sz);
int ret;
do {
ret = write(1, buf, sz);
} while (ret > 0);
free(buf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment