Currently this isn't possible - if you attempt to open System.Memory("/dev/some-device") it rejects it due to being unable to query the length of the file. It would be nice to be able to, for example, stick Pike on a Raspberry Pi, and then mmap /dev/gpiomem to manipulate things. Would it be of value to have a way to bypass that length check? I think that that's the only thing stopping it, although I'm not entirely certain.
ChrisA
It seems reasonable that if complain=0, fd>=0, and size>0, but osize<0, that it should try the mmap anyway (and skip the "area outside file" test, which is the only thing it needs osize for in this case).
Then something like
object m = System.Memory(); m->mmap("/sys/bus/nvmem/devices/mtd0/nvmem", 0, 4096);
(1) Result: 0
should work (i.e. return 1 instead of 0 :).
pike-devel@lists.lysator.liu.se