libexplain  1.4.D001
Functions | Variables
libexplain/iocontrol/generic.c File Reference
#include <libexplain/ac/ctype.h>
#include <libexplain/ac/errno.h>
#include <libexplain/ac/stdint.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/sys/ioctl.h>
#include <libexplain/buffer/dac.h>
#include <libexplain/buffer/eacces.h>
#include <libexplain/buffer/ebadf.h>
#include <libexplain/buffer/ebusy.h>
#include <libexplain/buffer/efault.h>
#include <libexplain/buffer/eio.h>
#include <libexplain/buffer/enomedium.h>
#include <libexplain/buffer/enosys.h>
#include <libexplain/buffer/erofs.h>
#include <libexplain/buffer/errno/generic.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/buffer/int.h>
#include <libexplain/buffer/int8.h>
#include <libexplain/buffer/int64_t.h>
#include <libexplain/buffer/is_the_null_pointer.h>
#include <libexplain/buffer/long.h>
#include <libexplain/buffer/pointer.h>
#include <libexplain/buffer/short.h>
#include <libexplain/iocontrol/generic.h>
#include <libexplain/parse_bits.h>
#include <libexplain/sizeof.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_iocontrol_generic_print_hash_define (explain_string_buffer_t *sb, int request)
static void print_name (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_fake_syscall_name (char *name, int name_size, const explain_iocontrol_t *p, int request)
void explain_iocontrol_generic_print_explanation (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_int (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_uint (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_int_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_uint_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_long (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_ulong (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_long_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_ulong_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_pointer (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_int64_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_uint64_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_ignored (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_short_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_ushort_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_int8_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)
void explain_iocontrol_generic_print_data_uint8_star (const explain_iocontrol_t *p, explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data)

Variables

const explain_iocontrol_t explain_iocontrol_generic

Function Documentation

void explain_iocontrol_fake_syscall_name ( char *  output,
int  output_size,
const explain_iocontrol_t p,
int  request 
)

The explain_iocontrol_fake_syscall_name function is used to synthesize a "sycall name" for use in error messages that take same.

Parameters:
outputwhere to write the name
output_sizethe available output size, in bytes
pioctl descriptor
requestoriginal request, exactly as passed to the ioctl system call

Definition at line 355 of file generic.c.

void explain_iocontrol_generic_print_data_ignored ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_ignored function is used to print a ioctl::data argument in the case where it is ignored (by convention, should be zero).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 645 of file generic.c.

void explain_iocontrol_generic_print_data_int ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int function is used to print a generic (non-specific) intger value arg (as opposed to some kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 502 of file generic.c.

void explain_iocontrol_generic_print_data_int64_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int64_star function is used to print a the signed 64-bit value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 619 of file generic.c.

void explain_iocontrol_generic_print_data_int8_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int8_star function is used to print a the signed int8 value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 686 of file generic.c.

void explain_iocontrol_generic_print_data_int_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int_star function is used to print a generic (non-specific) intger pointer arg (as opposed to any other kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 528 of file generic.c.

void explain_iocontrol_generic_print_data_long ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_long function is used to print a generic (non-specific) long int value arg (as opposed to some kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 554 of file generic.c.

void explain_iocontrol_generic_print_data_long_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_long_star function is used to print a generic (non-specific) intger pointer arg (as opposed to any other kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 580 of file generic.c.

void explain_iocontrol_generic_print_data_pointer ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_pointer function is used to print a generic pointer arg.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 606 of file generic.c.

void explain_iocontrol_generic_print_data_short_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_short_star function is used to print a the signed short value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 660 of file generic.c.

void explain_iocontrol_generic_print_data_uint ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_uint function is used to print a generic (non-specific) unsigned intger value arg (as opposed to some kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 515 of file generic.c.

void explain_iocontrol_generic_print_data_uint64_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int64_star function is used to print a the unsigned 64-bit value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 632 of file generic.c.

void explain_iocontrol_generic_print_data_uint8_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_int8_star function is used to print a the unsigned int8 value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 699 of file generic.c.

void explain_iocontrol_generic_print_data_uint_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_uint_star function is used to print a generic (non-specific) unsigned intger pointer arg (as opposed to any other kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 541 of file generic.c.

void explain_iocontrol_generic_print_data_ulong ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_ulong function is used to print a generic (non-specific) unsigned long int value arg (as opposed to some kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 567 of file generic.c.

void explain_iocontrol_generic_print_data_ulong_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_ulong_star function is used to print a generic (non-specific) unsigned intger pointer arg (as opposed to any other kind of pointer).

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 593 of file generic.c.

void explain_iocontrol_generic_print_data_ushort_star ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_data_short_star function is used to print a the unsigned short value pointer to data.

For use in iocontrol definitions, as code common to many ioctl requests... hence the weird looking argument list.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 673 of file generic.c.

void explain_iocontrol_generic_print_explanation ( const explain_iocontrol_t p,
struct explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
)

The explain_iocontrol_generic_print_explanation function is used to print a generic (non-specific) explanation of an error return by an ioctl system call.

Parameters:
pioctl descriptor
sbwhere to print the explanation
errnumthe errno value to be explained
fildesoriginal fildes, exactly as passed to the ioctl system call
requestoriginal request, exactly as passed to the ioctl system call
dataoriginal data, exactly as passed to the ioctl system call

Definition at line 374 of file generic.c.

The explain_iocontrol_generic_print_hash_define function is used to turn an ioctl request number into the corresponding hash define, or what it could have looked like had a hash define been used.

Parameters:
sbThe string buffer to print into.
requestThe ioctl request number to be printed.

Definition at line 206 of file generic.c.

static void print_name ( const explain_iocontrol_t p,
explain_string_buffer_t sb,
int  errnum,
int  fildes,
int  request,
const void *  data 
) [static]

Definition at line 343 of file generic.c.


Variable Documentation

Initial value:

The explain_iocontrol_generic global variable is used to store information ablut the GENERIC I/O control.

Note:
This information is not kept in a single table for all values, like every other set of constants, because (a) some values are ambiguous, and (b) the includes files have bugs making it impossible to include all of them in the same combilation unit.

Definition at line 484 of file generic.c.