Commit Graph

1031 Commits

Author SHA1 Message Date
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
jdolecek f16bab2269 bsd_to_linux_statfs():
- filesystem size is expressed in number of fragments, not blocks;
  this fixes computed filesystem sizes for Linux df(1) and other Linux
  binaries using statfs(2) for filesystems, which use different value
  for frament and block, such as FFS
- use FS f_namemax instead of always using MAXNAMLEN
2004-09-13 20:09:44 +00:00
jdolecek 9cc50db4c5 if passed sockaddr has family AF_UNSPEC, use socket family of the socket
the sockaddr is used for

this fixes bind() problem in Linux version of Theocracy, testing
by Thomas Klausner
2004-09-12 15:32:55 +00:00
wiz be98c25ecf Fix typo in comment. 2004-09-10 22:22:20 +00:00
tron e5f111e223 Next attempt to fix the RCS Id. *sigh* 2004-09-09 10:45:52 +00:00
tron e22003b771 Finish linux_sys_exit_group() with a (never reached) "return" statement so
that GCC will actually compile this.
2004-09-09 07:02:50 +00:00
jdolecek 3b18315bb9 regen: add exit_group(2) 2004-09-08 19:46:17 +00:00
jdolecek 78569d6650 implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
2004-09-08 19:45:21 +00:00
jdolecek 6b3117d804 do more strict flag checking in clone(2) (matches what Linux does) 2004-09-08 19:41:24 +00:00
jdolecek ec083dc43c linux_sa_get: g/c curproc use, we get the process as one of arguments 2004-09-05 09:38:17 +00:00
jdolecek 4032a79979 improve the (#ifdef DEBUG_LINUX) socketcall argument dump code:
- print the socketcall type
- special case socket(2) call, it's also the only one with first argument
  not being a socket descriptor
- only dump the relevant part of linux_socketcall_dummy_args, instead
  of always the whole structure
2004-09-05 09:09:02 +00:00
jdolecek bae3c8fbb8 add some newer clone flags 2004-09-05 07:22:20 +00:00
jdolecek 6cfdd8bdbf dump socketcall data #ifdef DEBUG_LINUX 2004-08-29 20:45:18 +00:00
jdolecek 0659b2b55e in debug log, data dump is more useful unsigned 2004-08-29 20:10:42 +00:00
jdolecek 466a837559 handle mmap() request with MAP_GROWSDOWN flag (request for stack-like
grow-down auto extend segment) by allocating segment sized at
current stack size limit, and offsetting requested/returned address
as required

due to how normal virtual memory management work, allocating the
full sized stack memory segment up-front actually requires exactly same
amount of VA space and physical memory as the Linux 'grow' scheme and the
'grow' scheme is quite a lot more difficult to use in applications correctly,
so it's not very apparent why Linux introduced this feature at all

this fixes Thomas Klausner's Heroes3 crash, and might also
fix PR 26687 by Jan Schaumann
2004-08-29 14:08:06 +00:00
jdolecek a95e4d7c87 g/c LINUX_MAP_IGNMASK define - it's not used anywhere 2004-08-28 18:58:57 +00:00
jdolecek b63de69b76 fix debug printf - lm_addr is not pointer anumore 2004-08-24 17:41:54 +00:00
jdolecek c341a3a03a make struct linux_oldmmap members explicitly unsigned (with exception
of lm_fd, which can be -1), rename lm_pos to lm_offset, g/c some unneeded casts

no functional change
2004-08-22 15:40:41 +00:00
jdolecek 42d15fca03 on Linux, unlink() fails with EISDIR if the target is directory,
rather than EPERM; to emulate this properly, translate the error to EISDIR
if the target patch exists and points to a directory

this fixes the 'ant clean' problem reported by Marc Recht on current-users@
with SuSE 9.1 libraries
2004-08-13 21:27:32 +00:00
jdolecek b43cbaf291 fix two bugs in previous:
* flags passed from fork1() are FORK_*, not CLONE_*; thus, correct is to check
  for FORK_SHAREVM, not CLONE_VM
* fix a reference counting bug
2004-08-08 19:52:37 +00:00
jdolecek a714ac8294 linux processes sharing VM space (via clone() call) must also
share same 'break' value used for brk()/sbrk(), otherwise application SIGSEGVs
quickly once different threads try to adjust data segment size

this fixes linux Mozilla crashes with SuSE 9.1 libraries, and possibly
other linux applications using real threads
2004-08-08 09:40:50 +00:00
jdolecek 10a205d5d1 Linux returns ENOMEM (not EFAULT) if the address specified in mprotect()
is not part of process address space

this fixes Linux libgcc_s's stack executability setup
2004-08-01 22:44:10 +00:00
jdolecek 88c36114af regen - sync syscall lists with Linux kernel 2.6.7 2004-08-01 15:38:10 +00:00
jdolecek 6e41cd161f add entries for #403, #404 (unused) 2004-08-01 15:36:23 +00:00
jdolecek d1d5ac79b4 sync the syscall lists with Linux kernel 2.6.7 2004-08-01 15:34:22 +00:00
jdolecek 945fc3e577 regen:
add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
2004-08-01 14:17:19 +00:00
jdolecek 2873b62b57 add stub entries for syscalls added until Linux kernel 2.6.7
move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
2004-08-01 14:16:32 +00:00
jdolecek 4b33174cf9 regen:
connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
2004-08-01 10:38:38 +00:00
jdolecek ae85fa27f7 connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
2004-08-01 10:32:40 +00:00
chs f8fa568ead remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
2004-07-25 23:26:44 +00:00
manu 31f25e173c Fix a reversed errno issue for Linux binaries on mips. While we are there,
fix broken includes for alpha and m68k.
2004-06-19 22:59:40 +00:00
manu b2563527a8 Build COMPAT_LINUX again on mips after the siginfo change. 2004-06-19 18:45:30 +00:00
manu 0d510f3e7e include <sys/resourcevar.h>. It is not required for building -current,
but it is for -netbsd-2-0. Next step is to pull up the change...
2004-06-18 17:06:15 +00:00
manu 6b1a152604 COMPAT_LINUX/powerpc used the native stack setup routine, but now the
native version does non executable mappings on the stack. This is a
showstopper for Linux binaries.

To fix that we supply a copy f the native stack setup function for Linux
binaries, with the executable bit set.
2004-06-16 00:03:25 +00:00
yamt 6c4915e34d linux_sys_ioctl: map EPASSTHROUGH to EINVAL as sys_ioctl does.
otherwise, linux_syscall() returns garbage, at least on i386.
(it returns native_to_linux_errno[EPASSTHROUGH] where EPASSTHROUGH == -4.)

i choose EINVAL rather than ENOTTY, because linux's pipe returns it
and i think that it's a common case.
2004-06-03 01:53:28 +00:00
atatat 190adb15c3 Sysctl descriptions under emul subtree. 2004-05-25 04:29:08 +00:00
atatat 10a7ba9ef6 Tweak sysctl setup functions (the macros, actually) for use in lkms,
and tweak lkminit_*.c (where applicable) to call them, and to call
sysctl_teardown() when being unloaded.

This consists of (1) making setup functions not be static when being
compiled as lkms (change to sys/sysctl.h), (2) making prototypes
visible for the various setup functions in header files (changes to
various header files), and (3) making simple "load" and "unload"
functions in the actual lkminit stuff.

linux_sysctl.c also needs its root exposed (ie, made not static) for
this (when built as an lkm).
2004-05-20 06:34:24 +00:00
atatat e5004170aa Be consistent about using sysc_init_field() 2004-04-27 03:49:03 +00:00
christos 36d3802e0f fix more statvfs1 fallout 2004-04-21 02:37:20 +00:00
christos 5ccca4a99a s/statvfs/statvfs1/ 2004-04-21 02:27:34 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
matt a6b639c3a5 Switch to using PSL_USEROK_P()
Use new save_fpu_lwp sematics to save or discard the fpu state appropriately.
2004-04-17 08:47:15 +00:00
drochner d19f706361 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 17:34:18 +00:00
drochner 4f5b1431f9 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:01:16 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
atatat 0d4caad924 Remove useless comment about stuff that never happened. 2004-03-09 03:13:07 +00:00
yamt 2a93afdfd5 rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
2004-01-28 10:48:55 +00:00
fvdl d99705e941 Put back Emmanuel's sigfilter hooks, as decided by Core. 2003-12-20 19:01:29 +00:00
manu b23b73b953 Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.
2003-12-20 18:22:16 +00:00
christos 5c9b8df403 remove error(1) comment. 2003-12-08 17:51:53 +00:00