Hi, I am unable to use the memfd_create method while building the C script to emscripten.
Below I have given my references to reproduce the error.
Code :
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>
#define _GNU_SOURCE
int memfd_create(const char *name, unsigned int flags);
int main()
{
int fd = memfd_create("temp", 0);
printf("Fd : %d\n", fd);
int wrote = write(fd, "Hello", 5);
printf("Wrote : %d\n", wrote);
char * buf = malloc(5);
int red = pread(fd, buf, 5, 0);
printf("Read : %d\n", red);
printf("Content %s\n", buf);
}
Error :