On Mon, 18 Aug 2014 16:42:33 -0000, Jeff Haran said:

> I'm pretty sure you need to pass the file descriptor of an open file or
> device as the fd (second parameter from the end). -1 is not a valid fd.

Good catch.  But that should throw a different error than "resource
unavailable" - I'd expect to get EBADF back for that and it sounds like
he's getting EAGAIN back...

But yeah, that needs fixing too.

A common trick is to   fd = open("/dev/zero",.... to get an fd that can
be used for mmap of anonymous space.  Linux old-timers will remember
that /lib/ld-linux.so does this - with the non-obvious result that trying to
run a program that was linked against shared libraries would fail in a chroot
even if all the libraries were present, if /dev/zero wasn't in the chroot
as well....)

Attachment: pgpQEQu2d3yS4.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to