Open SCAP Library

Data Structures | Macros | Functions
PROBEAUXAPI

## Data Structures
struct | fsdev_t
| Filesystem device structure. More...

## Macros
#define | MTAB_PATH "/etc/mtab"
#define | LOCAL_FILESYSTEMS
#define | FSDEV_H

## Functions
fsdev_t * | fsdev_init (const char **fs, size_t fs_cnt)
| Initialize the fsdev_t structure from an array of filesystem names.
fsdev_t * | fsdev_strinit (const char *fs_names)
| Initialize the fsdev_t structure from a string containing filesystem names.
void | fsdev_free (fsdev_t *lfs)
| Free the fsdev_t structure.
int | fsdev_search (fsdev_t *lfs, void *id)
| Search an id in the fsdev_t structure.
int | fsdev_path (fsdev_t *lfs, const char *path)
| Check whether a path points points to a place on any of the devices in the fsdev_t structure. More...
int | fsdev_fd (fsdev_t *lfs, int fd)
| Check whether a file descriptor is associated with a file that resides on any of the devices in the fsdev_t structure. More...
int | find_files (SEXP_t *spath, SEXP_t *sfilename, SEXP_t *behaviors, int(*cb)(const char *, const char *, void *), void *arg)
| Search the filesystem according to the specified path, filename and behaviors. More...

## Detailed Description

## Macro Definition Documentation

## ◆ LOCAL_FILESYSTEMS

#define LOCAL_FILESYSTEMS

Value:
{ "btrfs", \
"ext2", "ext3", "ext4", \
"ffs", \
"gfs", \
"hpfs", \
"jfs", \
"reiser4", "reiserfs", \
"ufs", \
"xfs", \
"zfs", NULL}

## Function Documentation

## ◆ find_files()

int find_files | ( | SEXP_t * | spath,
|  | SEXP_t * | sfilename,
|  | SEXP_t * | behaviors,
|  | int(*)(const char *, const char *, void *) | cb,
|  | void * | arg
| ) |  |

Search the filesystem according to the specified path, filename and behaviors.

For all paths and files that satisfy these requirements call the provided callback function.

Parameters

  path | the requested path in a sexp form, which may specify the matching operation or a var_ref
  filenam | the requested filename in a sexp form, which may specify the matching operation or a var_ref
  behaviors | the behaviors may specify the recursion depth or direction
  cb | for each match, the callback function cb is called with first argument being the matched path and the second being the matched filename
  arg | an optional argument to the callback function

## ◆ fsdev_fd()

int fsdev_fd | ( | fsdev_t * | lfs,
|  | int | fd
| ) |  |

Check whether a file descriptor is associated with a file that resides on any of the devices in the fsdev_t structure.

Parameters

  lfs | pointer to the fsdev_t structure
  fd | file descriptor

Return values

  1 | if found
  0 | otherwise
  -1 | error

## ◆ fsdev_path()

int fsdev_path | ( | fsdev_t * | lfs,
|  | const char * | path
| ) |  |

Check whether a path points points to a place on any of the devices in the fsdev_t structure.

Parameters

  lfs | pointer to the fsdev_t structure
  path | path

Return values

  1 | if found
  0 | otherwise
  -1 | error