#include <vfs/vfs.h>
#include <vfs/file.h>
#include <ubixos/sched.h>
#include <ubixos/vitals.h>
#include <ubixos/kpanic.h>
#include <ubixos/spinlock.h>
#include <lib/kmalloc.h>
#include <lib/string.h>
#include <vmm/paging.h>
#include <lib/kprintf.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
| int | fclose (fileDescriptor *fd) |
| int | feof (fileDescriptor *fd) |
| int | fgetc (fileDescriptor *fd) |
| fileDescriptor * | fopen (const char *file, const char *flags) |
| int | fputc (int ch, fileDescriptor *fd) |
| size_t | fread (void *ptr, int size, int nmemb, fileDescriptor *fd) |
| int | fseek (fileDescriptor *tmpFd, long offset, int whence) |
| size_t | fwrite (void *ptr, int size, int nmemb, fileDescriptor *fd) |
| void | sysChDir (const char *path) |
| void | sysFclose (userFileDescriptor *userFd, int *status) |
| void | sysFgetc (int *ptr, userFileDescriptor *userFd) |
| void | sysFopen (const char *file, char *flags, userFileDescriptor *userFd) |
| void | sysFread (void *data, long size, userFileDescriptor *userFd) |
| void | sysFseek (userFileDescriptor *userFd, long offset, int whence) |
| void | sysFwrite (char *ptr, int size, userFileDescriptor *userFd) |
| void | sysMkDir (const char *path) |
| void | sysRmDir () |
| void | sysUnlink (const char *path, int *retVal) |
| int | unlink (const char *node) |
Variables | |
| fileDescriptor * | fdTable = 0x0 |
| static spinLock_t | fdTable_lock = SPIN_LOCK_INITIALIZER |
| int fclose | ( | fileDescriptor * | fd | ) |
Definition at line 396 of file file.c.
References assert, fdTable, fdTable_lock, kfree(), fileDescriptor::next, NULL, fileDescriptor::prev, spinLock(), spinUnlock(), systemVitals, and x1.
Referenced by dev_ramDestroy(), dev_ramDrive(), execFile(), kmod_load(), ldEnable(), bTree::Save(), sysExec(), sysFclose(), sysMkDir(), and systemTask().
| int feof | ( | fileDescriptor * | fd | ) |
| int fgetc | ( | fileDescriptor * | fd | ) |
| fileDescriptor* fopen | ( | const char * | file, | |
| const char * | flags | |||
| ) |
Definition at line 267 of file file.c.
References fdOpen, fdTable, fdTable_lock, fileAppend, fileBinary, fileRead, fileWrite, kfree(), kmalloc(), kprintf(), fileDescriptor::next, NULL, fileDescriptor::offset, fileDescriptor::prev, spinLock(), spinUnlock(), sprintf(), strstr(), strtok(), systemVitals, and vfs_findMount().
| int fputc | ( | int | ch, | |
| fileDescriptor * | fd | |||
| ) |
| size_t fread | ( | void * | ptr, | |
| int | size, | |||
| int | nmemb, | |||
| fileDescriptor * | fd | |||
| ) |
Definition at line 178 of file file.c.
References assert, and fileDescriptor::offset.
Referenced by dev_ramDrive(), execFile(), kmod_load(), ldEnable(), DiskFS::read(), sysExec(), and sysFread().
| int fseek | ( | fileDescriptor * | tmpFd, | |
| long | offset, | |||
| int | whence | |||
| ) |
Definition at line 201 of file file.c.
References fileDescriptor::offset.
Referenced by execFile(), kmod_load(), ldEnable(), DiskFS::read(), sysExec(), and DiskFS::write().
| size_t fwrite | ( | void * | ptr, | |
| int | size, | |||
| int | nmemb, | |||
| fileDescriptor * | fd | |||
| ) |
Definition at line 193 of file file.c.
References fileDescriptor::offset.
Referenced by dev_ramDestroy(), bTree::Save(), sysFwrite(), and DiskFS::write().
| void sysChDir | ( | const char * | path | ) |
Definition at line 102 of file file.c.
References _current, osInfo::cwd, taskStruct::oInfo, sprintf(), and strstr().
| void sysFclose | ( | userFileDescriptor * | userFd, | |
| int * | status | |||
| ) |
| void sysFgetc | ( | int * | ptr, | |
| userFileDescriptor * | userFd | |||
| ) |
Definition at line 59 of file file.c.
References _current, userFileDescriptorStruct::fd, fgetc(), getch(), sched_yield(), taskStruct::term, and tty_foreground.
| void sysFopen | ( | const char * | file, | |
| char * | flags, | |||
| userFileDescriptor * | userFd | |||
| ) |
Definition at line 122 of file file.c.
References userFileDescriptorStruct::fd, userFileDescriptorStruct::fdSize, fopen(), kprintf(), NULL, and fileDescriptorStruct::size.
| void sysFread | ( | void * | data, | |
| long | size, | |||
| userFileDescriptor * | userFd | |||
| ) |
| void sysFseek | ( | userFileDescriptor * | userFd, | |
| long | offset, | |||
| int | whence | |||
| ) |
Definition at line 92 of file file.c.
References userFileDescriptorStruct::fd, NULL, and fileDescriptorStruct::offset.
| void sysFwrite | ( | char * | ptr, | |
| int | size, | |||
| userFileDescriptor * | userFd | |||
| ) |
Definition at line 49 of file file.c.
References _current, userFileDescriptorStruct::fd, fwrite(), taskStruct::term, and tty_print().
| void sysMkDir | ( | const char * | path | ) |
| void sysUnlink | ( | const char * | path, | |
| int * | retVal | |||
| ) |
| int unlink | ( | const char * | node | ) |
Definition at line 478 of file file.c.
References vfs_mountPoint::fs, NULL, strtok(), vfs_findMount(), and fileSystem::vfsUnlink.
Referenced by sysUnlink().
| fileDescriptor* fdTable = 0x0 |
spinLock_t fdTable_lock = SPIN_LOCK_INITIALIZER [static] |
1.4.7