Alien-Libjio
view release on metacpan or search on metacpan
# Ask the user what 'make' program to invoke
my $make;
if (exists($ENV{MAKE}) && length($ENV{MAKE})) {
$make = $ENV{MAKE};
}
else {
use Config '%Config';
$make = $Config{make};
# Probe for GNU Make (useful on BSD/Unix variants)
if ($make eq 'make' && grep { -x $_ . '/gmake' } @PATH) {
$make = 'gmake';
warn 'your system is a BSD variant but gmake was not found'
if ($^O =~ /bsd$/);
}
}
$make = $builder->prompt('What is your system "make" command?', $make);
$builder->notes(make => $make);
libjio/libjio/doxygen/groups.doxy
libjio/libjio/fiu-local.h
libjio/libjio/jiofsck.c
libjio/libjio/journal.c
libjio/libjio/journal.h
libjio/libjio/libjio.3
libjio/libjio/libjio.h
libjio/libjio/libjio.pc.in
libjio/libjio/trans.c
libjio/libjio/trans.h
libjio/libjio/unix.c
libjio/samples/Makefile
libjio/samples/full.c
libjio/samples/jio1.c
libjio/samples/jio2.c
libjio/samples/jio3.c
libjio/tests/README
libjio/tests/behaviour/README
libjio/tests/behaviour/runtests
libjio/tests/behaviour/t_corruption.py
libjio/tests/behaviour/t_fi.py
libjio/README view on Meta::CPAN
libjio - A library for Journaled I/O
------------------------------------
libjio is a simple userspace library to do journaled, transaction-oriented
I/O.
It provides a transaction API to commit and rollback transactions, and on top
of that a unix-alike set of functions to perform most regular operations (ie.
open, read, write, etc.).
The library guarantees file integrity even after unexpected crashes, never
leaving your files in an inconsistent state.
You can find more detailed documents, including the programmer's guide, in the
doc/ directory, and the manpage in the libjio/ directory.
To see how to install it, please read the INSTALL file.
libjio/doc/guide.rst view on Meta::CPAN
the Large File Support (*"LFS"* from now on), to be able to handle large files
properly. This means that you will have to pass some special standard flags to
the compiler, so your C library uses the same data types as the library. For
instance, on 32-bit platforms (like x86), when using LFS, offsets are usually
64 bits, as opposed to the usual 32.
The library is always built with LFS; however, linking it against an
application without LFS support could lead to serious problems because this
kind of size differences and ABI compatibility.
The Single Unix Specification standard proposes a simple and practical way to
get the flags you need to pass your C compiler to tell you want to compile
your application with LFS: use a program called "getconf" which should be
called like "getconf LFS_CFLAGS", and it outputs the appropiate parameters.
In the end, the command line would be something like::
gcc `getconf LFS_CFLAGS` app.c -ljio -o app
If you want more detailed information or examples, you can check out how the
library and sample applications get built.
libjio/doc/source_layout view on Meta::CPAN
-------------
The source is structured so code can be read and reviewed in an independant
way, following the way the code really works.
The main file is called "trans.c" which contains the transaction API; all the
other wrappers depend on it, and they're the core of the library.
There is also a "common.c" file with some common functions.
And finally, "unix.c" which implement the wrappers for the UNIX API (read(),
write() and their family), and "ansi.c" where ANSI wrappers live (fopen(),
fread(), etc.).
If you're trying to read the code for the first time, you can start from
either from the more simple unix.c which relies on trans.c; or from trans.c
which is what everything else relies on, and then the wrappers will be
obvious.
libjio/libjio/Makefile view on Meta::CPAN
N_AR = $(AR)
endif
# library version, used for soname and generated documentation
LIB_VER=1.01
LIB_SO_VER=1
OBJS = $(addprefix $O/,autosync.o checksum.o common.o compat.o trans.o \
check.o journal.o unix.o ansi.o)
# targets
default: all
all: $O/libjio.so $O/libjio.a $O/libjio.pc $O/jiofsck
# used to rebuild everything when the build flags have changed
BF = $(CC) ~ $(ALL_CFLAGS) ~ $(PREFIX)
libjio/libjio/ansi.c view on Meta::CPAN
#include <unistd.h>
#include <pthread.h>
#include "libjio.h"
#include "common.h"
#include "trans.h"
/*
* To avoid completely useless code duplication, this functions rely on the
* UNIX wrappers from unix.c.
*
* The API is not nice, and I wouldn't recommend it for any serious I/O.
*
* Note that it is still experimental and it hasn't received too much testing
* (that's why it's not even documented), so use it at your own risk.
*/
/* fopen() wrapper */
struct jfs *jfopen(const char *path, const char *mode)
libjio/libjio/doxygen/groups.doxy view on Meta::CPAN
/**
@addtogroup basic Basic API
This is the basic, lower-level API.
@addtogroup check Check API
This is the integrity-checking API.
@addtogroup unix UNIX-alike API
This is the UNIX-alike API, built on top of the @ref basic "basic API".
*/
libjio/libjio/libjio.h view on Meta::CPAN
* UNIX API wrappers
*/
/** Read from the file. Works just like UNIX read(2).
*
* @param fs file to read from
* @param buf buffer used to store the data
* @param count maximum number of bytes to read
* @returns number of bytes read on success, or -1 on error
* @see read(2)
* @ingroup unix
*/
ssize_t jread(jfs_t *fs, void *buf, size_t count);
/** Read from the file at the given offset. Works just like UNIX pread(2).
*
* @param fs file to read from
* @param buf buffer used to store the data
* @param count maximum number of bytes to read
* @param offset offset to read at
* @returns number of bytes read on success, or -1 on error
* @see pread(2)
* @ingroup unix
*/
ssize_t jpread(jfs_t *fs, void *buf, size_t count, off_t offset);
/** Read from the file into multiple buffers. Works just like UNIX readv(2).
*
* @param fs file to read from
* @param vector buffers used to store the data
* @param count maximum number of bytes to read
* @returns number of bytes read on success, or -1 on error
* @see readv(2)
* @ingroup unix
*/
ssize_t jreadv(jfs_t *fs, const struct iovec *vector, int count);
/** Write to the file. Works just like UNIX write(2).
*
* @param fs file to write to
* @param buf buffer used to read the data from
* @param count maximum number of bytes to write
* @returns number of bytes written on success, or -1 on error
* @see write(2)
* @ingroup unix
*/
ssize_t jwrite(jfs_t *fs, const void *buf, size_t count);
/** Write to the file at the given offset. Works just like UNIX pwrite(2).
*
* @param fs file to write to
* @param buf buffer used to read the data from
* @param count maximum number of bytes to write
* @param offset offset to write at
* @returns number of bytes written on success, or -1 on error
* @see pwrite(2)
* @ingroup unix
*/
ssize_t jpwrite(jfs_t *fs, const void *buf, size_t count, off_t offset);
/** Write to the file from multiple buffers. Works just like UNIX writev(2).
*
* @param fs file to write to
* @param vector buffers used to read the data from
* @param count maximum number of bytes to write
* @returns number of bytes written on success, or -1 on error
* @see writev(2)
* @ingroup unix
*/
ssize_t jwritev(jfs_t *fs, const struct iovec *vector, int count);
/** Truncates the file to the given length. Works just like UNIX ftruncate(2).
*
* @param fs file to truncate
* @param length lenght to truncate to
* @returns 0 on success, -1 on error
* @see ftruncate(2)
* @ingroup unix
*/
int jtruncate(jfs_t *fs, off_t length);
/** Reposition read/write file offset. Works just like UNIX lseek(2).
*
* @param fs file to change the offset to
* @param offset offset to set
* @param whence where to count offset from, can be SEEK_SET to count from the
* beginning of the file, SEEK_CUR to count from the current position, or
* SEEK_END to count from the end.
* @returns the new offset counted from the beginning of the file, or -1 on
* error.
* @ingroup unix
*/
off_t jlseek(jfs_t *fs, off_t offset, int whence);
/*
* ANSI C stdio wrappers
*/
jfs_t *jfopen(const char *path, const char *mode);
( run in 1.230 second using v1.01-cache-2.11-cpan-64ef6c95b5d )