UbixOS
2.0
|
#include <ubixos/sched.h>
#include <vfs/vfs.h>
#include <ubixos/vitals.h>
#include <ubixos/kpanic.h>
#include <ubixos/spinlock.h>
#include <lib/kmalloc.h>
#include <string.h>
#include <vmm/paging.h>
#include <lib/kprintf.h>
#include <assert.h>
#include <sys/descrip.h>
#include "../fat/fat_filelib.h"
Go to the source code of this file.
Functions | |
int | fclose (fileDescriptor_t *fd) |
int | feof (fileDescriptor_t *fd) |
int | fgetc (fileDescriptor_t *fd) |
fileDescriptor_t * | fopen (const char *file, const char *flags) |
int | fputc (int ch, fileDescriptor_t *fd) |
size_t | fread (void *ptr, size_t size, size_t nmemb, fileDescriptor_t *fd) |
int | fseek (fileDescriptor_t *tmpFd, long offset, int whence) |
size_t | fwrite (void *ptr, int size, int nmemb, fileDescriptor_t *fd) |
int | sys_chdir (struct thread *td, struct sys_chdir_args *args) |
int | sys_fchdir (struct thread *td, struct sys_fchdir_args *args) |
int | sys_fclose (struct thread *td, struct sys_fclose_args *args) |
int | sys_fgetc (struct thread *td, struct sys_fgetc_args *args) |
int | sys_fopen (struct thread *td, struct sys_fopen_args *args) |
int | sys_fread (struct thread *td, struct sys_fread_args *args) |
int | sys_fseek (struct thread *td, struct sys_fseek_args *args) |
int | sys_fwrite (struct thread *td, struct sys_fwrite_args *uap) |
int | sys_lseek (struct thread *td, struct sys_lseek_args *args) |
int | sys_rename (struct thread *td, struct sys_rename_args *args) |
void | sysFwrite (char *ptr, int size, userFileDescriptor *userFd) |
void | sysMkDir (const char *path) |
void | sysRmDir () |
int | sysUnlink (const char *path, int *retVal) |
int | unlink (const char *node) |
Variables | |
fileDescriptor_t * | fdTable = 0x0 |
fileDescriptor_t * | vfs_fileTable = 0x0 |
int fclose | ( | fileDescriptor_t * | fd | ) |
Definition at line 533 of file file.c.
References file::fd, and spinLock().
Referenced by _sys_stat(), dup2(), elf_load_file(), execFile(), fcntl(), kmod_load(), ldEnable(), sys_close(), sys_fclose(), sys_fstatat(), sysExec(), sysMkDir(), and systemTask().
int feof | ( | fileDescriptor_t * | fd | ) |
Definition at line 343 of file file.c.
References file::fd, fdEof, and fileDescriptor::status.
int fgetc | ( | fileDescriptor_t * | fd | ) |
Definition at line 372 of file file.c.
References file::fd, vfs_mountPoint::fs, kprintf(), fileDescriptor::mp, fileDescriptor::offset, and fileSystem::vfsRead.
Referenced by sys_fgetc().
fileDescriptor_t* fopen | ( | const char * | file, |
const char * | flags | ||
) |
Definition at line 395 of file file.c.
References _current, fileDescriptor::buffer, osInfo::cwd, file, fileAppend, fileBinary, fileDescriptor::fileName, fileRead, fileWrite, vfs_mountPoint::fs, kfree(), kmalloc(), kprintf(), memset(), fileDescriptor::mode, fileDescriptor::mp, NULL, taskStruct::oInfo, spinUnlock(), sprintf(), strcpy(), strstr(), strtok(), vfs_findMount(), and fileSystem::vfsOpenFile.
Referenced by _sys_stat(), elf_load_file(), execFile(), kern_openat(), kmod_load(), ldEnable(), sys_fopen(), sys_fstatat(), sys_openat(), sys_statfs(), sysExec(), sysMkDir(), and tcpdump_init().
int fputc | ( | int | ch, |
fileDescriptor_t * | fd | ||
) |
Definition at line 356 of file file.c.
References file::fd, vfs_mountPoint::fs, fileDescriptor::mp, fileDescriptor::offset, and fileSystem::vfsWrite.
size_t fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
fileDescriptor_t * | fd | ||
) |
Definition at line 297 of file file.c.
References assert, file::fd, vfs_mountPoint::fs, fileDescriptor::mp, fileDescriptor::offset, and fileSystem::vfsRead.
Referenced by elf_load_file(), execFile(), kmod_load(), ldEnable(), read(), sys_fread(), sys_getdirentries(), sys_mmap(), sys_pread(), sys_read(), and sysExec().
int fseek | ( | fileDescriptor_t * | tmpFd, |
long | offset, | ||
int | whence | ||
) |
Definition at line 332 of file file.c.
Referenced by elf_load_file(), execFile(), kmod_load(), ldEnable(), sys_mmap(), and sysExec().
size_t fwrite | ( | void * | ptr, |
int | size, | ||
int | nmemb, | ||
fileDescriptor_t * | fd | ||
) |
Definition at line 317 of file file.c.
Referenced by sys_fwrite(), sys_write(), and sysFwrite().
int sys_chdir | ( | struct thread * | td, |
struct sys_chdir_args * | args | ||
) |
Definition at line 192 of file file.c.
References _current, osInfo::cwd, taskStruct::oInfo, sys_chdir_args::path, sprintf(), strstr(), and thread::td_retval.
int sys_fchdir | ( | struct thread * | td, |
struct sys_fchdir_args * | args | ||
) |
Definition at line 203 of file file.c.
References _current, osInfo::cwd, file::fd, sys_fchdir_args::fd, fileDescriptor::fileName, getfd(), taskStruct::oInfo, sprintf(), and strstr().
int sys_fclose | ( | struct thread * | td, |
struct sys_fclose_args * | args | ||
) |
Definition at line 283 of file file.c.
References fclose(), userFileDescriptorStruct::fd, sys_fclose_args::FILE, and NULL.
int sys_fgetc | ( | struct thread * | td, |
struct sys_fgetc_args * | args | ||
) |
Definition at line 81 of file file.c.
References _current, userFileDescriptorStruct::fd, fgetc(), sys_fgetc_args::FILE, getchar(), sched_yield(), thread::td_retval, taskStruct::term, and tty_foreground.
int sys_fopen | ( | struct thread * | td, |
struct sys_fopen_args * | args | ||
) |
Definition at line 243 of file file.c.
References userFileDescriptorStruct::fd, userFileDescriptorStruct::fdSize, sys_fopen_args::FILE, fopen(), kprintf(), sys_fopen_args::mode, NULL, sys_fopen_args::path, and fileDescriptor::size.
int sys_fread | ( | struct thread * | td, |
struct sys_fread_args * | args | ||
) |
Definition at line 264 of file file.c.
References userFileDescriptorStruct::fd, sys_fread_args::FILE, fread(), sys_fread_args::nmemb, NULL, sys_fread_args::ptr, sys_fread_args::size, and thread::td_retval.
int sys_fseek | ( | struct thread * | td, |
struct sys_fseek_args * | args | ||
) |
Definition at line 124 of file file.c.
References userFileDescriptorStruct::fd, sys_fseek_args::FILE, kprintf(), NULL, fileDescriptor::offset, sys_fseek_args::offset, thread::td_retval, and sys_fseek_args::whence.
int sys_fwrite | ( | struct thread * | td, |
struct sys_fwrite_args * | uap | ||
) |
Definition at line 49 of file file.c.
References _current, sys_fwrite_args::buf, userFileDescriptorStruct::fd, sys_fwrite_args::fd, fwrite(), kprintf(), sys_fwrite_args::nbytes, thread::td_retval, taskStruct::term, and tty_print().
int sys_lseek | ( | struct thread * | td, |
struct sys_lseek_args * | args | ||
) |
Definition at line 154 of file file.c.
References file::fd, sys_lseek_args::fd, getfd(), kprintf(), fileDescriptor::offset, sys_lseek_args::offset, SEEK_CUR, SEEK_SET, thread::td_retval, and sys_lseek_args::whence.
int sys_rename | ( | struct thread * | td, |
struct sys_rename_args * | args | ||
) |
Definition at line 226 of file file.c.
References thread::td_retval.
void sysFwrite | ( | char * | ptr, |
int | size, | ||
userFileDescriptor * | userFd | ||
) |
Definition at line 71 of file file.c.
References _current, userFileDescriptorStruct::fd, fwrite(), taskStruct::term, and tty_print().
void sysMkDir | ( | const char * | path | ) |
Definition at line 587 of file file.c.
References _current, osInfo::cwd, fclose(), fopen(), vfs_mountPoint::fs, kprintf(), fileDescriptor::mp, NULL, taskStruct::oInfo, sprintf(), strstr(), strtok(), and fileSystem::vfsMakeDir.
fileDescriptor_t* fdTable = 0x0 |
fileDescriptor_t* vfs_fileTable = 0x0 |