Header file that contains the definitions for system calls wrapper functions used in our program.
More...
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/types.h>
#include <stdlib.h>
#include <libgen.h>
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include "Logger.h"
Go to the source code of this file.
Header file that contains the definitions for system calls wrapper functions used in our program.
- Authors
- Maxime Lovino, Thomas Ibanez
- Date
- January 25, 2017
- Version
- 1.0
int saccess |
( |
char * |
path | ) |
|
|
inline |
access wrapper
- Parameters
-
- Returns
- 1 if the file exists, 0 otherwise
char* sbasename |
( |
char * |
fullPath | ) |
|
|
inline |
basename wrapper
- Parameters
-
fullPath | full path of the file |
- Returns
- basename of the file
int schdir |
( |
const char * |
name | ) |
|
|
inline |
chdir wrapper
- Parameters
-
- Returns
- 1 on success, 0 otherwise
int sclosedir |
( |
DIR * |
dp | ) |
|
|
inline |
closedir wrapper
- Parameters
-
- Returns
- 1 on success, 0 otherwise
fork wrapper
- Returns
- pid of the child or 0 if you are the child
int sgetgrgid |
( |
const char * |
groupName | ) |
|
|
inline |
getgrnam->gr_gid wrapper
- Parameters
-
groupName | groupname to get gid from |
- Returns
- gid linked to this groupname
int sgetpwuid |
( |
const char * |
userName | ) |
|
|
inline |
getpwnam->pw_uid wrapper
- Parameters
-
userName | the username to get uid from |
- Returns
- uid linked to the username
int slstat |
( |
const char * |
name, |
|
|
struct stat * |
statbuf |
|
) |
| |
|
inline |
lstat wrapper
- Parameters
-
name | file to check |
statbuf | buffer to write info to |
- Returns
- 1 on success, 0 otherwise
int smkdir |
( |
char * |
path | ) |
|
|
inline |
mkdir wrapper
- Parameters
-
- Returns
- 1 on success, 0 otherwise
DIR* sopendir |
( |
const char * |
name | ) |
|
|
inline |
opendir wrapper
- Parameters
-
- Returns
- DIR* to the directory
struct dirent* sreaddir |
( |
DIR * |
dir | ) |
|
readdir wrapper
- Parameters
-
- Returns
- dirent entries
char* srealpath |
( |
const char * |
p, |
|
|
char * |
buf |
|
) |
| |
|
inline |
realpath wrapper
- Parameters
-
p | file to get realpath from |
buf | buffer to write the realpath to (optional) |
- Returns
- if the buffer is NULL, return the realpath
int srmdir |
( |
char * |
path | ) |
|
|
inline |
rmdir wrapper
- Parameters
-
- Returns
- 1 on success, 0 otherwise
S_ISDIR wrapper
- Parameters
-
- Returns
- 1 if the file is a directory, 0 otherwise
S_ISLNK wrapper
- Parameters
-
- Returns
- 1 if the file is a link, 0 otherwise
S_ISREG wrapper
- Parameters
-
- Returns
- 1 if the file is a regular file, 0 otherwise
int ssymlink |
( |
char * |
target, |
|
|
char * |
linkPath |
|
) |
| |
|
inline |
symlink wrapper
- Parameters
-
target | real file |
linkPath | link path |
- Returns
- 1 on success, 0 otherwise
FILE* stouch |
( |
char * |
file | ) |
|
|
inline |
touch wrapper
- Parameters
-
- Returns
- FILE* to the file created
int sunlink |
( |
char * |
file | ) |
|
|
inline |
unlink wrapper
- Parameters
-
- Returns
- 1 on success, 0 otherwise