diff -rc --new-file pl15/fs/exec.c pl15_quota/fs/exec.c
*** pl15_oen/fs/exec.c	Fri Feb  4 14:54:49 1994
--- pl15_quota/fs/exec.c	Fri Feb  4 11:40:52 1994
***************
*** 161,166 ****
--- 161,167 ----
     if (!filp->f_op->write)
        goto close_coredump;
     has_dumped = 1;
+    current->flags |= PF_DUMPCORE;
     /*
      * Changed the size calculations - should hopefully work better. lbt
      */
***************
*** 832,837 ****
--- 833,839 ----
     current->mmap = NULL;
     current->executable = NULL;  /* for OMAGIC files */
     current->sgid = current->egid = bprm->e_gid;
+    current->flags &= ~PF_FORKNOEXEC;
     if (N_MAGIC(ex) == OMAGIC) {
        do_mmap(NULL, 0, ex.a_text + ex.a_data,
           PROT_READ|PROT_WRITE|PROT_EXEC,
diff -rc --new-file pl15/include/linux/acct.h pl15_quota/include/linux/acct.h
*** pl15/include/linux/acct.h	Thu Jan  1 01:00:00 1970
--- pl15_quota/include/linux/acct.h	Fri Feb  4 11:51:49 1994
***************
*** 0 ****
--- 1,29 ----
+ #ifndef __LINUX_ACCT_H
+ #define __LINUX_ACCT_H
+ 
+ #define ACCT_COMM 16
+ 
+ struct acct
+ {
+ 	char	ac_comm[ACCT_COMM];	/* Accounting command name */
+ 	time_t	ac_utime;		/* Accounting user time */
+ 	time_t	ac_stime;		/* Accounting system time */
+ 	time_t	ac_etime;		/* Accounting elapsed time */
+ 	time_t	ac_btime;		/* Beginning time */
+ 	uid_t	ac_uid;			/* Accounting user ID */
+ 	gid_t	ac_gid;			/* Accounting group ID */
+ 	dev_t	ac_tty;			/* controlling tty */
+ 	char	ac_flag;		/* Accounting flag */
+ 	long	ac_minflt;		/* Accounting minor pagefaults */
+ 	long	ac_majflt;		/* Accounting major pagefaults */
+ 	long	ac_exitcode;		/* Accounting process exitcode */
+ };
+ 
+ #define AFORK	0001	/* has executed fork, but no exec */
+ #define ASU	0002	/* used super-user privileges */
+ #define ACORE	0004	/* dumped core */
+ #define AXSIG	0010	/* killed by a signal */
+ 
+ #define AHZ     100
+ 
+ #endif
diff -rc --new-file pl15/include/linux/kernel.h pl15_quota/include/linux/kernel.h
*** pl15/include/linux/kernel.h	Tue Jan 25 10:35:03 1994
--- pl15_quota/include/linux/kernel.h	Fri Feb  4 11:15:41 1994
***************
*** 50,64 ****
  asmlinkage int printk(const char * fmt, ...)
  	__attribute__ ((format (printf, 1, 2)));
  
- /*
-  * This is defined as a macro, but at some point this might become a
-  * real subroutine that sets a flag if it returns true (to do
-  * BSD-style accounting where the process is flagged if it uses root
-  * privs).  The implication of this is that you should do normal
-  * permissions checks first, and check suser() last.
-  */
- #define suser() (current->euid == 0)
- 
  #endif /* __KERNEL__ */
  
  #define SI_LOAD_SHIFT	16
--- 50,55 ----
diff -rc --new-file pl15/include/linux/sched.h pl15_quota/include/linux/sched.h
*** pl15/include/linux/sched.h	Tue Jan 25 10:47:13 1994
--- pl15_quota/include/linux/sched.h	Fri Feb  4 11:13:49 1994
***************
*** 245,250 ****
--- 245,254 ----
  					/* Not implemented yet, only for 486*/
  #define PF_PTRACED	0x00000010	/* set if ptrace (0) has been called. */
  #define PF_TRACESYS	0x00000020	/* tracing system calls */
+ #define PF_FORKNOEXEC	0x00000040	/* forked but didn't exec */
+ #define PF_SUPERPREV	0x00000100	/* used super-user privileges */
+ #define PF_DUMPCORE	0x00000200	/* dumped core */
+ #define PF_SIGNALED	0x00000400	/* killed by a signal */
  
  /*
   * cloning flags:
***************
*** 394,399 ****
--- 398,416 ----
  
  #define set_base(ldt,base) _set_base( ((char *)&(ldt)) , base )
  #define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 )
+ 
+ /*
+  * This has now become a routine instead of a macro, it sets a flag if
+  * it returns true (to do BSD-style accounting where the process is flagged
+  * if it uses root privs). The implication of this is that you should do
+  * normal permissions checks first, and check suser() last.
+  */
+ extern inline int suser(void)
+ {
+ 	if (current->euid == 0)
+ 		current->flags |= PF_SUPERPREV;
+ 	return (current->euid == 0);
+ }
  
  /*
   * The wait-queues are circular lists, and you have to be *very* sure
diff -rc --new-file pl15/kernel/exit.c pl15_quota/kernel/exit.c
*** pl15/kernel/exit.c	Mon Jan  3 07:06:01 1994
--- pl15_quota/kernel/exit.c	Fri Feb  4 11:52:00 1994
***************
*** 19,24 ****
--- 19,25 ----
  #include <asm/segment.h>
  extern void shm_exit (void);
  extern void sem_exit (void);
+ extern void acct_process (long exitcode);
  
  int getrusage(struct task_struct *, int, struct rusage *);
  
***************
*** 354,359 ****
--- 355,361 ----
  	int i;
  
  fake_volatile:
+ 	acct_process(code);
  	if (current->semun)
  		sem_exit();
  	if (current->shm)
diff -rc --new-file pl15/kernel/fork.c pl15_quota/kernel/fork.c
*** pl15/kernel/fork.c	Wed Jan 26 10:17:56 1994
--- pl15_quota/kernel/fork.c	Fri Feb  4 10:37:15 1994
***************
*** 138,144 ****
  	*p = *current;
  	p->kernel_stack_page = 0;
  	p->state = TASK_UNINTERRUPTIBLE;
! 	p->flags &= ~(PF_PTRACED|PF_TRACESYS);
  	p->pid = last_pid;
  	p->swappable = 1;
  	p->p_pptr = p->p_opptr = current;
--- 138,145 ----
  	*p = *current;
  	p->kernel_stack_page = 0;
  	p->state = TASK_UNINTERRUPTIBLE;
! 	p->flags &= ~(PF_PTRACED|PF_TRACESYS|PF_SUPERPREV);
! 	p->flags |= PF_FORKNOEXEC;
  	p->pid = last_pid;
  	p->swappable = 1;
  	p->p_pptr = p->p_opptr = current;
diff -rc --new-file pl15/kernel/sys.c pl15_quota/kernel/sys.c
*** pl15/kernel/sys.c	Wed Jan 26 10:17:56 1994
--- pl15_quota/kernel/sys.c	Fri Feb  4 11:52:03 1994
***************
*** 17,23 ****
  #include <linux/ptrace.h>
  #include <linux/stat.h>
  #include <linux/mman.h>
! 
  #include <asm/segment.h>
  #include <asm/io.h>
  
--- 17,26 ----
  #include <linux/ptrace.h>
  #include <linux/stat.h>
  #include <linux/mman.h>
! #include <linux/fcntl.h>
! #include <linux/acct.h>
! #include <linux/fileio.h>
!   
  #include <asm/segment.h>
  #include <asm/io.h>
  
***************
*** 290,299 ****
  		return -EPERM;
  	return 0;
  }
! 
! asmlinkage int sys_acct(void)
! {
! 	return -ENOSYS;
  }
  
  asmlinkage int sys_phys(void)
--- 293,395 ----
  		return -EPERM;
  	return 0;
  }
!   
! static char acct_active = 0;
! static struct file *acct_file;
! 
! int acct_process(long exitcode)
! {
!    struct acct ac;
!    unsigned short fs;
! 
!    if (acct_active) {
!       strncpy(ac.ac_comm, current->comm, ACCT_COMM);
!       ac.ac_comm[ACCT_COMM] = '\0';
!       ac.ac_utime = current->utime;
!       ac.ac_stime = current->stime;
!       ac.ac_btime = CT_TO_SECS(current->start_time) + (xtime.tv_sec - (jiffies / HZ));
!       ac.ac_etime = CURRENT_TIME - ac.ac_btime;
!       ac.ac_uid   = current->uid;
!       ac.ac_gid   = current->gid;
!       ac.ac_tty   = MKDEV(4, current->tty);
!       ac.ac_flag  = 0;
!       if (current->flags & PF_FORKNOEXEC)
!          ac.ac_flag |= AFORK;
!       if (current->flags & PF_SUPERPREV)
!          ac.ac_flag |= ASU;
!       if (current->flags & PF_DUMPCORE)
!          ac.ac_flag |= ACORE;
!       if (current->flags & PF_SIGNALED)
!          ac.ac_flag |= AXSIG;
!       ac.ac_minflt = current->min_flt;
!       ac.ac_majflt = current->maj_flt;
!       ac.ac_exitcode = exitcode;
! 
!       /* Kernel segment override */
!       fs = get_fs();
!       set_fs(KERNEL_DS);
! 
!       acct_file->f_op->write(acct_file->f_inode, acct_file,
!                              (char *)&ac, sizeof(struct acct));
! 
!       set_fs(fs);
!    }
!    return 0;
! }
! 
! extern void close_filp(struct file *, int);
! 
! asmlinkage int sys_acct(const char *name)
! {
!    struct inode *inode = (struct inode *)0;
!    char *tmp;
!    int error;
! 
!    if (!suser())
!       return -EPERM;
! 
!    if (name == (char *)0) {
!       if (acct_active) {
!          close_filp(acct_file, 0);
!          acct_active = 0;
!       }
!       return 0;
!    } else {
!       if (!acct_active) {
!          if ((error = getname(name, &tmp)) != 0)
!             return (error);
!          error = open_namei(tmp, O_RDWR, 0600, &inode, 0);
!          putname(tmp);
!          if (error)
!             return (error);
!          if (!S_ISREG(inode->i_mode)) {
!             iput(inode);
!             return -EACCES;
!          }
!          if (!inode->i_op || !inode->i_op->default_file_ops || 
!              !inode->i_op->default_file_ops->write) {
!             iput(inode);
!             return -EIO;
!          }
!          if ((acct_file = get_empty_filp()) == (struct file *)0)
!             return -EUSERS;
!          acct_file->f_mode = (O_WRONLY + 1) & O_ACCMODE;
!          acct_file->f_flags = O_WRONLY;
!          acct_file->f_inode = inode;
!          acct_file->f_pos = inode->i_size;
!          acct_file->f_reada = 0;
!          acct_file->f_op = inode->i_op->default_file_ops;
!          if (acct_file->f_op->open)
!             if (acct_file->f_op->open(acct_file->f_inode, acct_file)) {
!                iput(inode);
!                return -EIO;
!             }
!          vfs_open_filp(acct_file);
!          acct_active = 1;
!          return 0;
!       } else
!          return -EBUSY;
!    }
  }
  
  asmlinkage int sys_phys(void)
