Commit Graph

1293 Commits

Author SHA1 Message Date
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
pooka b6caa3be1b fix pasto: sigframe.sf_sc is of type linux_sigcontext 2007-07-08 09:41:00 +00:00
dsl 513b927545 It seems that min(16,16) isn't a compile time constant.
So don't bother limiting the local arrays to NGROUPS, just use 16.
2007-07-04 21:59:16 +00:00
dsl 813e1c7584 Fix long-term breakage in the definition of 'control' data for linux.
cmsg->cmsg_len is 'size_t' not 'socklen_t' - so it is 8 bytes on 64bit
platforms instead of 4.  There is also never padding after the header.
Redo linux sendmsg() so that it stands a chance of getting it right.
Redo linux recvmsg() so that it process control data directly from the mbuf
  list.  Allowing it to hack the data without using the stackgap.
2007-07-01 18:45:36 +00:00
dsl bf215415ab Fix LINUX_HDIO_GET_IDENTITY so that it returns the entire 512 byte buffer.
Rely on the code in dev/ata/wd.c doing a relay for the short read needed
for LINUX_HDIO_OBSOLETE_IDENTITY.
2007-07-01 09:54:16 +00:00
dsl 168c1071b4 Call fp->f_ops->fo_ioctl() directly (not by sys_ioctl() for LINUX_VT_GETMODE
and LINUX_VT_SETMODE.  One fewer use of the stackgap.
2007-06-30 22:54:33 +00:00
dsl a1188737bf Use the new CDIOCREADSUBCHANNEL_BUF and CDIOREADTOCENTRIES_BUF ioctls to
avoid copying into the stackgap.
2007-06-30 22:18:17 +00:00
dsl 4be2514b94 Match updates to kauth_cred_set/getgroups. 2007-06-30 13:34:19 +00:00
dsl 6d0a5fcf1a Simplify code to get/set 16bit group lists.
Cloned from ibcs2 copy (maybe I should have worked out somewhere to put this
as common code...)
2007-06-23 15:27:23 +00:00
dsl a5b4569076 Read and write the ldt without using the stackgap. 2007-06-23 15:26:16 +00:00
dsl 049a22a9db These now need sys/prot.h 2007-06-23 09:09:56 +00:00
dsl c271f319e5 Do the sysv ipc calls without the stackgap. 2007-06-17 18:17:46 +00:00
dsl 8e418a4b13 Delete stuff in comment about use of stackgap. 2007-06-16 19:54:02 +00:00
christos 46502fd059 regen 2007-06-13 20:57:56 +00:00
christos 89e2b251a2 Get ready for NPTL but don't turn it on as of yet. 2007-06-13 20:57:33 +00:00
christos 344a5bd80c regen. 2007-06-13 14:31:30 +00:00
christos 76af51a354 Add futex. 2007-06-13 14:31:07 +00:00
christos 564f9b3b2f cleanup some bitrot; from Matthew Orgass 2007-06-13 02:11:40 +00:00
rjs ef2a6ab865 Wrap ktrace calls with #ifdef KTRACE. 2007-06-06 17:08:27 +00:00
dsl 3e4175ccc9 Fix select() without a timeout parameter. 2007-06-04 21:02:22 +00:00
yamt a15e4b5b1b wrap #include "opt_ktrace.h" by #ifdef _KERNEL_OPT. 2007-06-02 13:16:19 +00:00
dsl 3d0e15d3b2 Call selcommon() directly instead of using the stackgap... 2007-06-02 11:51:42 +00:00
dsl d7f93c5c67 Split sys_bind() and sys_connect() so that compat code can use common code
once the 'address' has been copied into an mbuf.
Add extra flags for 'struct msghdr.msg_flags' to indicate that the address
  and control are already in mbufs, and that the uio structure is in userspace
  for sending data, rename sendit() to do_sys_sendmsg() to ensure no old code
  passes in random flags.
Changes to compat code to use new functions - removing some stackgap use.
Fix a 'use after free' in compat_43_sys_recvmsg.
I ***THINK*** the code that converts 'cmsg' formatted data is borked!
svr4_stream.c ought to be generated from svr4_32_stream.c during the build.
2007-06-01 22:53:52 +00:00
dsl d95fed7315 (Ab)use a KTR_USER trace entry for the linux socket command and arguments. 2007-06-01 22:42:47 +00:00
christos 20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
njoly f70cd37804 Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
  its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
2007-05-24 11:21:52 +00:00
christos c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00
dsl a163d15464 This is deja vu - I fixed this earlier....
No need to use stackgap for ioctl to get PTM name, directly call file's
ioctl function with kernel buffer.
2007-05-13 16:04:00 +00:00
dsl 2cc0d0a9c4 Stop using the stackgap for time functions. 2007-05-13 11:04:11 +00:00
dsl 701496b5c6 Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
2007-05-12 23:02:49 +00:00
dsl 8beba9d093 There is no need to use the stackgap for get/setrlimit. 2007-05-12 21:07:02 +00:00
dsl a08b772cae Fix comment and indent. 2007-05-12 20:23:36 +00:00
dsl c83f8a10ad Change the compat sys_[fl]utime code to not use the stackgap. 2007-05-12 17:28:19 +00:00
christos 48f401a8e0 - linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
2007-05-10 21:30:14 +00:00
christos ef061fd462 move the #if 0 down a few lines so linux_machine gets initialized. Pointed
out by Joachim K�nig
2007-05-10 17:12:32 +00:00
dsl 99ec301ce3 Remember to copy the rusage to the users buffer. 2007-05-08 20:54:15 +00:00
dsl 1844147fa9 Split sys_wait4() so that compat code can fiddle with the returned 'status'
and 'rusage' without having to copy data to/from stackgap buffers.
The old split (find_stopped_child) could be removed.
amd64 seems to run netbsd32, linux and linux32 emulations. sparc64 compiles.
2007-05-07 16:53:17 +00:00
christos f844889627 Remove change that obviously was not tested (since it uses LINUX_KERN_VERSION
again, producing EEXIST). There is no machine sysctl in linux that corresponds
to this (at least on my i386 suse box)
2007-05-06 23:25:26 +00:00
dsl dd85830e7b Include extra header (vfs_syscalls.h). 2007-04-30 20:20:28 +00:00
dsl 906b9af2a7 Rework compat stat() and statvfs() code so that it no longer uses the stackgap. 2007-04-30 14:05:47 +00:00
dsl 8932ebd238 Remove some unused calls to stackgap_init() 2007-04-30 09:20:18 +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 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
ad 8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +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
njoly a926b97a8e Enable stat/stat64 nsec time support, for amd64 compat linux/linux32. 2007-04-05 16:39:11 +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
njoly 6bf18aa85e Update i386 LINUX_{TIOCGPTN,TIOCSPTLCK} definitions for latest
linux_ioctl_termios() changes.
2007-03-26 12:26:11 +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