- Main Page
- Data Structures
- Files
- Directories

- Search for |

- File List
- Globals

# sysproto.h

Go to the documentation of this file.

    00001 /*****************************************************************************************
    00002  Copyright (c) 2002-2004 The UbixOS Project
    00003  All rights reserved.
    00004
    00005  Redistribution and use in source and binary forms, with or without modification, are
    00006  permitted provided that the following conditions are met:
    00007
    00008  Redistributions of source code must retain the above copyright notice, this list of
    00009  conditions, the following disclaimer and the list of authors.  Redistributions in binary
    00010  form must reproduce the above copyright notice, this list of conditions, the following
    00011  disclaimer and the list of authors in the documentation and/or other materials provided
    00012  with the distribution. Neither the name of the UbixOS Project nor the names of its
    00013  contributors may be used to endorse or promote products derived from this software
    00014  without specific prior written permission.
    00015
    00016  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
    00017  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00018  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
    00019  THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00020  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    00021  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    00022  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
    00023  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    00024  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00025
    00026  $Id: sysproto_8h-source.html 88 2016-01-12 00:11:29Z reddawg $
    00027
    00028 *****************************************************************************************/
    00029
    00030 #ifndef _SYSPROTO_H
    00031 #define _SYSPROTO_H
    00032
    00033 #include <sys/signal.h>
    00034 #include <sys/thread.h>
    00035
    00036 typedef int register_t;
    00037
    00038 #define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
    00039                 0 : sizeof(register_t) - sizeof(t))
    00040
    00041 #if BYTE_ORDER == LITTLE_ENDIAN
    00042 #define PADL_(t)        0
    00043 #define PADR_(t)        PAD_(t)
    00044 #else
    00045 #define PADL_(t)        PAD_(t)
    00046 #define PADR_(t)        0
    00047 #endif
    00048
    00049 //Protos
    00050 struct write_args {
    00051   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00052   char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
    00053   char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
    00054   };
    00055
    00056 struct open_args {
    00057   char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
    00058   char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
    00059   char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
    00060   };
    00061
    00062 struct setitimer_args {
    00063   char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)];
    00064   char itv_l_[PADL_(struct itimerval *)]; struct itimerval * itv; char itv_r_[PADR_(struct itimerval *)];
    00065   char oitv_l_[PADL_(struct itimerval *)]; struct itimerval * oitv; char oitv_r_[PADR_(struct itimerval *)];
    00066   };
    00067
    00068 //Old
    00069
    00070 struct sysctl_args {
    00071         char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)];
    00072         char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)];
    00073         char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)];
    00074         char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)];
    00075         char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)];
    00076         char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)];
    00077 };
    00078
    00079 struct getpid_args {
    00080         register_t dummy;
    00081 };
    00082 struct issetugid_args {
    00083         register_t dummy;
    00084 };
    00085 struct fcntl_args {
    00086         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00087         char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
    00088         char arg_l_[PADL_(long)]; long arg; char arg_r_[PADR_(long)];
    00089 };
    00090
    00091 struct pipe_args {
    00092   register_t dummy;
    00093   };
    00094
    00095 struct readlink_args {
    00096         char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
    00097         char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
    00098         char count_l_[PADL_(int)]; int count; char count_r_[PADR_(int)];
    00099 };
    00100
    00101 struct getuid_args {
    00102         register_t dummy;
    00103 };
    00104
    00105 struct getgid_args {
    00106         register_t dummy;
    00107 };
    00108 struct close_args {
    00109         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00110 };
    00111
    00112 struct mmap_args {
    00113    char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
    00114   char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
    00115   char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
    00116   char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
    00117   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00118   char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
    00119   char pos_l_[PADL_(off_t)]; off_t pos; char pos_r_[PADR_(off_t)];
    00120   };
    00121
    00122 struct obreak_args {
    00123   char nsize_l_[PADL_(char *)];char * nsize;char nsize_r_[PADR_(char *)];
    00124   };
    00125
    00126 struct sigaction_args {
    00127   char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
    00128   char act_l_[PADL_(const struct sigaction *)]; const struct sigaction * act; char act_r_[PADR_(const struct sigaction *)];
    00129   char oact_l_[PADL_(struct sigaction *)]; struct sigaction * oact; char oact_r_[PADR_(struct sigaction *)];
    00130   };
    00131
    00132 struct getdtablesize_args {
    00133         register_t dummy;
    00134 };
    00135
    00136 struct munmap_args {
    00137         char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
    00138         char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
    00139 };
    00140
    00141 struct sigprocmask_args {
    00142   char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)];
    00143   char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)];
    00144   char oset_l_[PADL_(sigset_t *)]; sigset_t * oset; char oset_r_[PADR_(sigset_t *)];
    00145   };
    00146 struct gettimeofday_args {
    00147   char tp_l_[PADL_(struct timeval *)]; struct timeval * tp; char tp_r_[PADR_(struct timeval *)];
    00148   char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)];
    00149   };
    00150 struct fstat_args {
    00151         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00152         char sb_l_[PADL_(struct stat *)]; struct stat * sb; char sb_r_[PADR_(struct stat *)];
    00153 };
    00154 struct ioctl_args {
    00155         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00156         char com_l_[PADL_(u_long)]; u_long com; char com_r_[PADR_(u_long)];
    00157         char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
    00158 };
    00159
    00160 struct read_args {
    00161         char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    00162         char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
    00163         char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
    00164 };
    00165
    00166 //Func Defs
    00167 int sys_write(struct thread *td, struct write_args *uap);
    00168 int sys_open(struct thread *td, struct open_args *uap);
    00169 int setitimer(struct thread *td, struct setitimer_args *uap);
    00170
    00171 #endif
    00172
    00173 /***
    00174  END
    00175  ***/
    00176