Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   christos
Date:           Tue Nov  7 19:44:05 UTC 2017

Modified Files:
        src/sys/kern: exec_elf.c kern_exec.c kern_exit.c kern_fork.c
            kern_proc.c
        src/sys/sys: exec.h param.h proc.h

Log Message:
Store full executable path in p->p_path as discussed in tech-kern.
This means that the full executable path is always available.

- exec_elf.c: use p->path to set AT_SUN_EXECNAME, and since this is
  always set, do so unconditionally.
- kern_exec.c: simplify pathexec, use kmem_strfree where appropriate
  and set p->p_path
- kern_exit.c: free p->p_path
- kern_fork.c: set p->p_path for the child.
- kern_proc.c: use p->p_path to return the executable pathname; the
  NULL check for p->p_path, should be a KASSERT?
- exec.h: gc ep_path, it is not used anymore
- param.h: bump version, 'struct proc' size change

TODO:
1. reference count the path string, to save copy at fork and free
   just before exec?
2. canonicalize the pathname by changing namei() to LOCKPARENT
   vnode and then using getcwd() on the parent directory?


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/kern/exec_elf.c
cvs rdiff -u -r1.449 -r1.450 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.269 -r1.270 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.202 -r1.203 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.207 -r1.208 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.151 -r1.152 src/sys/sys/exec.h
cvs rdiff -u -r1.549 -r1.550 src/sys/sys/param.h
cvs rdiff -u -r1.342 -r1.343 src/sys/sys/proc.h

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




Home | Main Index | Thread Index | Old Index