libexplain  1.4.D001
Functions
libexplain/buffer/check_fildes_range.c File Reference
#include <libexplain/ac/limits.h>
#include <libexplain/ac/sys/param.h>
#include <libexplain/ac/unistd.h>
#include <libexplain/buffer/check_fildes_range.h>
#include <libexplain/option.h>

Go to the source code of this file.

Functions

static int get_open_max (void)
static void whinge (explain_string_buffer_t *sb, const char *caption)
int explain_buffer_check_fildes_range (explain_string_buffer_t *sb, int fildes, const char *caption)

Function Documentation

int explain_buffer_check_fildes_range ( explain_string_buffer_t sb,
int  fildes,
const char *  caption 
)

The explain_buffer_check_fildes_range function may be used to check that a file descriptor is within the acceptable range, and print an explanation if it is not.

Parameters:
sbThe string buffer to print into.
fildesThe file descriptor value to be checked.
captionThe name of the function call argument containg the file descriptor value to be checked.
Returns:
0 if printed an explanation, -1 if not out of range (no explanation printed)

Definition at line 71 of file check_fildes_range.c.

static int get_open_max ( void  ) [static]

Definition at line 28 of file check_fildes_range.c.

static void whinge ( explain_string_buffer_t sb,
const char *  caption 
) [static]

Definition at line 44 of file check_fildes_range.c.