libexplain  1.4.D001
Functions
libexplain/fileinfo.h File Reference
#include <libexplain/ac/stddef.h>

Go to the source code of this file.

Functions

int explain_fileinfo_pid_fd_n (pid_t pid, int fildes, char *data, size_t data_size)
int explain_fileinfo_self_fd_n (int fildes, char *data, size_t data_size)
int explain_fileinfo_pid_cwd (pid_t pid, char *data, size_t data_size)
int explain_fileinfo_self_cwd (char *data, size_t data_size)
int explain_fileinfo_pid_exe (pid_t pid, char *data, size_t data_size)
int explain_fileinfo_self_exe (char *data, size_t data_size)
int explain_fileinfo_dir_tree_in_use (const char *dirpath)

Function Documentation

int explain_fileinfo_dir_tree_in_use ( const char *  dirpath)

The explain_fileinfo_dir_tree_in_use function is used to determine whether or not a given mount point still has files open.

Parameters:
dirpathThe absolute path of the diretory to be checked.
Returns:
-1 on error, 0 i niot in use, 1 if in use at least once

Definition at line 55 of file dir_tree_in_use.c.

int explain_fileinfo_pid_cwd ( pid_t  pid,
char *  data,
size_t  data_size 
)

The explain_fileinfo_pid_cwd function may be used to obtain the absolute path of the current working directory of the given process.

Parameters:
pidThe process ID of the process of interest.
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 82 of file pid_cwd.c.

int explain_fileinfo_pid_exe ( pid_t  pid,
char *  data,
size_t  data_size 
)

The explain_fileinfo_pid_exe function may be used to obtain the absolute path of the executable file of the given process.

Parameters:
pidThe process ID of the process of interest.
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 142 of file pid_exe.c.

int explain_fileinfo_pid_fd_n ( pid_t  pid,
int  fildes,
char *  data,
size_t  data_size 
)

The explain_fileinfo_pid_fd_n function may be used to obtain the path name of the file corresponding to the given process and given file descriptor.

Parameters:
pidThe process ID of interest.
fildesThe file descriptor of interest.
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 63 of file pid_fd_n.c.

int explain_fileinfo_self_cwd ( char *  data,
size_t  data_size 
)

The explain_fileinfo_self_cwd function may be used to obtain the absolute path of the current working directory of current process.

Parameters:
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 26 of file self_cwd.c.

int explain_fileinfo_self_exe ( char *  data,
size_t  data_size 
)

The explain_fileinfo_self_exe function may be used to obtain the absolute path of the executable file of the executing process.

Parameters:
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 26 of file self_exe.c.

int explain_fileinfo_self_fd_n ( int  fildes,
char *  data,
size_t  data_size 
)

The explain_fileinfo_self_fd_n function may be used to obtain the path name of the file corresponding to the given file descriptor.

Parameters:
fildesThe file descriptor of interest.
dataWhere to return the path.
data_sizeThe maximum size of the returned path.
Returns:
true (non-zero) on success, or false (zero) on error

Definition at line 26 of file self_fd_n.c.