system call to map memory to a file descriptor (inverse mmap)?

后端 未结 3 1918
醉酒成梦
醉酒成梦 2021-01-18 09:06

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\'s essentially what I\'m looking for:

         


        
3条回答
  •  悲哀的现实
    2021-01-18 09:41

    Some implementations have fmemopen(). (Then of course you have to call fileno()).

    If yours doesn't, you can build it yourself with fork() and pipe().

提交回复
热议问题