Commit Graph

21 Commits

Author SHA1 Message Date
Norman Feske fd66252ca4 libc_fs: Use priority higher than libc_vfs
This way, we make sure that libc_fs is used if both plugins are
present, which happens during the transition to libc_vfs.
2014-04-29 15:19:28 +02:00
Sebastian Sumpf 45b4d6b187 libc_fs: Make plugin thread safe
Issue #1090
2014-03-14 13:17:35 +01:00
Norman Feske 2e6f281cf0 libc_fs: Handle Packet_alloc_failed exception 2014-02-28 10:11:11 +01:00
Sebastian Sumpf 2e04cc2d87 libc_fs: Implemented and test 'unlink' call
Issue #1048
2014-02-25 14:58:09 +01:00
Sebastian Sumpf 1b1693e6ff libc: 'readlink' returns non-zero terminated buffer
Make so to handle zero termination correctly for 'stat' calls and for debugging
output.

Issue #1048
2014-02-25 14:58:09 +01:00
Josef Söntgen 2e6255d1cf libc_fs: fix potential memory leak in symlink()
Free always the file descriptor and plugin context, return
the appropriate value to the caller and only in the error
case set errno.

Fixes #1009.
2013-12-20 15:21:59 +01:00
Christian Prochaska e879cb1c32 libc_fs: don't throw exception in 'open()'
Fixes #729.
2013-05-06 11:11:03 +02:00
Norman Feske 973fdae9d8 libc_fs: Fix seek report for ro (non-append) files 2013-03-29 22:48:44 +01:00
Norman Feske 73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Christian Prochaska be171d86bb libc: handle 'O_APPEND' flag for 'open()'
Fixes #319.
2012-10-11 17:10:21 +02:00
Christian Prochaska e9ac4b653b Add support for symbolic links
This patch adds support for symbolic links in libc, libc plugins, file
system servers and Noux.

Fixes #322.
2012-10-08 15:05:02 +02:00
Sebastian Sumpf 8ed489c4bc libc: Decrease noise level of debugging output
Changed 'libc_fs', 'libc_lwip' and 'libc/clock_gettime'
2012-09-24 09:18:00 +02:00
Christian Prochaska 3cfc691c77 libc_fs: handle 'Packet_alloc_failed' exception
With this patch, when a 'Packet_alloc_failed' exception occurs in the
'write()' function, the function waits for a packet acknowledgement and
the release of the packet and then tries the packet allocation again.

Fixes #348.
2012-09-14 12:13:05 +02:00
Christian Prochaska 9c278d6b8f libc_fs: release libc file descriptor in 'close()'
Fixes #334.
2012-08-22 16:50:03 +02:00
Norman Feske 7a7adfbb63 Add mmap and nunmap to libc_noux, libc_fs
In the current form, only PROT_READ is supported. This case is emulated
by copying the file content into new allocated backing store. Even
though the performance benefits of mmap-using code will not be
preserved, code that relies on mmap can be executed via the libc_noux
or libc_fs plugins, i.e. lightttpd.
2012-08-17 11:52:02 +02:00
Christian Prochaska 94fad13adb libc: add support for 'O_TRUNC' flag in 'open()'
Fixes #320.
2012-08-09 11:09:43 +02:00
Christian Prochaska dcfcbce856 libc: add support for 'ftruncate()'
Fixes #307.
2012-08-09 11:09:43 +02:00
Christian Prochaska 280fc59edf Fix 'O_CREAT' flag handling in 'open()'
Fixes #313.
2012-08-09 11:09:43 +02:00
Christian Prochaska 23772b620f libc_fs: return resulting offset in 'lseek()'
Fixes #314.
2012-08-02 15:06:35 +02:00
Christian Prochaska 30dc1d83da FAT file system service
This patch implements a service which provides access to files and
directories of a FAT file system via the 'File_system' interface.

Fixes #251.
2012-07-10 16:30:26 +02:00
Norman Feske ae1d0c04ae File-system interface, ram_fs, libc-fs
This patch introduces the file-system-session interface, provides an
implementation of this interface in the form of an in-memory file
system, and enables the libc to use the new file-system facility.

The new interface resides in 'os/include/file_system_session/'. It
uses synchronous RPC calls for functions referring to directory
and meta-data handling. For transferring payload from/to files, the
packet-stream interface is used. I envision that the asynchronous design
of the packet-stream interface fits well will the block-session
interface. Compared to Unix-like file-system APIs, Genode's file-system
session interface is much simpler. In particular, it does not support
per-file permissions. On Genode, we facilitate binding policy (such as
write-permission) is sessions rather than individual file objects.

As a reference implementation of the new interface, there is the
new 'ram_fs' service at 'os/src/server/ram_fs'. It stores sparse
files in memory. At the startup, 'ram_fs' is able to populate the
file-system content with directories and ROM modules as specified
in its configuration.

To enable libc-using programs to access the new file-system interface,
there is the new libc plugin at 'libports/src/lib/libc-fs'. Using this
plugin, files stored on a native Genode file system can be accessed
using the traditional POSIX file API.

To see how the three parts described above fit together, the test
case at 'libports/run/libc_fs' can be taken as reference. It reuses
the original 'libc_ffat' test to exercise several file operations
on a RAM file-system using the libc API.

:Known limitations:

The current state should be regarded as work in progress. In particular
the error handling is not complete yet. Not all of the session functions
return the proper exceptions in the event of an error. I plan to
successively refine the interface while advancing the file-system
implementations. Also the support for truncating files and symlink
handling are not yet implemented.

Furthermore, there is much room for optimization, in particular for the
handling of directory entries. Currently, we communicate only one dir
entry at a time, which is bad when traversing large trees. However, I
decided to focus on functionality first and defer optimizations (such as
batching dir entries) to a later stage.

The current implementation does not handle file modification times at
all, which may be a severe limitation for tools that depend on this
information such as GNU make. Support for time will be added after we
have revisited Genode's timer-session interface (issue #1).

Fixes #54
Fixes #171
2012-05-17 20:33:53 +02:00