Main Page Modules Data Structures File List Data Fields Globals Related Pages

# lib/fs.c File Reference

More...

`#include "system.h"`
`#include <rpmlib.h>`
`#include <rpmmacro.h>`
`#include "debug.h"`

Go to the source code of this file.

## Data Structures

struct | fsinfo

## Functions

void | freeFilesystems (void)
int | getFilesystemList (void)
| Get information for mounted file systems. More...
int | rpmGetFilesystemList (const char ***listptr, int *num)
int | rpmGetFilesystemUsage (const char **fileList, int_32 *fssizes, int numFiles, uint_32 **usagesPtr, int flags)

## Variables

fsinfo * | filesystems = NULL
const char ** | fsnames = NULL
int | numFilesystems = 0

## Detailed Description

Definition in file fs.c.

## Function Documentation

void freeFilesystems | ( | void |  | ) |

| Definition at line 26 of file fs.c. References _free, fsnames, fsinfo::mntPoint, and numFilesystems. Referenced by getFilesystemList, and main.

int getFilesystemList | ( | void |  | ) | `[static]`

Get information for mounted file systems.

Todo:
  determine rdonly for non-linux file systems.

Returns:
  0 on success, 1 on error

Definition at line 135 of file fs.c.

References _, _free, errno, freeFilesystems, fsnames, getmntent, fsinfo::mntPoint, MOUNTED, numFilesystems, our_mntent::our_mntdir, strerror, xcalloc, xrealloc, and xstrdup.

Referenced by rpmGetFilesystemList, and rpmGetFilesystemUsage.

int rpmGetFilesystemList | ( | const char *** | listptr,
|  | int * | num
| ) |

| Definition at line 233 of file fs.c. References fsnames, getFilesystemList, and numFilesystems. Referenced by fsnamesTag, fssizesTag, and rpmtsInitDSI.

int rpmGetFilesystemUsage | ( | const char ** | fileList,
|  | int_32 * | fssizes,
|  | int | numFiles,
|  | uint_32 ** | usagesPtr,
|  | int | flags
| ) |

| Definition at line 247 of file fs.c. References _, _free, alloca, fsinfo::dev, errno, fsnames, getFilesystemList, int_32, numFilesystems, rpmGetPath, strerror, uint_32, and xcalloc. Referenced by fssizesTag.

## Variable Documentation

struct fsinfo* filesystems = NULL`[static]`

| Definition at line 20 of file fs.c.

const char** fsnames = NULL`[static]`

| Definition at line 22 of file fs.c. Referenced by freeFilesystems, getFilesystemList, rpmGetFilesystemList, and rpmGetFilesystemUsage.

int numFilesystems = 0`[static]`

| Definition at line 24 of file fs.c. Referenced by freeFilesystems, getFilesystemList, rpmGetFilesystemList, and rpmGetFilesystemUsage.