When defining your own custom implementations of these FSIO functions,
PLEASE use the POSIX errrors possible from the syscall/library
versions. Also honour the expected return values: -1
for error,
0
for success. Use errno
. The point, and the
difficulty, is to provide transparent, drop-in replacements for the
system versions of these filesystem functions. In many cases, the custom
implementations will likely wrap around the system functions. However, this
is certainly not a requirement. One could provide a readdir()
function that returned the same static directory listing very single time,
avoiding use of readdir(2)
altogether, or one that browses
a backend database, presenting a filesystem view of that database to the
client.
When developing FSIO modules, debug messages showing the name of the
pr_fs_t
being invoked by the FSIO wrappers will be displayed
using debug level 9.
If using open(2)
in your implementation, please use
the PR_OPEN_MODE
macro (0666
) as the third
argument to the three-argument version of open(2)
. Failure to do
so, where relevant, can be a security risk (it will also cause files to
have umask issues).