Thanks for the reply, I will raise a bug to get this added. On Saturday, October 15, 2022 at 3:09:55 AM UTC+5:30 s...@google.com wrote:
> Emscripten doesn't yet support the memfd_create API. If you need to use > it you could look into adding support for it (or file a bug to get it > added). I imagine that most codebased that use that API have some kind of > cross-platform fallback. Perhaps you could use that instead? > > cheers, > sam > > On Fri, Oct 14, 2022 at 3:19 AM Aitha Tarun <aitha...@gmail.com> wrote: > >> 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 :* >> >> *[image: 1.png]* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to emscripten-disc...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/emscripten-discuss/ef9839a4-8f8c-47c5-8af7-782b05e58c10n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/emscripten-discuss/ef9839a4-8f8c-47c5-8af7-782b05e58c10n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/a1654b33-cf86-4119-bc90-3d4a9bdd3efen%40googlegroups.com.