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 <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
int main(void) { | |
char * page; | |
size_t memory_allocated = 0; | |
while ((page = mmap(NULL, sysconf(_SC_PAGE_SIZE) |
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 <stdlib.h> | |
#include <string.h> | |
int main (int argc, char *argv[]) { | |
int memsize; | |
char **mem; | |
int i; | |
if (argc != 2 || sscanf(argv[1],"%d",&memsize)!=1) { |
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 <dirent.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) { | |
DIR *dir; | |
struct dirent *ent; | |
long count = 0; | |
int maxfiles = atoi(argv[2]); |