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

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().

1 It turns out that fileno() fails on both Linux/FreeBSD (and I presume others) when the FILE* comes from fmemopen or something equivalent. Without a way to get the file descriptor, I'm not sure we have a solution. – Kaleb Pederson May 21 '10 at 6:08 1 fmemopen may also be implemented using funopen on BSD.

One implementation is available at redmine.openinfosecfoundation.org/attach...… – Kaleb Pederson May 21 '10 at 6:09 fork() is rather heavy-weight for this purpose. I’d suggest using a thread instead. Would be even better to use select() to multiplex between reading and writing from the pipe, but I guess that isn’t an option here.

– Sven Weidauer Sep 1 '10 at 8:40 That won't work since fmemopen() just creates a FILE* backed by given memory buffer. No file descriptor created. – Maxim Yegorushkin Nov 8 '11 at 17:25.

Sure, just open(argv0, ...), scan through the file to find where your binary data starts, lseek() there and done. That file won't have the length of your binary data of course.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions