Commit Graph

3867 Commits

Author SHA1 Message Date
dsl
ad5f09d13c Having removed all the CHECK_ALT_XXX() none of these syscall functions
do anything except call a standard function.  Nuke them all.
2007-04-23 21:22:29 +00:00
manu
262a61f00a Linux's uname should return x86_64 as machine_arch 2007-04-23 12:45:42 +00:00
christos
92ae584013 avoid zerodivide. 2007-04-23 00:13:14 +00:00
dsl
d0b9f67395 Delete a diagnostic printf and some unused 'stack gap' initialisation. 2007-04-22 14:10:30 +00:00
dsl
313aae0af3 Actually report an error when sys__stat30() fails. 2007-04-22 10:54:43 +00:00
dsl
b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
njoly
44d4cbded2 Regen (ftruncate fix). 2007-04-20 13:38:20 +00:00
njoly
12a8f9478e Fix ftruncate syscall. Do not use compat_43_sys_ftruncate, but
compat_43_netbsd32_oftruncate instead.
2007-04-20 13:37:05 +00:00
ad
8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +00:00
pooka
652606289c I'm not sure if I want to know what MNT_LAXY means, so I'll just
assume the comment has a tyop of MNT_LAZY.
2007-04-16 18:33:39 +00:00
njoly
bc7c2c3b94 Regen (statfs support). 2007-04-11 11:51:19 +00:00
njoly
f771d34a84 - Add compat amd64 linux32 statfs support, adapted from PR/35956.
- Move bsd_to_linux_statfs() function to its own file to be shared
  between both linux compats.

ok by manu.
2007-04-11 11:45:55 +00:00
hannken
e956461048 Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-07 15:06:53 +00:00
njoly
a926b97a8e Enable stat/stat64 nsec time support, for amd64 compat linux/linux32. 2007-04-05 16:39:11 +00:00
dsl
007d96a7bb Get emul_find() to update SCARG(uap, path) instead of assuming that the
updated path parameter is ever valid - especially when emul_find() fails.
Use the modified path for the access() calls.
Found when compiling with emul_find() hacked to always fail.
2007-04-05 07:37:14 +00:00
njoly
5c37954c94 Fix select() behaviour with NULL timeout, to blocks indefinitely
instead of returning immediately.
Reported by Edgar Fuß on port-amd64@.
2007-04-02 16:29:55 +00:00
hubertf
ef314e20d0 Remove duplicate #include <sys/param.h>,
and pull in the <sys/cdefs.h> needed for __KERNEL_RCSID

From: Slava Semushin <php-coder@altlinux.ru>
2007-03-26 22:44:40 +00:00
cube
c8ff1b6980 Count environment vars with envc, not argc [hi dsl!]. Reported by Nicolas
Joly in private mail.
2007-03-26 17:12:02 +00:00
njoly
471f710a5a Sync with recent compat linux termios changes. 2007-03-26 13:46:50 +00:00
njoly
6bf18aa85e Update i386 LINUX_{TIOCGPTN,TIOCSPTLCK} definitions for latest
linux_ioctl_termios() changes.
2007-03-26 12:26:11 +00:00
rmind
7b9af0160d Handle newlwp() error case. Currently, newlwp() cannot fail, but this
will likely change in the future.
2007-03-24 16:43:56 +00:00
njoly
1f4051d826 Fix generated file names from makesyscalls.sh (s/linux/linux32/).
From Edgar Fuß in PR/35956.
2007-03-23 12:26:10 +00:00
mrg
2cdaa49944 implement emul.linux.kern.machine, which can be set to "i686", like
some applications seem to want.
2007-03-23 04:16:13 +00:00
tsutsui
251bb51bf0 Fix shadowed declaration warning. 2007-03-20 11:39:34 +00:00
njoly
226b6c843f Add ktrace I/O support to netbsd32_ioctl() syscall.
Reviewed by cube.
2007-03-20 11:02:18 +00:00
cube
e80df1a6aa Typo. Reported by martin. 2007-03-20 09:11:04 +00:00
cube
e8beebe1e2 More SCARG_P32 fallout. 2007-03-20 08:25:37 +00:00
cube
35a0a309fb Fix typo. Reported by martin. 2007-03-20 08:12:42 +00:00
njoly
f408971232 Fix TIOCGPTN ioctl.
Do not use sysioctl() directly, but netbsd32_ioctl() instead.
2007-03-19 10:16:46 +00:00
dsl
d364d308c7 Change all the NETBSD32PTR64(SCARG(uap, xxx))) to SCARG_P32(uap, xxx). 2007-03-18 21:38:32 +00:00
tsutsui
3f372aff43 Fix compile errors in the previous:
- include <sys/filedesc.h> for do_sys_stat()
- include <sys/namei.h> for FOLLOW and NOFOLLOW
- add missing semicolons
- fix typos
2007-03-17 17:02:44 +00:00
dsl
a065e51621 remove all the double (and triple) casts used to convert 32bit userspace
pointers to and from 64bit kernel pointers.  Instead use the defines
NETBSD32PTR64(p32) to read a 32bit pointer and (the new) NETBSD32PTR32(p32,p64)
to write a 32bit pointer throughout.
The 32bit pointer is now a struct to enforce the above.
amd64 (with linux emul) and sparc64 will both compile (when the arch stuff
goes in soon), and amd64 still runs some i386 binaries.
2007-03-16 22:21:40 +00:00
manu
91e99f33d3 Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
2007-03-14 21:52:17 +00:00
njoly
de5304fe4b Regen (statfs/fstatfs fixes). 2007-03-14 12:47:46 +00:00
njoly
4e3a8d7d1d Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.

ok by manu
2007-03-14 12:44:39 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
dsl
6803111cb3 Fix amd64 build for compat sys_stat() changes.
This file isn't included in amd64:GENERIC
2007-03-11 19:36:37 +00:00
dsl
893faeae9e Update all the compat stuff to not use the 'stackgap' for processing
sys_stat() and friends, instead use do_sys_stat() and do_sys_fstat()
that write the answer into a kernel buffer (on stack) that can be
converted to the correct form and written the userspace.
I've test compiled a few kernels, and tested i386 netbsd1.6 ls.
Given I think I've fixed some bugs, it might be 50-50 with new ones.
2007-03-10 21:40:23 +00:00
dsl
935d2b1c7f Use the support routines from kern_syscalls.c instead of rolling our own code. 2007-03-10 17:33:29 +00:00
ad
c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
tsutsui
4fc7add5a3 Use (char *) to appease -Wpointer-arith. 2007-03-06 12:41:52 +00:00
dogcow
f18ef70a25 semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
2007-03-05 21:05:00 +00:00
christos
033371b01a fix caddr_t lossage 2007-03-05 14:24:18 +00:00
christos
c74f0279ea more caddr_t lossage. 2007-03-05 14:13:10 +00:00
he
1564bbc49c Need a char* for doing pointer arithmetic. 2007-03-05 13:56:24 +00:00
tsutsui
48174a79c0 Use (char *) cast on pointer arith. 2007-03-05 10:43:32 +00:00
christos
a4c52808c6 fix caddr_t lossage. 2007-03-05 05:10:04 +00:00
yamt
18e17bd568 fix fallout from caddr_t changes. 2007-03-04 15:46:18 +00:00
yamt
731acd91f9 fix fallout from caddr_t changes. 2007-03-04 15:41:02 +00:00
tsutsui
543ff60bc5 Use (char *) on pointer arith. 2007-03-04 11:56:26 +00:00