Commit Graph

152 Commits

Author SHA1 Message Date
eeh
16b1f7aae0 Fix bug in netbsd32_compat_43_olseek return value. 2001-08-15 05:16:59 +00:00
eeh
8180bfa441 Add missing `error'. 2001-07-30 22:04:08 +00:00
christos
934898bc32 Adjust to the new copyargs() footprint. 2001-07-29 21:28:45 +00:00
christos
b474b9ac65 carry on the copyargs() and exit1() changes from kern_exec.c 2001-07-29 21:28:20 +00:00
jdolecek
588b94c0a2 Expel MSG_COMPAT/COMPAT_OLDSOCK, make the COMPAT_43 wrappers
arrange things as needed.  Unfortunately, the check in sockargs()
have to stay, since 4.3BSD bind(2), connect(2) and sendto(2) were
not versioned at the time :(

This code was tested to pass regression tests.
2001-07-17 11:49:40 +00:00
jdolecek
26d45c1101 Back off the sendit()/recvit() change, some have problems with it 2001-06-25 20:46:11 +00:00
jdolecek
7f7c60e827 Add 'kernsa' parameter for sendit()/recvit(); if nonzero, msg->msg_name
is supposed to point directly to struct mbuf or struct sockaddr in kernel
space as appropriate, rather than being a pointer to memory in userland.

This is to be used by compat/* when emulation needs to wrap
send{to|msg}(2)/recv{from|msg}(2) and modify the passed struct
sockaddr.
2001-06-25 19:24:02 +00:00
fvdl
fe75469d65 Some of this was sparc-specific, so ifdef __sparc__ it (XXX). Also,
change the alignment of one structure with an MD ifdef. Should
be moved into the netbsd32_machdep parts.
2001-06-19 00:36:21 +00:00
christos
0f380fac15 Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
2001-06-18 02:00:48 +00:00
thorpej
7660fd850d In check_exec(), don't bother checking P_TRACED along with
MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
in the attributes for the vnode we're about to exec.

We now check P_TRACED right before we would actually perform
the s{u,g}id function in the exec code.

This closes a race condition between exec of a setuid binary
and ptrace(2).
2001-06-15 17:24:19 +00:00
thorpej
80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
mrg
25e7951011 proto for coredump32 2001-06-06 21:45:56 +00:00
mrg
a6a28df3e2 add netbsd32_uvm_unix.c and netbsd32_kern_sig.c 2001-06-06 21:30:28 +00:00
mrg
06f624518c sync with uvm_unix.c 1.23 2001-06-06 21:30:07 +00:00
mrg
85794da2bd LKM friendly: move coredump32() here 2001-06-06 21:25:11 +00:00
mrg
5677baf886 LKM friendly: move uvm_coredump32() here 2001-06-06 21:24:39 +00:00
mrg
6a89288a37 use _KERNEL_OPT. 2001-05-30 11:37:21 +00:00
kleink
0e1ec27466 Regen. 2001-04-10 11:12:12 +00:00
kleink
7b62f6ff28 Slight indentation nit. 2001-04-10 11:11:17 +00:00
jdolecek
b6d1d4db02 Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more
consistent with rest of fileops routines and also makes the fo_stat
match FreeBSD as an added bonus.
Discussed with Luke Mewburn on tech-kern@.
2001-04-09 10:22:00 +00:00
jdolecek
3fc6fc58e6 Call file descriptor stat function via (*fp->f_ops->fo_stat) instead
of a switch statement and explicit call.
Sprinkle some FILE_USE()/FILE_UNUSE() as appropriate.
2001-04-09 09:39:09 +00:00
ross
2d8e2c19d6 Fix soo_stat() calls for the new parameter, even if the direct call is
now obsolete, so that kernels will at least compile. I guess it was too
much trouble to change all 10 call sites, or perhaps, these days, only
things that build on i386 are important. Maybe it's the full moon tonight.
2001-04-08 08:01:36 +00:00
chs
ac3bc537bd eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>
2001-03-15 06:10:32 +00:00
mrg
f1a8e2ab5f be more verbose about failed vmcmds. 2001-03-04 13:42:32 +00:00
eeh
8a4a682091 Support flexible process address space limits and bump kernel version number. 2001-02-14 18:21:42 +00:00
eeh
a562e38910 Don't play fast and loose with pointers. 2001-02-11 00:00:29 +00:00
mrg
da9e4bd3a1 split up netbsd32_netbsd.c into 9 new files, leaving only those syscalls that
have no special interpretations besides simple syscall args conversion.
2001-02-08 13:19:33 +00:00
mrg
e927957b42 move the static inline conversion functions into a header file so other
files can see these.  note a bunch of functions that should be moved
into their own files.
2001-02-07 15:22:39 +00:00
mrg
7217f71af3 compat_12_netbsd32_{,fl}stat12() were not copyout()ing the converted result. 2001-02-07 13:15:54 +00:00
mrg
c1b372c5ca fix the glaring errors in compat_13_netbsd32_sigaltstack13 2001-02-07 13:14:07 +00:00
mrg
7a908a5f44 compat_sunos needs netbsd32_compat_09.c 2001-02-07 13:13:01 +00:00
eeh
4380259bc7 Specify a process' address space limits for uvmspace_exec(). 2001-02-06 17:01:51 +00:00
mrg
8e76e697d7 fix the glaring errors in emulations for osendmsg, orecvmsg, osigvec and osigstack. 2001-02-05 06:32:55 +00:00
mrg
32fdb6e321 change_utimes32() was copyin()ing a struct timeval, not netbsd32_timeval.
general clean up.
2001-02-04 09:00:14 +00:00
mrg
a531aa1597 emulate kern.boottime. now 32-bit w(1) works properly. 2001-02-04 07:08:51 +00:00
mrg
2aa001b546 make sysctl vm.loadavg work. 2001-02-04 06:35:07 +00:00
mrg
ef777aa80b sync a comment from sys_execve().
make netbsd32_recvfrom() work.
2001-02-03 12:46:55 +00:00
mrg
dabf2a8634 s/sizeof(struct exec)/sizeof(struct netbsd32_exec)/ when calculating file offsets. now sunos32 nmagic/omagic work. 2001-02-03 12:45:44 +00:00
mrg
eefaef162b properly implement compat_43_netbsd32_stat43, compat_43_netbsd32_lstat43
and compat_43_netbsd32_fstat43.  now 32-bit ls(1) works.  so does static
sunos `/sbin/sh' on sparc64.
2001-02-02 13:06:48 +00:00
mrg
87cc07b7c9 implement netbsd32_lchflags & netbsd32_utrace 2001-02-02 13:05:18 +00:00
mrg
674f1689f6 regen 2001-02-02 13:03:39 +00:00
mrg
b0f29c9c95 add lchflags, issetugid, utrace, reserves for [gs]etcontext, and sched/SA. 2001-02-02 13:01:44 +00:00
mrg
e4c34bc9e5 de-static netbsd32_exec_aout_prep_[zno]magic().
de-static netbsd32_from_stat43().
move the guts of netbsd32_execve() into netbsd32_execve2().

all of are for the forthcoming sunos32 compat mode (for sparc64).
2001-02-02 07:08:17 +00:00
thorpej
b54650a0bc Regen; getpid(2) is MP-safe. 2001-01-27 07:58:37 +00:00
thorpej
e00fb66e89 getpid(2) is MP-safe. 2001-01-27 07:58:22 +00:00
thorpej
1b6a66420e Regen; add sy_flags. 2001-01-27 07:23:06 +00:00
jdolecek
13ca559d39 Use CHECK_ALT_SYMLINK() instead CHECK_ALT_EXISTS() where appropriate.
This addresses kern/11757.
2001-01-22 20:08:03 +00:00
jdolecek
e9e91a0fb5 split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
2000-12-22 22:58:52 +00:00
mrg
272c549ab2 copy exec_aout.c:exec_aout_setup_stack to netbsd32_exec_aout_setup_stack,
but use USRSTACK32 not USRSTACK, so that we get 32-bit stack addresses.

now 32 bit a.out binaries work on sparc64.
2000-12-18 14:50:04 +00:00
mycroft
455360f941 Do the __HAVE_SYSCALL_INTERN and __HAVE_MINIMAL_EMUL dance. 2000-12-12 08:00:26 +00:00