dpkg 1.21.11
|
Data Structures | |
struct | file_stat |
Enumerations | |
enum | file_lock_flags { FILE_LOCK_NOWAIT , FILE_LOCK_WAIT } |
Functions | |
bool | file_is_exec (const char *filename) |
Check whether a filename is executable. More... | |
void | file_copy_perms (const char *src, const char *dst) |
Copy file ownership and permissions from one file to another. More... | |
int | file_slurp (const char *filename, struct varbuf *vb, struct dpkg_error *err) |
bool | file_is_locked (int lockfd, const char *filename) |
Check if a file has a lock acquired. More... | |
void | file_lock (int *lockfd, enum file_lock_flags flags, const char *filename, const char *filedesc) |
Lock a file. More... | |
void | file_unlock (int fd, const char *filename, const char *filedesc) |
Unlock a previously locked file. More... | |
void | file_show (const char *filename) |
enum file_lock_flags |
void file_copy_perms | ( | const char * | src, |
const char * | dst | ||
) |
bool file_is_exec | ( | const char * | filename | ) |
Check whether a filename is executable.
filename | The filename to check. |
Referenced by find_command().
bool file_is_locked | ( | int | lockfd, |
const char * | filename | ||
) |
Check if a file has a lock acquired.
lockfd | The file descriptor for the lock. |
filename | The file name associated to the file descriptor. |
void file_lock | ( | int * | lockfd, |
enum file_lock_flags | flags, | ||
const char * | filename, | ||
const char * | desc | ||
) |
Lock a file.
lockfd | The pointer to the lock file descriptor. It must be allocated statically as its addresses is passed to a cleanup handler. |
flags | The lock flags specifying what type of locking to perform. |
filename | The name of the file to lock. |
desc | The description of the file to lock. |
References setcloexec().
void file_show | ( | const char * | filename | ) |
References _, fd_fd_copy, internerr, ohshite(), pager_reap(), pager_spawn(), and dpkg_error::syserrno.
int file_slurp | ( | const char * | filename, |
struct varbuf * | vb, | ||
struct dpkg_error * | err | ||
) |
References _, dpkg_put_errno(), and varbuf_init().
Referenced by parse_filehash().
void file_unlock | ( | int | fd, |
const char * | filename, | ||
const char * | filedesc | ||
) |
Unlock a previously locked file.