pacemaker  2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
Macros | Functions
io.c File Reference
#include <crm_internal.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/resource.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <dirent.h>
#include <pwd.h>
#include <grp.h>
#include <crm/crm.h>
#include <crm/common/util.h>
Include dependency graph for io.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

void crm_build_path (const char *path_c, mode_t mode)
 Create a directory, including any parent directories needed. More...
 
char * generate_series_filename (const char *directory, const char *series, int sequence, gboolean bzip)
 
int get_last_sequence (const char *directory, const char *series)
 
void write_last_sequence (const char *directory, const char *series, int sequence, int max)
 
int crm_chown_last_sequence (const char *directory, const char *series, uid_t uid, gid_t gid)
 
bool pcmk__daemon_can_write (const char *dir, const char *file)
 
void crm_sync_directory (const char *name)
 
char * crm_read_contents (const char *filename)
 
int crm_write_sync (int fd, const char *contents)
 
int crm_set_nonblocking (int fd)
 
const char * crm_get_tmpdir ()
 
void pcmk__close_fds_in_child (bool all)
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 13 of file io.c.

Function Documentation

◆ crm_build_path()

void crm_build_path ( const char *  path_c,
mode_t  mode 
)

Create a directory, including any parent directories needed.

Parameters
[in]path_cPathname of the directory to create
[in]modePermissions to be used (with current umask) when creating
Note
This logs errors but does not return them to the caller.

Definition at line 42 of file io.c.

◆ crm_chown_last_sequence()

int crm_chown_last_sequence ( const char *  directory,
const char *  series,
uid_t  uid,
gid_t  gid 
)

Definition at line 216 of file io.c.

◆ crm_get_tmpdir()

const char* crm_get_tmpdir ( )

Definition at line 499 of file io.c.

◆ crm_read_contents()

char* crm_read_contents ( const char *  filename)

Definition at line 409 of file io.c.

◆ crm_set_nonblocking()

int crm_set_nonblocking ( int  fd)

Definition at line 485 of file io.c.

◆ crm_sync_directory()

void crm_sync_directory ( const char *  name)

Definition at line 372 of file io.c.

◆ crm_write_sync()

int crm_write_sync ( int  fd,
const char *  contents 
)

Definition at line 455 of file io.c.

◆ generate_series_filename()

char* generate_series_filename ( const char *  directory,
const char *  series,
int  sequence,
gboolean  bzip 
)

Definition at line 78 of file io.c.

◆ get_last_sequence()

int get_last_sequence ( const char *  directory,
const char *  series 
)

Definition at line 101 of file io.c.

◆ pcmk__close_fds_in_child()

void pcmk__close_fds_in_child ( bool  all)

Definition at line 517 of file io.c.

◆ pcmk__daemon_can_write()

bool pcmk__daemon_can_write ( const char *  dir,
const char *  file 
)

Definition at line 304 of file io.c.

◆ write_last_sequence()

void write_last_sequence ( const char *  directory,
const char *  series,
int  sequence,
int  max 
)

Definition at line 167 of file io.c.