Getting dataspace of a tmpfs-file blocks forever
j.stark at tum.de
Thu Feb 5 21:41:40 CET 2015
when I have created and filled a file in tmpfs,
reading normally (-> read() ) from it works fine.
However, I cannot get the associated dataspace.
The call would just block forever.
Here is an example code snippet:
const char* filename="/tmp/test";
mount("/", "tmp", "tmpfs", 0, 0);
printf("file content: %s\n",buf);
cxx::Ref_ptr<L4Re::Vfs::File> fp = L4Re::Vfs::vfs_ops->get_file(fd);
L4::Cap<L4Re::Dataspace> ds = fp->data_space();
long int size = ds->size();
printf("Dataspace size: %li\n",size);
It would just output
file content: Hello
but nothing more, which tells me that reading
normally from the file works, but the
fp->data_space() call blocks.
If I tried the same with an existing file in /rom/, it
works just fine (except for the writing part, obviously).
How can I make this work?
More information about the l4-hackers