klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
file-creator.c File Reference
#include "klee-replay.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
#include <pty.h>
#include <time.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <assert.h>
Include dependency graph for file-creator.c:

Go to the source code of this file.

Macros

#define __STDIN   -1
 
#define __STDOUT   -2
 

Functions

static void create_file (int target_fd, const char *target_name, exe_disk_file_t *dfile, const char *tmpdir)
 
static void check_file (int index, exe_disk_file_t *file)
 
static void delete_file (const char *path, int recurse)
 
static int create_link (const char *fname, exe_disk_file_t *dfile, const char *tmpdir)
 
static int create_dir (const char *fname, exe_disk_file_t *dfile, const char *tmpdir)
 
double getTime ()
 
int wait_for_timeout_or_exit (pid_t pid, const char *name, int *statusp)
 Return true if program exited, false if timed out. More...
 
static int create_char_dev (const char *fname, exe_disk_file_t *dfile, const char *tmpdir)
 
static int create_pipe (const char *fname, exe_disk_file_t *dfile, const char *tmpdir)
 
static int create_reg_file (const char *fname, exe_disk_file_t *dfile, const char *tmpdir)
 
static int delete_dir (const char *path, int recurse)
 
void replay_create_files (exe_file_system_t *exe_fs)
 

Macro Definition Documentation

#define __STDIN   -1

Definition at line 35 of file file-creator.c.

Referenced by check_file(), and replay_create_files().

#define __STDOUT   -2

Definition at line 36 of file file-creator.c.

Referenced by check_file(), and replay_create_files().

Function Documentation

static void check_file ( int  index,
exe_disk_file_t *  file 
)
static

Definition at line 454 of file file-creator.c.

References __STDIN, and __STDOUT.

Referenced by replay_create_files().

Here is the caller graph for this function:

static int create_char_dev ( const char *  fname,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 93 of file file-creator.c.

References process_status(), and wait_for_timeout_or_exit().

Referenced by create_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static int create_dir ( const char *  fname,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 58 of file file-creator.c.

Referenced by create_file().

Here is the caller graph for this function:

static void create_file ( int  target_fd,
const char *  target_name,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 353 of file file-creator.c.

References create_char_dev(), create_dir(), create_link(), create_pipe(), create_reg_file(), and delete_file().

Referenced by create_link(), and replay_create_files().

Here is the call graph for this function:

Here is the caller graph for this function:

static int create_link ( const char *  fname,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 38 of file file-creator.c.

References create_file().

Referenced by create_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static int create_pipe ( const char *  fname,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 212 of file file-creator.c.

References process_status(), and wait_for_timeout_or_exit().

Referenced by create_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static int create_reg_file ( const char *  fname,
exe_disk_file_t *  dfile,
const char *  tmpdir 
)
static

Definition at line 273 of file file-creator.c.

Referenced by create_file().

Here is the caller graph for this function:

static int delete_dir ( const char *  path,
int  recurse 
)
static

Definition at line 315 of file file-creator.c.

References delete_file().

Referenced by delete_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static void delete_file ( const char *  path,
int  recurse 
)
static

Definition at line 342 of file file-creator.c.

References delete_dir().

Referenced by create_file(), delete_dir(), and replay_create_files().

Here is the call graph for this function:

Here is the caller graph for this function:

double getTime ( )

Definition at line 68 of file file-creator.c.

Referenced by wait_for_timeout_or_exit().

Here is the caller graph for this function:

void replay_create_files ( exe_file_system_t *  exe_fs)

Definition at line 418 of file file-creator.c.

References __STDIN, __STDOUT, check_file(), create_file(), and delete_file().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int wait_for_timeout_or_exit ( pid_t  pid,
const char *  name,
int *  statusp 
)

Return true if program exited, false if timed out.

Definition at line 76 of file file-creator.c.

References getTime().

Referenced by create_char_dev(), and create_pipe().

Here is the call graph for this function:

Here is the caller graph for this function: