Running application can't create a file

Adam Lackorzynski adam at os.inf.tu-dresden.de
Sat Mar 1 00:34:41 CET 2014


Hi,

On Thu Feb 27, 2014 at 14:59:19 +0900, Irvanda Kurniadi wrote:
> Recently I'm using libtiff library on L4/Fiasco. I can use some function
> from that library. But when I'm trying to create an image by using  libtiff
> function, I got this error message:
> 
> TIFFOpen: output.tif: Cannot open.
> Could not open output.tif for writing
> MOE: task 1561539 exited with 42
> 
> Here is my configuration in module.list
> entry tiff_test2
>  roottask moe --init=rom/tiff_test2
>  module l4re
>  module tiff_test2
> 
> I compile and run it over linux and it works properly. This application is
> supposed to create the output file and then open it by TIFFOpen function.
> So, I think there is a trick to launch this tiff application over
> L4/fiasco, so the kernel can permit the application to create a file. But,
> it's only my assumption and I'm not really sure about this. If by any
> chance you know something about it, please let me know. Thanks

Per default, there's no writable directory available.
You can use tmpfs. Add the following in your application's Makefile:
REQUIRES_LIBS += libmount libl4revfs-fs-tmpfs

Then add a fstab file, with this content (usual syntax):
/     /tmp    tmpfs defaults

The last thing to do is to tell your application where to find the fstab
file. You need a config file for that, with this content:

L4.default_loader:start({}, "rom/tiff_test2", { FSTAB_FILE = "rom/fstab" });

Do not forget to change your module.list entry, add ned and put
"roottask moe rom/config.cfg" there instead of the --init version.

Now you should be able to write in /tmp in your application.



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list