UbixOS
2.0
|
#include <sys/descrip.h>
#include <sys/sysproto_posix.h>
#include <sys/thread.h>
#include <lib/kprintf.h>
#include <ubixos/endtask.h>
#include <lib/kmalloc.h>
#include <assert.h>
#include <sys/select.h>
#include <sys/ioctl.h>
Go to the source code of this file.
Functions | |
int | close (struct thread *td, struct close_args *uap) |
int | dup2 (struct thread *td, u_int32_t from, u_int32_t to) |
int | falloc (struct thread *td, struct file **resultfp, int *resultfd) |
int | fcntl (struct thread *td, struct sys_fcntl_args *uap) |
int | fdestroy (struct thread *td, struct file *fp, int fd) |
This destroys a thread local file descriptor. More... | |
int | fstat (struct thread *td, struct sys_fstat_args *uap) |
int | getdtablesize (struct thread *td, struct getdtablesize_args *uap) |
return data table size More... | |
int | getfd (struct thread *td, struct file **fp, int fd) |
get pointer to file fd in specified thread More... | |
int | ioctl (struct thread *td, struct ioctl_args *uap) |
ioctl functionality not implimented yet More... | |
int | sys_dup2 (struct thread *td, struct sys_dup2_args *args) |
int | sys_fcntl (struct thread *td, struct sys_fcntl_args *uap) |
int | sys_ioctl (struct thread *td, struct sys_ioctl_args *args) |
int | sys_select (struct thread *td, struct sys_select_args *args) |
int close | ( | struct thread * | td, |
struct close_args * | uap | ||
) |
Definition at line 161 of file descrip.c.
References close_args::fd, kfree(), kprintf(), thread::o_files, and thread::td_retval.
Definition at line 347 of file descrip.c.
References fileDescriptor::dup, fclose(), file::fd, fdestroy(), kmalloc(), kprintf(), MAX_FILES, memcpy(), and thread::o_files.
Referenced by sys_dup2().
Definition at line 97 of file descrip.c.
References kfree(), kmalloc(), MAX_FILES, and thread::o_files.
Referenced by kern_openat(), pipe(), sys_openat(), sys_pipe2(), and sys_socket().
int fcntl | ( | struct thread * | td, |
struct sys_fcntl_args * | uap | ||
) |
Definition at line 41 of file descrip.c.
References sys_fcntl_args::arg, sys_fcntl_args::cmd, file::f_flag, fclose(), FCNTLFLAGS, sys_fcntl_args::fd, fdestroy(), FFLAGS, kmalloc(), kprintf(), MAX_FILES, memcpy(), O_ACCMODE, thread::o_files, and thread::td_retval.
Referenced by sys_fcntl().
This destroys a thread local file descriptor.
This function will destroy the thread local file file specified as fd, for sanity it requires the file descriptor id and memory address to check before destroying.
td | Pointer to thread which initiated the syscall. |
fp | Pointer to the thread local file which you want to destroy. |
fd | File descriptor id that points to the thread local file which you want to destroy. |
0 | The function is successfully executed |
-1 | An error occurred |
Definition at line 147 of file descrip.c.
References file::fd, kfree(), and thread::o_files.
Referenced by dup2(), fcntl(), kern_openat(), sys_close(), sys_openat(), and sys_socket().
int fstat | ( | struct thread * | td, |
struct sys_fstat_args * | uap | ||
) |
Definition at line 184 of file descrip.c.
References _current, sys_fstat_args::fd, kprintf(), thread::o_files, sys_fstat_args::sb, stat::st_blksize, stat::st_mode, and taskStruct::td.
int getdtablesize | ( | struct thread * | td, |
struct getdtablesize_args * | uap | ||
) |
return data table size
Definition at line 175 of file descrip.c.
References kprintf(), O_FILES, and thread::td_retval.
get pointer to file fd in specified thread
Definition at line 213 of file descrip.c.
References file::fd, kprintf(), and thread::o_files.
Referenced by read(), sys_close(), sys_fchdir(), sys_fstat(), sys_fstatat(), sys_fstatfs(), sys_getdirentries(), sys_lseek(), sys_mmap(), sys_pread(), sys_read(), sys_sendto(), sys_setsockopt(), and sys_write().
int ioctl | ( | struct thread * | td, |
struct ioctl_args * | uap | ||
) |
ioctl functionality not implimented yet
Definition at line 203 of file descrip.c.
References thread::td_retval.
int sys_dup2 | ( | struct thread * | td, |
struct sys_dup2_args * | args | ||
) |
Definition at line 375 of file descrip.c.
References dup2(), sys_dup2_args::from, thread::td_retval, and sys_dup2_args::to.
int sys_fcntl | ( | struct thread * | td, |
struct sys_fcntl_args * | uap | ||
) |
int sys_ioctl | ( | struct thread * | td, |
struct sys_ioctl_args * | args | ||
) |
Definition at line 228 of file descrip.c.
References termios::c_cc, termios::c_cflag, termios::c_iflag, termios::c_ispeed, termios::c_lflag, termios::c_oflag, termios::c_ospeed, sys_ioctl_args::com, sys_ioctl_args::data, sys_ioctl_args::fd, kprintf(), thread::td_retval, TIOCGETA, TIOCGWINSZ, winsize::ws_col, and winsize::ws_row.
int sys_select | ( | struct thread * | td, |
struct sys_select_args * | args | ||
) |
Definition at line 284 of file descrip.c.
References sys_select_args::ex, sys_select_args::in, sys_select_args::nd, sys_select_args::ou, thread::td_retval, and sys_select_args::tv.