Updated libs

This commit is contained in:
Benjamyn Love 2023-12-05 11:49:28 +11:00
parent e1e1cfc821
commit 0e305e4334

View File

@ -44,25 +44,8 @@ struct OpenFile load_file_to_mem(char *filename) {
printf("Unmapping failed"); printf("Unmapping failed");
exit(1); exit(1);
} }
close(fd);
return file; return file;
} }
int unmap_file(char *ptr, char *filename) {
int fd = open(filename, O_RDONLY);
if (fd < 0) {
printf("\n\"%s \" could not open", filename);
exit(1);
}
struct stat statbuf;
int err = fstat(fd, &statbuf);
err = munmap(ptr, statbuf.st_size);
if (err != 0)
{
printf("Unmapping failed");
return 1;
}
return 0;
}