core filename format, which allow to change the name of the core dump,
and to relocate it in a directory. Credits to Bill Sommerfeld for giving me
the idea :)
The default core filename format can be changed by options DEFCORENAME and/or
kern.defcorename
Create a new sysctl tree, proc, which holds per-process values (for now
the corename format, and resources limits). Process is designed by its pid
at the second level name. These values are inherited on fork, and the corename
fomat is reset to defcorename on suid/sgid exec.
Create a p_sugid() function, to take appropriate actions on suid/sgid
exec (for now set the P_SUGID flag and reset the per-proc corename).
Adjust dosetrlimit() to allow changing limits of one proc by another, with
credential controls.
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().
Reviewed by: thorpej
Tested by: wrstuden
write lock when doing PID allocation, and during the process exit path.
Use a read lock every where else, including within schedcpu() (interrupt
context). Note that holding the write lock implies blocking schedcpu()
from running (blocks softclock).
PID allocation is now MP-safe.
Note this actually fixes a bug on single processor systems that was probably
extremely difficult to tickle; it was possible that schedcpu() would run
off a bad pointer if the right clock interrupt happened to come in the
middle of a LIST_INSERT_HEAD() or LIST_REMOVE() to/from allproc.
body of reaper(), right before the call to uvm_exit(). cpu_wait() must
be done before uvm_exit() because the resources it frees might be located
in the PCB.
count is 0, wait for use count to drain before finishing the close.
This is necessary in order for multiple processes to safely share file
descriptor tables.
rather than just "value / sizeof (char *)". While in these cases the latter
works as well, the former's a better example for other uses to copy (since
it handles the non-integral multiple case correctly).
1. the mask is passed by value, not by reference
2. compare the rest of the mask bits not the valid ones
3. return 0, not the current fd's flags.
Now appletviewer works on an inet display. It will not work
with :0 because /tmp/.X11-pipe/X0 is a named pipe, not a
socket like our /tmp/.X11-unix/X0. Maybe I'll kludge svr4_sys_open
to return an fd to a unix socket when someone attempts to call
open on a unix socket.
version:
1. The stack_t returned before was SS_DISABLED; now we enable the stack
and return a 16K stack which is 16K under the current stack pointer.
This seems to be what solaris does.
2. Preserve uc_link.
would appear that overloading the argument this way is used by SVR4 to `fall
off' the main context (uc_link being NULL) after a function set up using
makecontext() returns.
RLIM_INFINITY like we do. Java uses rlim_max to allocate a data structure
per file descriptor.
what we do is bogus anyway, because:
setrlimit(RLIM_NOFILE, {RLIM_INFINITY, RLIM_INFINITY}}
sets the limit to { maxfiles, maxfiles }
I undestand that this is so that if we change maxfiles via sysctl, processes
can still use the new maximum, but it is probably more appropriate to return
the current value of maxfiles (and maxproc) at every getrlimit call, even
if the current value for either is RLIM_INFINITY.
Anyway, java now works on the the sparc, on the i386 loses on setcontext().
sparc, and unknown for the rest. Also make sure that the string is terminated
properly and the length is returned as the specification calls. Maybe sometime
we can read the prom on the sparc and return the actual model.