pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
io.c File Reference
#include <crm_internal.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.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 ()
 

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 11 of file io.c.

Function Documentation

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 39 of file io.c.

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

Definition at line 217 of file io.c.

const char* crm_get_tmpdir ( void  )

Definition at line 500 of file io.c.

char* crm_read_contents ( const char *  filename)

Definition at line 410 of file io.c.

int crm_set_nonblocking ( int  fd)

Definition at line 486 of file io.c.

void crm_sync_directory ( const char *  name)

Definition at line 373 of file io.c.

int crm_write_sync ( int  fd,
const char *  contents 
)

Definition at line 456 of file io.c.

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

Definition at line 75 of file io.c.

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

Definition at line 102 of file io.c.

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

Definition at line 305 of file io.c.

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

Definition at line 168 of file io.c.