dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Collaboration diagram for File handling:

Data Structures

struct  file_stat
 

Enumerations

enum  file_lock_flags { FILE_LOCK_NOWAIT , FILE_LOCK_WAIT }
 

Functions

void file_getcwd (struct varbuf *cwd)
 Get the current working directory.
 
ssize_t file_readlink (const char *slink, struct varbuf *content, size_t content_len)
 Read the symlink content into a varbuf.
 
bool file_is_exec (const char *filename)
 Check whether a filename is executable.
 
void file_copy_perms (const char *src, const char *dst)
 Copy file ownership and permissions from one file to another.
 
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.
 
void file_lock (int *lockfd, enum file_lock_flags flags, const char *filename, const char *filedesc)
 Lock a file.
 
void file_unlock (int fd, const char *filename, const char *filedesc)
 Unlock a previously locked file.
 
void file_show (const char *filename)
 

Detailed Description

Enumeration Type Documentation

◆ file_lock_flags

Enumerator
FILE_LOCK_NOWAIT 
FILE_LOCK_WAIT 

Function Documentation

◆ file_copy_perms()

void file_copy_perms ( const char *  src,
const char *  dst 
)

Copy file ownership and permissions from one file to another.

Parameters
srcThe source filename.
dstThe destination filename.

References _, and ohshite().

Here is the call graph for this function:

◆ file_getcwd()

void file_getcwd ( struct varbuf cwd)

Get the current working directory.

References varbuf::buf, varbuf::size, varbuf_grow(), varbuf_reset(), and varbuf_trunc().

Here is the call graph for this function:

◆ file_is_exec()

bool file_is_exec ( const char *  filename)

Check whether a filename is executable.

Parameters
filenameThe filename to check.

Referenced by command_in_path().

Here is the caller graph for this function:

◆ file_is_locked()

bool file_is_locked ( int  lockfd,
const char *  filename 
)

Check if a file has a lock acquired.

Parameters
lockfdThe file descriptor for the lock.
filenameThe file name associated to the file descriptor.

References _, and ohshit().

Referenced by modstatdb_is_locked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_lock()

void file_lock ( int *  lockfd,
enum file_lock_flags  flags,
const char *  filename,
const char *  desc 
)

Lock a file.

Parameters
lockfdThe pointer to the lock file descriptor. It must be allocated statically as its addresses is passed to a cleanup handler.
flagsThe lock flags specifying what type of locking to perform.
filenameThe name of the file to lock.
descThe description of the file to lock.

References _, C_, dpkg_get_pid_execname(), FILE_LOCK_WAIT, ohshit(), ohshite(), push_cleanup(), and setcloexec().

Referenced by modstatdb_lock(), and trigdef_update_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_readlink()

ssize_t file_readlink ( const char *  slink,
struct varbuf content,
size_t  content_len 
)

Read the symlink content into a varbuf.

References varbuf::buf, varbuf::size, varbuf_grow(), varbuf_reset(), and varbuf_trunc().

Referenced by conffderef(), and tarobject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_show()

void file_show ( const char *  filename)

References _, fd_fd_copy, internerr, ohshite(), pager_reap(), pager_spawn(), dpkg_error::syserrno, and dpkg_error::type.

Here is the call graph for this function:

◆ file_slurp()

int file_slurp ( const char *  filename,
struct varbuf vb,
struct dpkg_error err 
)

References _, dpkg_put_errno(), and varbuf_init().

Referenced by dpkg_get_pid_execname(), ensure_packagefiles_available(), and parse_filehash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_unlock()

void file_unlock ( int  fd,
const char *  filename,
const char *  filedesc 
)

Unlock a previously locked file.

References _, internerr, and ohshite().

Here is the call graph for this function: