I want to be able to map memory to a file descriptor, so I can use some existing functions that need a file descriptor. Here, in essence, I'm looking for:
void do_operation1(int fd); char data[DATA_MAX] = { }; int fd = addr_to_fd(data, DATA_MAX); do_operation1(fd);
What system call or calls can I use to accomplish this?
c unix posix system-calls mmap
Kaleb pederson
source share