libexplain  1.4.D001
Functions
libexplain/buffer/efbig.c File Reference
#include <libexplain/ac/limits.h>
#include <libexplain/ac/sys/resource.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/buffer/efbig.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/buffer/pretty_size.h>
#include <libexplain/option.h>

Go to the source code of this file.

Functions

static unsigned long long get_max_file_size (int file_size_bits)
unsigned long long explain_get_max_file_size_by_pathname (const char *pathname)
static void report_error (explain_string_buffer_t *sb, const char *caption, unsigned long long actual, unsigned long long maximum)
void explain_buffer_efbig (explain_string_buffer_t *sb, const char *pathname, unsigned long long length, const char *length_caption)
unsigned long long explain_get_max_file_size_by_fildes (int fildes)
void explain_buffer_efbig_fildes (explain_string_buffer_t *sb, int fildes, unsigned long long length, const char *length_caption)

Function Documentation

void explain_buffer_efbig ( explain_string_buffer_t sb,
const char *  pathname,
unsigned long long  length,
const char *  length_caption 
)

The explain_buffer_efbig function may be used to insert the maximum file size into the giben string buffer.

Parameters:
sbThe string buffer to print into.
pathnameThe pathname of the problem file, so pathconf can be used.
lengthThe length of offending file
length_captionThe name of the parameter of the length of offending file

Definition at line 96 of file efbig.c.

void explain_buffer_efbig_fildes ( explain_string_buffer_t sb,
int  fildes,
unsigned long long  length,
const char *  length_caption 
)

The explain_buffer_efbig_fildes function may be used to insert the maximum file size into the given string buffer.

Parameters:
sbThe string buffer to print into.
fildesThe filedescriptor of the problem file, so fpathconf can be used.
lengthThe length of offending file
length_captionThe name of the parameter of the length of offending file

Definition at line 122 of file efbig.c.

unsigned long long explain_get_max_file_size_by_fildes ( int  fildes)

The explain_get_max_file_size_by_fildes function is used to get the maximum file size, for the file system on which the file resides.

Parameters:
fildesThe file descriptor indicating the file system.
Returns:
maximum file size

Definition at line 107 of file efbig.c.

unsigned long long explain_get_max_file_size_by_pathname ( const char *  path)

The explain_get_max_file_size_by_pathname function si sued to get the maximum file size, for the file system on which the file resides.

Parameters:
pathThe path indicating the file system.
Returns:
maximum file size

Definition at line 53 of file efbig.c.

static unsigned long long get_max_file_size ( int  file_size_bits) [static]

Definition at line 31 of file efbig.c.

static void report_error ( explain_string_buffer_t sb,
const char *  caption,
unsigned long long  actual,
unsigned long long  maximum 
) [static]

Definition at line 68 of file efbig.c.