UbixOS  2.0
sysproto_posix.h File Reference
#include <sys/signal.h>
#include <sys/thread.h>
#include <vfs/file.h>
Include dependency graph for sysproto_posix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  access_args
 
struct  close_args
 
struct  fcntl_args
 
struct  getdtablesize_args
 
struct  getgid_args
 
struct  getpid_args
 
struct  gettimeofday_args
 
struct  getuid_args
 
struct  ioctl_args
 
struct  mprotect_args
 
struct  obreak_args
 
struct  pipe_args
 
struct  read_args
 
struct  readlink_args
 
struct  setitimer_args
 
struct  sigaction_args
 
struct  sigprocmask_args
 
struct  sys_access_args
 
struct  sys_chdir_args
 
struct  sys_close_args
 
struct  sys_dup2_args
 
struct  sys_execve_args
 
struct  sys_exit_args
 
struct  sys_fchdir_args
 
struct  sys_fclose_args
 
struct  sys_fcntl_args
 
struct  sys_fgetc_args
 
struct  sys_fopen_args
 
struct  sys_fork_args
 
struct  sys_fread_args
 
struct  sys_fseek_args
 
struct  sys_fstat_args
 
struct  sys_fstatat_args
 
struct  sys_fstatfs_args
 
struct  sys_getcwd_args
 
struct  sys_getdirentries_args
 
struct  sys_getegid_args
 
struct  sys_geteuid_args
 
struct  sys_getlogin_args
 
struct  sys_getpgrp_args
 
struct  sys_getpid_args
 
struct  sys_getppid_args
 
struct  sys_getrlimit_args
 
struct  sys_gettimeofday_args
 
struct  sys_ioctl_args
 
struct  sys_issetugid_args
 
struct  sys_lseek_args
 
struct  sys_lstat_args
 
struct  sys_mmap_args
 
struct  sys_munmap_args
 
struct  sys_open_args
 
struct  sys_openat_args
 
struct  sys_pipe2_args
 
struct  sys_pread_args
 
struct  sys_read_args
 
struct  sys_readlink_args
 
struct  sys_rename_args
 
struct  sys_select_args
 
struct  sys_sendto_args
 
struct  sys_setGID_args
 
struct  sys_setlogin_args
 
struct  sys_setpgid_args
 
struct  sys_setrlimit_args
 
struct  sys_setsockopt_args
 
struct  sys_setUID_args
 
struct  sys_sigaction_args
 
struct  sys_sigprocmask_args
 
struct  sys_socket_args
 
struct  sys_stat_args
 
struct  sys_statfs_args
 
struct  sys_sysarch_args
 
struct  sys_sysctl_args
 
struct  sys_unlink_args
 
struct  sys_wait4_args
 
struct  sys_write_args
 
struct  sysctl_args
 

Macros

#define PAD_(t)   (sizeof(register_t) <= sizeof(t) ? 0 : sizeof(register_t) - sizeof(t))
 
#define PADL_(t)   0
 
#define PADR_(t)   PAD_(t)
 

Typedefs

typedef int register_t
 

Functions

int access (struct thread *td, struct access_args *uap)
 
int fstatfs (struct thread *td, struct sys_fstatfs_args *uap)
 
int mprotect (struct thread *td, struct mprotect_args *uap)
 
int setitimer (struct thread *td, struct setitimer_args *uap)
 place holder for now functionality to be added later More...
 
int sys_access (struct thread *td, struct sys_access_args *)
 
int sys_chdir (struct thread *td, struct sys_chdir_args *)
 
int sys_close (struct thread *td, struct sys_close_args *)
 
int sys_dup2 (struct thread *, struct sys_dup2_args *)
 
int sys_execve (struct thread *td, struct sys_execve_args *)
 
int sys_exit (struct thread *, struct sys_exit_args *)
 
int sys_fchdir (struct thread *td, struct sys_fchdir_args *)
 
int sys_fclose (struct thread *td, struct sys_fclose_args *)
 
int sys_fcntl (struct thread *td, struct sys_fcntl_args *)
 
int sys_fgetc (struct thread *td, struct sys_fgetc_args *)
 
int sys_fopen (struct thread *td, struct sys_fopen_args *)
 
int sys_fork (struct thread *, struct sys_fork_args *)
 
int sys_fread (struct thread *td, struct sys_fread_args *)
 
int sys_fseek (struct thread *td, struct sys_fseek_args *)
 
int sys_fstat (struct thread *td, struct sys_fstat_args *)
 
int sys_fstatat (struct thread *td, struct sys_fstatat_args *)
 
int sys_fstatfs (struct thread *td, struct sys_fstatfs_args *)
 
int sys_getcwd (struct thread *td, struct sys_getcwd_args *)
 
int sys_getdirentries (struct thread *td, struct sys_getdirentries_args *)
 
int sys_getegid (struct thread *td, struct sys_getegid_args *)
 
int sys_geteuid (struct thread *td, struct sys_geteuid_args *)
 
int sys_getGID (struct thread *td, void *)
 
int sys_getlogin (struct thread *, struct sys_getlogin_args *)
 
int sys_getpgrp (struct thread *td, struct sys_getpgrp_args *)
 
int sys_getpid (struct thread *td, struct sys_getpid_args *)
 
int sys_getppid (struct thread *td, struct sys_getppid_args *)
 
int sys_getrlimit (struct thread *, struct sys_getrlimit_args *)
 
int sys_gettimeofday (struct thread *td, struct sys_gettimeofday_args *)
 
int sys_getUID (struct thread *td, void *)
 
int sys_invalid (struct thread *, void *)
 
int sys_ioctl (struct thread *td, struct sys_ioctl_args *)
 
int sys_issetugid (struct thread *td, struct sys_issetugid_args *)
 
int sys_lseek (struct thread *td, struct sys_lseek_args *)
 
int sys_lstat (struct thread *td, struct sys_lstat_args *)
 
int sys_mmap (struct thread *td, struct sys_mmap_args *)
 
int sys_munmap (struct thread *td, struct sys_munmap_args *)
 
int sys_open (struct thread *td, struct sys_open_args *)
 
int sys_openat (struct thread *td, struct sys_openat_args *)
 
int sys_pipe2 (struct thread *, struct sys_pipe2_args *)
 
int sys_pread (struct thread *td, struct sys_pread_args *)
 
int sys_read (struct thread *, struct sys_read_args *)
 
int sys_readlink (struct thread *, struct sys_readlink_args *)
 
int sys_rename (struct thread *td, struct sys_rename_args *)
 
int sys_sched_yield (struct thread *td, void *)
 
int sys_select (struct thread *td, struct sys_select_args *)
 
int sys_sendto (struct thread *td, struct sys_sendto_args *)
 
int sys_setGID (struct thread *td, struct sys_setGID_args *)
 
int sys_setlogin (struct thread *, struct sys_setlogin_args *)
 
int sys_setpgid (struct thread *td, struct sys_setpgid_args *)
 
int sys_setpgrp (struct thread *td, struct sys_setpgid_args *)
 
int sys_setrlimit (struct thread *, struct sys_setrlimit_args *)
 
int sys_setsockopt (struct thread *td, struct sys_setsockopt_args *)
 
int sys_setUID (struct thread *td, struct sys_setUID_args *)
 
int sys_sigaction (struct thread *td, struct sys_sigaction_args *)
 
int sys_sigprocmask (struct thread *td, struct sys_sigprocmask_args *)
 
int sys_socket (struct thread *td, struct sys_socket_args *)
 
int sys_stat (struct thread *td, struct sys_stat_args *)
 
int sys_statfs (struct thread *td, struct sys_statfs_args *args)
 
int sys_sysarch (struct thread *td, struct sys_sysarch_args *)
 
int sys_sysctl (struct thread *td, struct sys_sysctl_args *)
 
int sys_unlink (struct thread *, struct sys_unlink_args *)
 
int sys_wait4 (struct thread *td, struct sys_wait4_args *)
 
int sys_write (struct thread *td, struct sys_write_args *)
 

Macro Definition Documentation

◆ PAD_

#define PAD_ (   t)    (sizeof(register_t) <= sizeof(t) ? 0 : sizeof(register_t) - sizeof(t))

Definition at line 40 of file sysproto_posix.h.

◆ PADL_

#define PADL_ (   t)    0

Definition at line 43 of file sysproto_posix.h.

◆ PADR_

#define PADR_ (   t)    PAD_(t)

Definition at line 44 of file sysproto_posix.h.

Typedef Documentation

◆ register_t

typedef int register_t

Definition at line 38 of file sysproto_posix.h.

Function Documentation

◆ access()

int access ( struct thread td,
struct access_args uap 
)

Definition at line 130 of file gen_calls.c.

References kprintf(), and access_args::path.

Here is the call graph for this function:

◆ fstatfs()

int fstatfs ( struct thread td,
struct sys_fstatfs_args uap 
)

◆ mprotect()

int mprotect ( struct thread td,
struct mprotect_args uap 
)

Definition at line 136 of file gen_calls.c.

◆ setitimer()

int setitimer ( struct thread td,
struct setitimer_args uap 
)

place holder for now functionality to be added later

Definition at line 124 of file gen_calls.c.

◆ sys_access()

int sys_access ( struct thread td,
struct sys_access_args  
)

Definition at line 364 of file vfs_calls.c.

References thread::td_retval.

◆ sys_chdir()

int sys_chdir ( struct thread td,
struct sys_chdir_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.

Here is the call graph for this function:

◆ sys_close()

int sys_close ( struct thread td,
struct sys_close_args  
)

◆ sys_dup2()

int sys_dup2 ( struct thread ,
struct sys_dup2_args  
)

Definition at line 375 of file descrip.c.

References dup2(), sys_dup2_args::from, thread::td_retval, and sys_dup2_args::to.

Here is the call graph for this function:

◆ sys_execve()

int sys_execve ( struct thread td,
struct sys_execve_args  
)

Definition at line 33 of file execve.c.

References sys_execve_args::argv, sys_execve_args::envp, sys_execve_args::fname, sys_exec(), and thread::td_retval.

Here is the call graph for this function:

◆ sys_exit()

int sys_exit ( struct thread ,
struct sys_exit_args  
)

Definition at line 45 of file gen_calls.c.

References _current, endTask(), and taskStruct::id.

Here is the call graph for this function:

◆ sys_fchdir()

int sys_fchdir ( struct thread td,
struct sys_fchdir_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().

Here is the call graph for this function:

◆ sys_fclose()

int sys_fclose ( struct thread td,
struct sys_fclose_args  
)

Definition at line 283 of file file.c.

References fclose(), userFileDescriptorStruct::fd, sys_fclose_args::FILE, and NULL.

Here is the call graph for this function:

◆ sys_fcntl()

int sys_fcntl ( struct thread td,
struct sys_fcntl_args  
)

Definition at line 93 of file descrip.c.

References fcntl().

Here is the call graph for this function:

◆ sys_fgetc()

int sys_fgetc ( struct thread td,
struct sys_fgetc_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.

Here is the call graph for this function:

◆ sys_fopen()

int sys_fopen ( struct thread td,
struct sys_fopen_args  
)

◆ sys_fork()

◆ sys_fread()

int sys_fread ( struct thread td,
struct sys_fread_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.

Here is the call graph for this function:

◆ sys_fseek()

int sys_fseek ( struct thread td,
struct sys_fseek_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.

Here is the call graph for this function:

◆ sys_fstat()

◆ sys_fstatat()

◆ sys_fstatfs()

◆ sys_getcwd()

int sys_getcwd ( struct thread td,
struct sys_getcwd_args  
)

Definition at line 204 of file syscall.c.

References _current, sys_getcwd_args::buf, osInfo::cwd, taskStruct::oInfo, sprintf(), and strlen().

Here is the call graph for this function:

◆ sys_getdirentries()

int sys_getdirentries ( struct thread td,
struct sys_getdirentries_args  
)

Definition at line 371 of file vfs_calls.c.

References sys_getdirentries_args::buf, sys_getdirentries_args::count, DEV_BSIZE, file::fd, sys_getdirentries_args::fd, fread(), getfd(), and thread::td_retval.

Here is the call graph for this function:

◆ sys_getegid()

int sys_getegid ( struct thread td,
struct sys_getegid_args  
)

Definition at line 233 of file gen_calls.c.

References _current, taskStruct::gid, and thread::td_retval.

◆ sys_geteuid()

int sys_geteuid ( struct thread td,
struct sys_geteuid_args  
)

Definition at line 228 of file gen_calls.c.

References _current, thread::td_retval, and taskStruct::uid.

◆ sys_getGID()

int sys_getGID ( struct thread td,
void *   
)

Definition at line 59 of file access.c.

◆ sys_getlogin()

int sys_getlogin ( struct thread ,
struct sys_getlogin_args  
)

Definition at line 360 of file gen_calls.c.

References _current, memcpy(), sys_getlogin_args::namebuf, sys_getlogin_args::namelen, and taskStruct::username.

Here is the call graph for this function:

◆ sys_getpgrp()

int sys_getpgrp ( struct thread td,
struct sys_getpgrp_args  
)

Definition at line 310 of file gen_calls.c.

References _current, taskStruct::pgrp, and thread::td_retval.

◆ sys_getpid()

int sys_getpid ( struct thread td,
struct sys_getpid_args  
)

Definition at line 224 of file gen_calls.c.

References _current, taskStruct::id, and thread::td_retval.

◆ sys_getppid()

int sys_getppid ( struct thread td,
struct sys_getppid_args  
)

Definition at line 238 of file gen_calls.c.

References _current, taskStruct::ppid, and thread::td_retval.

◆ sys_getrlimit()

int sys_getrlimit ( struct thread ,
struct sys_getrlimit_args  
)

Definition at line 376 of file gen_calls.c.

References kprintf(), thread::rlim, rlimit::rlim_cur, rlimit::rlim_max, sys_getrlimit_args::rlp, and sys_getrlimit_args::which.

Here is the call graph for this function:

◆ sys_gettimeofday()

int sys_gettimeofday ( struct thread td,
struct sys_gettimeofday_args  
)

Definition at line 354 of file gen_calls.c.

References gettimeofday(), thread::td_retval, sys_gettimeofday_args::tp, and sys_gettimeofday_args::tzp.

Here is the call graph for this function:

◆ sys_getUID()

int sys_getUID ( struct thread td,
void *   
)

Definition at line 51 of file access.c.

◆ sys_invalid()

int sys_invalid ( struct thread ,
void *   
)

Definition at line 141 of file gen_calls.c.

References _current, thread::frame, taskStruct::id, kprintf(), thread::td_retval, and trapframe::tf_eax.

Here is the call graph for this function:

◆ sys_ioctl()

◆ sys_issetugid()

int sys_issetugid ( struct thread td,
struct sys_issetugid_args  
)

◆ sys_lseek()

int sys_lseek ( struct thread td,
struct sys_lseek_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.

Here is the call graph for this function:

◆ sys_lstat()

int sys_lstat ( struct thread td,
struct sys_lstat_args  
)

Definition at line 297 of file stat.c.

References _sys_stat(), sys_lstat_args::path, sys_lstat_args::sb, STAT_LSTAT, and thread::td_retval.

Here is the call graph for this function:

◆ sys_mmap()

◆ sys_munmap()

int sys_munmap ( struct thread td,
struct sys_munmap_args  
)

Definition at line 155 of file vmm_mmap.c.

References thread::td_retval.

◆ sys_open()

int sys_open ( struct thread td,
struct sys_open_args  
)

Definition at line 39 of file vfs_calls.c.

References AT_FDCWD, sys_open_args::flags, kern_openat(), kprintf(), sys_open_args::mode, and sys_open_args::path.

Here is the call graph for this function:

◆ sys_openat()

int sys_openat ( struct thread td,
struct sys_openat_args  
)

Definition at line 45 of file vfs_calls.c.

References falloc(), file::fd, fdestroy(), sys_openat_args::flag, fopen(), kprintf(), O_RDWR, O_WRONLY, sys_openat_args::path, and thread::td_retval.

Here is the call graph for this function:

◆ sys_pipe2()

int sys_pipe2 ( struct thread ,
struct sys_pipe2_args  
)

Definition at line 36 of file kern_pipe.c.

References file::data, falloc(), file::fd_type, sys_pipe2_args::fildes, kmalloc(), memset(), pipeInfo::rFD, pipeInfo::rfdCNT, thread::td_retval, pipeInfo::wFD, and pipeInfo::wfdCNT.

Here is the call graph for this function:

◆ sys_pread()

int sys_pread ( struct thread td,
struct sys_pread_args  
)

◆ sys_read()

◆ sys_readlink()

int sys_readlink ( struct thread ,
struct sys_readlink_args  
)

Definition at line 387 of file vfs_calls.c.

References sys_readlink_args::count, kprintf(), sys_readlink_args::path, and thread::td_retval.

Here is the call graph for this function:

◆ sys_rename()

int sys_rename ( struct thread td,
struct sys_rename_args  
)

Definition at line 226 of file file.c.

References thread::td_retval.

◆ sys_sched_yield()

int sys_sched_yield ( struct thread td,
void *   
)

Definition at line 224 of file syscall.c.

References sched_yield().

Here is the call graph for this function:

◆ sys_select()

int sys_select ( struct thread td,
struct sys_select_args  
)

◆ sys_sendto()

int sys_sendto ( struct thread td,
struct sys_sendto_args  
)

◆ sys_setGID()

int sys_setGID ( struct thread td,
struct sys_setGID_args  
)

Definition at line 63 of file access.c.

◆ sys_setlogin()

int sys_setlogin ( struct thread ,
struct sys_setlogin_args  
)

Definition at line 368 of file gen_calls.c.

References _current, memcpy(), sys_setlogin_args::namebuf, and taskStruct::username.

Here is the call graph for this function:

◆ sys_setpgid()

int sys_setpgid ( struct thread td,
struct sys_setpgid_args  
)

Definition at line 315 of file gen_calls.c.

References _current, taskStruct::id, sys_setpgid_args::pgid, taskStruct::pgrp, sys_setpgid_args::pid, schedFindTask(), and thread::td_retval.

Here is the call graph for this function:

◆ sys_setpgrp()

int sys_setpgrp ( struct thread td,
struct sys_setpgid_args  
)

◆ sys_setrlimit()

int sys_setrlimit ( struct thread ,
struct sys_setrlimit_args  
)

Definition at line 450 of file gen_calls.c.

References kprintf(), thread::rlim, rlimit::rlim_cur, rlimit::rlim_max, sys_setrlimit_args::rlp, and sys_setrlimit_args::which.

Here is the call graph for this function:

◆ sys_setsockopt()

int sys_setsockopt ( struct thread td,
struct sys_setsockopt_args  
)

◆ sys_setUID()

int sys_setUID ( struct thread td,
struct sys_setUID_args  
)

Definition at line 43 of file access.c.

◆ sys_sigaction()

int sys_sigaction ( struct thread td,
struct sys_sigaction_args  
)

Definition at line 294 of file gen_calls.c.

References sys_sigaction_args::act, memcpy(), sys_sigaction_args::oact, sys_sigaction_args::sig, thread::sigact, and thread::td_retval.

Here is the call graph for this function:

◆ sys_sigprocmask()

int sys_sigprocmask ( struct thread td,
struct sys_sigprocmask_args  
)

◆ sys_socket()

int sys_socket ( struct thread td,
struct sys_socket_args  
)

Definition at line 500 of file sys_arch.c.

References sys_socket_args::domain, falloc(), file::fd, file::fd_type, fdestroy(), kprintf(), sys_socket_args::protocol, file::socket, thread::td_retval, and sys_socket_args::type.

Here is the call graph for this function:

◆ sys_stat()

int sys_stat ( struct thread td,
struct sys_stat_args  
)

Definition at line 302 of file stat.c.

References _sys_stat(), sys_stat_args::path, STAT_LSTAT, thread::td_retval, and sys_stat_args::ub.

Here is the call graph for this function:

◆ sys_statfs()

◆ sys_sysarch()

◆ sys_sysctl()

int sys_sysctl ( struct thread td,
struct sys_sysctl_args  
)

Definition at line 286 of file kern_sysctl.c.

◆ sys_unlink()

int sys_unlink ( struct thread ,
struct sys_unlink_args  
)

Definition at line 449 of file vfs_calls.c.

References fl_remove(), kprintf(), sys_unlink_args::path, and thread::td_retval.

Here is the call graph for this function:

◆ sys_wait4()

int sys_wait4 ( struct thread td,
struct sys_wait4_args  
)

◆ sys_write()