Namespaces | |
namespace | rpa |
Classes | |
struct | rpa::visitor |
Base class for copying a file descirptor into another. More... | |
class | rpa::streambuf_visitor |
For writing into an output streambuf. More... | |
class | rpa::FILE_visitor |
For writing memory segments into a POSIX file. More... | |
class | rpa::fd_visitor |
For writing memory segments into an integer file descriptor. More... | |
Defines | |
#define | RPA_SENDFILE_AVAILABLE |
Functions | |
void | rpa::tmpnam_vconcat (char *aBuf, const char *aPattern,...) |
Handy function for creating temporary file names. For testing purpose. | |
void | rpa::fsetposition (FILE *aF, off_t aPos) |
This wraps a fseek with some error detection code. | |
off_t | rpa::fposition (FILE *aF) |
This returns the current offset from the file beginning. | |
void | rpa::fsetposition (int aFd, off_t aPos) |
off_t | rpa::fposition (int aFd) |
bool | rpa::frewinded (FILE *myF) |
This tells whether a file is rewinded to its beginning. | |
bool | rpa::frewinded (int aFilDes) |
This tells whether a file is rewinded to its beginning. | |
void | rpa::frewind (int aFilDes) |
Rewinds a file to its beginning. | |
int | rpa::fileno_nolock (FILE *aFilPtr) |
Returns the int file descriptor of the FILE ptr. | |
int | rpa::ferror_nolock (FILE *aFilPtr) |
Does the same as 'ferror' but assumes an exclusive access to the file. | |
size_t | rpa::fread_nolock (void *ptr, size_t size, size_t n, FILE *stream) |
size_t | rpa::fwrite_nolock (const void *ptr, size_t size, size_t n, FILE *stream) |
bool | rpa::mmap_loop (FILE *aF, const visitor &aVisit, size_t aPagSiz) |
Moves data from shared memory to a POSIX file. | |
bool | rpa::mmap_loop (int aFilDes, const visitor &aVisit, size_t aPagSiz) |
Moves data from shared memory to an integer file descriptor. | |
bool | rpa::FILE_loop (FILE *aF, const visitor &aVisit, size_t aBufSiz) |
Moves data from a POSIX FILE to another. | |
bool | rpa::fd_loop (int aFilDes, const visitor &aVisit, size_t aBufSiz) |
Moves data from an integer file descriptor to another. | |
bool | rpa::dmp_sendfile (int aSrcFd, int aDstFd) |
bool | rpa::fexists (const char *aFile) |
Just tells whether a file exists. Debugging only. |
Related to files, memory mapping, IOs. All operating-system datatypes are hidden to the calling program, such as file offsets, file positions, etc... So, when using 64-bits files (large files), only futilies.cpp needs to be recompiled. The point is that these functions offers the same error signaling mechanism with exceptions.
#define RPA_SENDFILE_AVAILABLE |
In Linux 2.6, it is not possible to make sendfile on an input file. The input file must be a socket. This decision because there is no performance benefit. This special case is processed in this library.