gen_calls.c
ubixos/types.h
sys/thread.h
sys/gen_calls.h
sys/kern_descrip.h
ubixos/sched.h
lib/kprintf.h
lib/kmalloc.h
string.h
assert.h
sys/thread.h
ubixos/sched.h
ubixos/types.h
sys/_types.h
string.h
vfs/file.h
sys/tss.h
lib/kmalloc.h
sys/gen_calls.h
vfs/mount.h
lib/kprintf.h
sys/kern_descrip.h
assert.h
ubixfs/dirCache.h
sys/sysproto.h
sys/signal.h
ubixos/tty.h
src/sys/kernel/gen_calls.c
int int getgid (struct thread *td, struct getgid_args *uap) getgid struct thread * td struct getgid_args * uap _current taskStruct::gid kprintf taskStruct::td thread::td_retval
int int getpid (struct thread *td, struct getpid_args *uap) getpid struct thread * td struct getpid_args * uap _current taskStruct::id kprintf taskStruct::td thread::td_retval
int int gettimeofday_new (struct thread *td, struct gettimeofday_args *uap) gettimeofday_new struct thread * td struct gettimeofday_args * uap kprintf
int int getuid (struct thread *td, struct getuid_args *uap) getuid struct thread * td struct getuid_args * uap _current kprintf taskStruct::td thread::td_retval taskStruct::uid
int int issetugid (register struct thread *td, struct issetugid_args *uap) issetugid register struct thread * td struct issetugid_args * uap kprintf
int int read (struct thread *td, struct read_args *uap) read struct thread * td struct read_args * uap read_args::buf read_args::fd file::fd fread getfd kprintf read_args::nbyte thread::td_retval x1
int int readlink (struct thread *td, struct readlink_args *uap) readlink struct thread * td struct readlink_args * uap readlink_args::count kprintf readlink_args::path taskStruct::td thread::td_retval
int int setitimer (struct thread *td, struct setitimer_args *uap) setitimer struct thread * td struct setitimer_args * uap

place holder for now functionality to be added later

int int sys_write (struct thread *td, struct write_args *uap) sys_write struct thread * td struct write_args * uap write_args::buf write_args::fd kfree kmalloc kprintf memcpy write_args::nbyte taskStruct::td thread::td_retval

    /*****************************************************************************************
    Copyright(c)2002-2004TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: gen__calls_8c.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #include<ubixos/types.h>
    #include<sys/thread.h>
    #include<sys/gen_calls.h>
    #include<sys/kern_descrip.h>
    #include<ubixos/sched.h>
    #include<lib/kprintf.h>
    #include<lib/kmalloc.h>
    #include<string.h>
    #include<assert.h>

    /*returntheprocessid*/
    intgetpid(structthread*td,structgetpid_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    td->td_retval[0]=_current->id;
    return(0);
    }

    /*returntheprocessuserid*/
    intgetuid(structthread*td,structgetuid_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    td->td_retval[0]=_current->uid;
    return(0);
    }

    /*returntheprocessgroupid*/
    intgetgid(structthread*td,structgetgid_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    td->td_retval[0]=_current->gid;
    return(0);
    }

    intsys_write(structthread*td,structwrite_args*uap){
    char*buffer=0x0;
    char*in=0x0;

    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    kprintf("sw[%i]",uap->fd);

    if(uap->fd==2){
    kprintf("stderr:%s",uap->buf);
    }

    if(uap->fd==1){
    in=(char*)uap->buf;
    buffer=kmalloc(1024);
    memcpy(buffer,uap->buf,uap->nbyte);
    kprintf("%s",buffer);
    kfree(buffer);
    td->td_retval[0]=uap->nbyte;
    }
    else{
    kprintf("[%i]",uap->nbyte);
    buffer=kmalloc(uap->nbyte);
    memcpy(buffer,uap->buf,uap->nbyte);
    //kprint(buffer);
    kfree(buffer);
    kprintf("(%i)%s",uap->fd,uap->buf);
    td->td_retval[0]=uap->nbyte;
    }
    return(0x0);
    }

    intissetugid(registerstructthread*td,structissetugid_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    td->td_retval[0]=0;
    return(0);
    }

    intreadlink(structthread*td,structreadlink_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    kprintf("readlink:[%s:%i]\n",uap->path,uap->count);
    td->td_retval[0]=-1;
    td->td_retval[1]=0x0;
    return(0x0);
    }

    intgettimeofday_new(structthread*td,structgettimeofday_args*uap){
    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif
    return(0x0);
    }

    intread(structthread*td,structread_args*uap){
    interror=0x0;
    size_tcount=0x0;
    structfile*fd=0x0;

    #ifdefDEBUG
    kprintf("[%s:%i]",__FILE__,__LINE__);
    #endif

    error=getfd(td,&fd,uap->fd);

    if(error)
    return(error);

    count=fread(uap->buf,uap->nbyte,0x1,fd->fd);
    kprintf("count:%i\n",count);
    td->td_retval[0]=count;

    return(error);
    }

    intsetitimer(structthread*td,structsetitimer_args*uap){
    interror=0x0;

    return(error);
    }

    /***
    END
    ***/