[BACK]Return to procfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / miscfs / procfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/miscfs/procfs/procfs_vnops.c between version 1.69 and 1.69.2.1

version 1.69, 1999/09/02 23:33:45 version 1.69.2.1, 2000/11/20 18:09:49
Line 43 
Line 43 
  * procfs vnode interface   * procfs vnode interface
  */   */
   
   #if defined(_KERNEL) && !defined(_LKM)
   #include "opt_compat_linux.h"
   #endif
   
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/systm.h>  #include <sys/systm.h>
 #include <sys/time.h>  #include <sys/time.h>
Line 57 
Line 61 
 #include <sys/ptrace.h>  #include <sys/ptrace.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   
 #include <vm/vm.h>      /* for PAGE_SIZE */  #include <uvm/uvm_extern.h>     /* for PAGE_SIZE */
   
 #include <machine/reg.h>  #include <machine/reg.h>
   
Line 69 
Line 73 
  *   *
  */   */
   
   #ifdef COMPAT_LINUX
   static int procfs_validfile_linux __P((struct proc *));
   #endif
   
 /*  /*
  * This is a list of the valid names in the   * This is a list of the valid names in the
  * process-specific sub-directories.  It is   * process-specific sub-directories.  It is
Line 95  struct proc_target {
Line 103  struct proc_target {
         { DT_REG, N("notepg"),  Pnotepg,        NULL },          { DT_REG, N("notepg"),  Pnotepg,        NULL },
         { DT_REG, N("map"),     Pmap,           procfs_validmap },          { DT_REG, N("map"),     Pmap,           procfs_validmap },
         { DT_REG, N("cmdline"), Pcmdline,       NULL },          { DT_REG, N("cmdline"), Pcmdline,       NULL },
   #ifdef COMPAT_LINUX
           { DT_REG, N("exe"),     Pfile,          procfs_validfile_linux },
   #endif
 #undef N  #undef N
 };  };
 static int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]);  static int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]);
   
 static pid_t atopid __P((const char *, u_int));  
   
 int     procfs_lookup   __P((void *));  int     procfs_lookup   __P((void *));
 #define procfs_create   genfs_eopnotsupp_rele  #define procfs_create   genfs_eopnotsupp_rele
 #define procfs_mknod    genfs_eopnotsupp_rele  #define procfs_mknod    genfs_eopnotsupp_rele
Line 828  int
Line 837  int
 procfs_validfile(p)  procfs_validfile(p)
         struct proc *p;          struct proc *p;
 {  {
   
         return (procfs_findtextvp(p) != NULLVP);          return (procfs_findtextvp(p) != NULLVP);
 }  }
   
   #ifdef COMPAT_LINUX
   static int
   procfs_validfile_linux(p)
           struct proc *p;
   {
           return (!strcmp("linux", p->p_emul->e_name) && procfs_validfile(p));
   }
   #endif
   
 /*  /*
  * readdir returns directory entries from pfsnode (vp).   * readdir returns directory entries from pfsnode (vp).
  *   *
Line 896  procfs_readdir(v)
Line 913  procfs_readdir(v)
   
                 if (ap->a_ncookies) {                  if (ap->a_ncookies) {
                         ncookies = min(ncookies, (nproc_targets - i));                          ncookies = min(ncookies, (nproc_targets - i));
                         MALLOC(cookies, off_t *, ncookies * sizeof (off_t),                          cookies = malloc(ncookies * sizeof (off_t),
                             M_TEMP, M_WAITOK);                              M_TEMP, M_WAITOK);
                         *ap->a_cookies = cookies;                          *ap->a_cookies = cookies;
                 }                  }
Line 942  procfs_readdir(v)
Line 959  procfs_readdir(v)
                          * XXX Potentially allocating too much space here,                           * XXX Potentially allocating too much space here,
                          * but I'm lazy. This loop needs some work.                           * but I'm lazy. This loop needs some work.
                          */                           */
                         MALLOC(cookies, off_t *, ncookies * sizeof (off_t),                          cookies = malloc(ncookies * sizeof (off_t),
                             M_TEMP, M_WAITOK);                              M_TEMP, M_WAITOK);
                         *ap->a_cookies = cookies;                          *ap->a_cookies = cookies;
                 }                  }
Line 1024  procfs_readdir(v)
Line 1041  procfs_readdir(v)
         if (ap->a_ncookies) {          if (ap->a_ncookies) {
                 if (error) {                  if (error) {
                         if (cookies)                          if (cookies)
                                 FREE(*ap->a_cookies, M_TEMP);                                  free(*ap->a_cookies, M_TEMP);
                         *ap->a_ncookies = 0;                          *ap->a_ncookies = 0;
                         *ap->a_cookies = NULL;                          *ap->a_cookies = NULL;
                 } else                  } else

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.69.2.1

CVSweb <webmaster@jp.NetBSD.org>