sofs19
0.1
FUSE based file system
|
Corpus of system calls for evaluation
More...
Functions | |
int | soMknod (const char *path, mode_t mode) |
Create a regular file with size 0. More... | |
int | soLink (const char *path, const char *newPath) |
Make a new link to a file. More... | |
int | soUnlink (const char *path) |
Delete a link to a file from a directory and possibly the file it refers to from the file system. More... | |
int | soMkdir (const char *path, mode_t mode) |
Create a directory. More... | |
int | soRmdir (const char *path) |
Remove an existing directory. More... | |
int | soRead (const char *path, void *buff, uint32_t count, int32_t pos) |
Read data from an open regular file. More... | |
int | soWrite (const char *path, void *buff, uint32_t count, int32_t pos) |
Write data into an open regular file. More... | |
int | soRename (const char *path, const char *newPath) |
Change the name or the location of a file in the directory hierarchy of the file system. More... | |
int | soTruncate (const char *path, off_t length) |
Truncate a regular file to a specified length. More... | |
int | soReaddir (const char *path, void *buff, int32_t pos) |
Read a directory entry from a directory. More... | |
int | soSymlink (const char *effPath, const char *path) |
Creates a symbolic link which contains the given path. More... | |
int | soReadlink (const char *path, char *buff, size_t size) |
Read the value of a symbolic link. More... | |
Corpus of system calls for evaluation
int sofs19::soMknod | ( | const char * | path, |
mode_t | mode | ||
) |
Create a regular file with size 0.
It tries to emulate mknod system call, for regular files.
To get more information, execute in a terminal the command man 2 mknod
path | path to the file |
mode | permissions to be set |
mode
must be a bitwise combination of S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTHdirname(path)
must exist, be a directory, and write permission on it is requiredbasename(path)
must not exist within dirname(path)
direntry
named basename(path)
is added to dirname(path)
lnkcnt
of the inode associated to basename(path)
is updated in order to include the new incoming arcint sofs19::soLink | ( | const char * | path, |
const char * | newPath | ||
) |
Make a new link to a file.
It tries to emulate link system call.
To get more information, execute in a terminal the command man 2 link
path | path to an existing file |
newPath | new path to the same file |
path
must represent an existing regular file or symbolic linkdirname(newPath)
must exist, be a directory, and write permission on it is requiredbasename(newPath)
must not exist within dirname(newPath)
direntry
named basename(newPath)
is added to dirname(newPath)
lnkcnt
of the inode associated to basename(path)
is updated in order to include with the new incoming arcint sofs19::soUnlink | ( | const char * | path | ) |
Delete a link to a file from a directory and possibly the file it refers to from the file system.
It tries to emulate unlink system call.
To get more information, execute in a terminal the command man 2 unlink
path | path to the file to be deleted |
dirname(path)
must exist, be a directory, and write permission on it is requiredbasename(path)
must exist within dirname(path)
and must be a regular file or symbolic linkdirentry
named basename(path)
is deleted from dirname(path)
lnkcnt
of the inode associated to path
is updated in order to exclude the deleted incoming arclnkcnt
become zero:int sofs19::soMkdir | ( | const char * | path, |
mode_t | mode | ||
) |
Create a directory.
It tries to emulate mkdir system call.
To get more information, execute in a terminal the command man 2 mkdir
path | path to the file |
mode | permissions to be set |
mode
must be a bitwise combination of S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTHdirname(path)
must exist, be a directory, and write permission on it is requiredbase(path)
must not exist within dirname(path)
direntries
named
. and
.. are added to the child directory and, as a consequence, a data block is added, blkcnt
is set to 1, and size is set to BlockSize
direntry
named basename(path)
is added to dirname(path)
lnkcnt
of parent and child directories are updated in order to include the new incoming arcsint sofs19::soRmdir | ( | const char * | path | ) |
Remove an existing directory.
It tries to emulate rmdir system call.
To get more information, execute in a terminal the command man 2 rmdir
path | path to the directory to be deleted |
dirname(path)
must exist, be a directory, and write permission on it is requiredbasename(path)
must exist within dirname(path)
, be a directory and be emptydirentry
named basename(path)
is deleted from dirname(path)
lnkcnt
of the inode associated to dirname(path)
is updated in order to exclude the deleted incoming arcint sofs19::soRead | ( | const char * | path, |
void * | buff, | ||
uint32_t | count, | ||
int32_t | pos | ||
) |
Read data from an open regular file.
It tries to emulate read system call.
To get more information, execute in a terminal the command man 2 read
path | path to the file |
buff | pointer to the buffer where data to be read is to be stored |
count | number of bytes to be read |
pos | starting [byte] position in the file data continuum where data is to be read from |
path
atime
is updatedint sofs19::soWrite | ( | const char * | path, |
void * | buff, | ||
uint32_t | count, | ||
int32_t | pos | ||
) |
Write data into an open regular file.
It tries to emulate write system call.
To get more information, execute in a terminal the command man 2 write
path | path to the file |
buff | pointer to the buffer where data to be written is stored |
count | number of bytes to be written |
pos | starting [byte] position in the file data continuum where data is to be written into |
path
blkcnt
is updatedsize
of the inode can be updatedint sofs19::soRename | ( | const char * | path, |
const char * | newPath | ||
) |
Change the name or the location of a file in the directory hierarchy of the file system.
It tries to emulate rename system call.
To get more information, execute in a terminal the command man 2 rename
path | path to an existing file |
newPath | new path to the same file in replacement of the old one |
int sofs19::soTruncate | ( | const char * | path, |
off_t | length | ||
) |
Truncate a regular file to a specified length.
It tries to emulate truncate system call.
To get more information, execute in a terminal the command man 2 truncate
path | path to the file |
length | new size for the regular size |
int sofs19::soReaddir | ( | const char * | path, |
void * | buff, | ||
int32_t | pos | ||
) |
Read a directory entry from a directory.
It tries to emulate getdents system call, but it reads a single directory entry at a time.
Only the field name is read.
To get more information, execute in a terminal the command man readdir
path | path to the file |
buff | pointer to the buffer where data to be read is to be stored |
pos | starting [byte] position in the file data continuum where data is to be read from |
int sofs19::soSymlink | ( | const char * | effPath, |
const char * | path | ||
) |
Creates a symbolic link which contains the given path.
It tries to emulate symlink system call.
To get more information, execute in a terminal the command man 2 symlink
effPath | path to be stored in the symbolic link file |
path | path to the symbolic link to be created |
int sofs19::soReadlink | ( | const char * | path, |
char * | buff, | ||
size_t | size | ||
) |
Read the value of a symbolic link.
It tries to emulate readlink system call.
To get more information, execute in a terminal the command man 2 readlink
path | path to the symbolic link |
buff | pointer to the buffer where data to be read is to be stored |
size | buffer size in bytes |