diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c index caa3808..39fb9f9 100644 --- a/src/bin/edit/main.c +++ b/src/bin/edit/main.c @@ -41,6 +41,8 @@ printf("%c",fgetc(out)); } + fclose(out); + printf("argc: [%i]\n",argc); return(0); diff --git a/src/sys/include/sys/thread.h b/src/sys/include/sys/thread.h index c5f83e7..376457f 100644 --- a/src/sys/include/sys/thread.h +++ b/src/sys/include/sys/thread.h @@ -33,12 +33,15 @@ #include #define O_FILES 64 +#define S_GID 0x1 +#define S_UID 0x3 struct thread { int td_retval[2]; u_int32_t o_files[O_FILES]; char * vm_daddr; int32_t vm_dsize; + u_int8_t mode; }; #endif diff --git a/src/sys/kernel/gen_calls.c b/src/sys/kernel/gen_calls.c index 35f48c4..d1104b2 100644 --- a/src/sys/kernel/gen_calls.c +++ b/src/sys/kernel/gen_calls.c @@ -66,11 +66,14 @@ } int issetugid(register struct thread *td, struct issetugid_args *uap) { - #ifdef NOTIMP + #ifdef DEBUG kprintf("Not Implimented: issetugid\n"); kprintf("[%s:%i]\n",__FILE__,__LINE__); #endif - td->td_retval[0] = 0; + if ((td->mode & S_GID) || S_GID) + td->td_retval[0] = 1; + else + td->td_retval[0] = 0; return (0); } diff --git a/src/sys/kernel/kern_descrip.c b/src/sys/kernel/kern_descrip.c index 41ab597..17e833d 100644 --- a/src/sys/kernel/kern_descrip.c +++ b/src/sys/kernel/kern_descrip.c @@ -99,17 +99,18 @@ return (0); } -/* HACK */ +/* BUGS: Getting closer*/ int fstat(struct thread *td,struct fstat_args *uap) { struct file *fp = 0x0; - #ifdef NOTIMP + #ifdef VFSDEBUG kprintf("[%s:%i]",__FILE__,__LINE__,__FUNCTION__); #endif fp = (struct file *)_current->td.o_files[uap->fd]; uap->sb->st_mode = 0x2180; uap->sb->st_blksize = 0x1000; + uap->sb->st_size = fp->size; #ifdef NOTIMP kprintf("fstat: %i",uap->fd); #endif diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index 7680062..0b7f137 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -191,10 +191,6 @@ i = fd->mp->fs->vfsRead(fd,ptr,fd->offset,size * nmemb); - //fd->offset += size * nmemb; - - //kprintf("fread: %i:%i",i,size *nmemb); - return(i); } diff --git a/src/sys/vfs/vfs_syscalls.c b/src/sys/vfs/vfs_syscalls.c index 11e697e..b8df0c2 100644 --- a/src/sys/vfs/vfs_syscalls.c +++ b/src/sys/vfs/vfs_syscalls.c @@ -222,8 +222,13 @@ #endif getfd(td,&fd,uap->fd); - kprintf("BuffeR: [0x%X]\n",fd->buffer); - kfree(fd->buffer); + + if (fd->buffer != 0x0) + kfree(fd->buffer); + + if (fd->fsObj != 0x0) + kfree(fd->fsObj); + kfree((void *)td->o_files[uap->fd]); td->o_files[uap->fd] = 0x0; td->td_retval[0] = 0x0; diff --git a/ubixos.kdevelop.filelist b/ubixos.kdevelop.filelist index 66f4232..fa9178b 100644 --- a/ubixos.kdevelop.filelist +++ b/ubixos.kdevelop.filelist @@ -12,3 +12,13 @@ src/sys/include/vmm/paging.h src/sys/vfs/vfs_syscalls.c src/sys/isa/ne2k.c +src/sys/mpi/message.c +src/sys/mpi/system.c +src/sys/lib/assert.c +src/sys/lib/string.c +src/sys/vfs/file.c +src/sys/vfs/mount.c +src/sys/vfs/vfs.c +src/sys/include/vfs/vfs.h +src/sys/include/vfs/file.h +src/sys/include/sys/kern_descrip.h diff --git a/ubixos.kdevelop.pcs b/ubixos.kdevelop.pcs index 6b518a5..a5f0de5 100644 --- a/ubixos.kdevelop.pcs +++ b/ubixos.kdevelop.pcs Binary files differ diff --git a/ubixos.kdevses b/ubixos.kdevses index cff38b5..fed7a9e 100644 --- a/ubixos.kdevses +++ b/ubixos.kdevses @@ -1,22 +1,31 @@ - - - + + + - - + + - - + + - - + + - - + + + + + + + + + + +