57 Commits

Author SHA1 Message Date
Dirk Mueller
ac2bbadda5 implement support for AT_FDCWD in openat()
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6566
2007-01-31 23:06:08 +00:00
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Tom Hughes
69c8af5179 Improve prctl support - based on patch from Eric Pouech in bug #138627.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6410
2006-12-18 15:22:46 +00:00
Julian Seward
a96416a3e2 A naming-only change: rename VG_(set_running) to VG_(acquire_BigLock)
and VG_(set_sleeping) to VG_(release_BigLock).  And some other minor
renamings to the thread locking stuff, to make it easier to follow.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6408
2006-12-17 18:58:55 +00:00
Julian Seward
bbe7f55813 Merge r6140 (some of):
- track SysRes changes

- track VG_(am_find_nsegment) const-ness change

- increase number of client syscall args supported from 6 to 8

- simplify type SyscallStatus.  Simply hold a copy of the SysRes
  for the syscall rather than have this be a data structure
  incorporating something very similar to the fields of a SysRes,
  and more besides.  Change various macros in priv_types_n_macros.h
  to match.

- syswrap-main.c: instantiate the various impedance-matching
  functions for AIX.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6276
2006-10-17 01:47:30 +00:00
Julian Seward
ae8215b3ac Create a new module, m_vki, and move all knowledge about the kernel
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6225
2006-10-14 19:26:10 +00:00
Julian Seward
4b572a567e Create a new module, m_vkiscnums, and move all the system call numbers
into that.  Mostly this means moving vki_unistd-<plat>.h to
include/vki/vki-scnums-<plat>.h.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6224
2006-10-14 15:51:32 +00:00
Tom Hughes
ab5dbd4755 Validate futex system call arguments more carefully. Fixes bug #117172.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5968
2006-06-07 17:47:51 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Tom Hughes
297aa09b43 Implement the set_robust_list and get_robust_list system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5905
2006-05-17 14:24:12 +00:00
Tom Hughes
490abde206 Fix linkat, renameat and symlinkat wrappers to look at the arguments
correctly. Fixes bug #126938.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5884
2006-05-08 11:19:47 +00:00
Tom Hughes
4eb782b553 Add wrappers for a load of new 2.6.16 system calls. Fixes bug #123248.
Also expands pathname arguments as strings in a lot more system call
trace messages and fixed the poll wrapper to not be x86 specific.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5785
2006-03-21 10:58:35 +00:00
Tom Hughes
391d10fdeb Fix the tkill system call wrapper and enable it on x86 and amd64.
Fixes bug #121901.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5651
2006-02-15 10:34:50 +00:00
Cerion Armour-Brown
b714685c63 Take ppc64 startup further along the road
- fixed launcher.c to recognise ppc32/64-linux platforms properly
 - lots of assembly fixes to handle func descriptors, toc references, 64bit regs.
 - fixed var types in vki-ppc64-linux

Now gets as far as VG_(translate), but dies from a case of invalid orig_addr.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5299
2005-12-06 19:07:08 +00:00
Julian Seward
8ba9a34088 Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250
2005-11-29 13:05:56 +00:00
Julian Seward
7039eaa9ac sys_tgkill: hand the syscall to the kernel in the standard way, rather
than doing it inline.  Doing it inline screws up on ppc32-linux if
we're sending an async signal to ourselves (the same thread) because
the kernel immediately hands the signal to async_sighandler() which
then dies at the assertion that this thread's state is VgTs_WaitSys.
From which I conclude this wrapper has always had a race against the
kernel which did not show up on x86 or amd64.  (and/or that I don't
understand this stuff too well)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5169
2005-11-17 14:26:52 +00:00
Tom Hughes
43eeeace22 Remove redundant conditional - ppc32-linux is already handled.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5067
2005-11-10 12:54:37 +00:00
Nicholas Nethercote
057061d2ae Try to avoid compiler warnings on AMD64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5065
2005-11-10 04:02:19 +00:00
Nicholas Nethercote
8a58b97fbb Factor out some common code in m_syswrap.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5062
2005-11-10 02:48:04 +00:00
Julian Seward
4b7473cdb9 Adjust debugLog messages.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5054
2005-11-09 14:09:14 +00:00
Nicholas Nethercote
bf21ecfdb0 Factor out some common code in m_syswrap.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5049
2005-11-09 04:49:28 +00:00
Tom Hughes
2b553e2835 Add support for the mbind system call on x86 and amd64. Fixes bug #114756.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4958
2005-10-20 17:00:23 +00:00
Tom Hughes
6961dcf591 Fix statement-before-declaration warnings for the core code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4906
2005-10-12 10:45:27 +00:00
Tom Hughes
6c610b89c7 Rationalise the mmap system call handling - after examining the kernel
source it turns out that there are five different versions of mmap for
the three platforms we currently support:

  - On x86-linux there is mmap (aka old_mmap) which takes the
    arguments in a memory block and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On ppc32-linux there is mmap (aka sys_mmap) which takes the
    arguments in the normal way and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On amd64-linux everything is simple and there is just the one
    call, mmap (aka sys_mmap)  which takes the arguments in the normal
    way and the offset in bytes.

To reconcile all this I have created a generic handler and then
written five platform specific wrappers which normalise all the
arguments and then call the generic handler.

I have also modified the address space manager to use mmap2 rather
than mmap on x86 and ppc32 so that large offsets can be correctly
handled.

There is still an issue of OffT truncating offsets as we go through
the address space manager that will need to be addressed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4834
2005-09-30 08:07:53 +00:00
Julian Seward
1f46368c98 Changes to sys_mmap2 wrapper:
- update comment re offset scaling

- ppc32 offset is in bytes, not pages

- don't deal with MAP_FIXED case directly here; instead uniformly pass
  all requests to VG_(am_get_advisory), so that layout policy is controlled
  from one place only.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4823
2005-09-30 00:37:04 +00:00
Nicholas Nethercote
d0b346939c Future-proof a piece of conditional compilation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4822
2005-09-30 00:06:09 +00:00
Tom Hughes
734ffbfb60 On x86 and ppc32 the offset argument to mmap2 is specified in pages
not bytes. This is a horrible kludge of a fix and it should probably
be fixed properly with a separate sys_mmap for amd64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4821
2005-09-29 23:26:06 +00:00
Julian Seward
cc8ccbbfb4 This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive).  That branch is now dead.
Please do not commit anything else to it.

For the most part the merge was not troublesome.  The main areas of
uncertainty are:

- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
  and include it in a couple of places.  Building etc seems to still
  work, but I haven't tried building the documentation.

- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
  stuff was moved from -generic to -linux after the branch was created.
  I think that is satisfactorily glued back together now.

- Regtests: although this appears to work, no .out files appear, which
  is strange, and makes it hard to diagnose regtest failures.  In
  particular memcheck/tests/x86/scalar.stderr.exp remains in a 
  conflicted state.

- amd64 is broken (slightly), and ppc32 will be unbuildable.  I'll
  attend to the former shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789
2005-09-27 19:20:21 +00:00
Nicholas Nethercote
a00ea1b94b fix for #113230
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4751
2005-09-24 19:42:41 +00:00
Nicholas Nethercote
1394091f86 Moved sys_mmap2 wrapper from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4595
2005-08-31 03:00:40 +00:00
Nicholas Nethercote
c198b967b3 Moved some more syscall wrappers from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4594
2005-08-31 02:44:31 +00:00
Nicholas Nethercote
b706da9aa9 Group Linux-specific syscalls a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4581
2005-08-30 02:45:44 +00:00
Nicholas Nethercote
b79e7281d4 Moved sched_* from "generic" to "linux"; Darwin doesn't have them.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4576
2005-08-30 02:17:23 +00:00
Nicholas Nethercote
40eb28bec1 Move *xattr from "generic" to "linux". Darwin has them, but with an extra
parameter.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4575
2005-08-30 01:53:54 +00:00
Nicholas Nethercote
ccad5e3600 Change slightly the way integers are printed by printf() and friends.
Previously, %d printed a 32-bit int.  %ld and %lld printed 64-bit ints.
So if you wanted to print a word-sized int (eg. a SizeT variable), you
had to cast it to a Long and then print with %lld in order to work on
both 32-bit and 64-bit platforms.

I changed things so that %d prints a 32-bit int, %ld prints a word-sized
int, and %lld prints a 64-bit int.  There are two advantages to this:
- it now matches the way the normal glibc printf() works;
- you can print word-sized ints without casting.

I also made the corresponding change for %u/lu/llu and %x/lx/llx, and I
changed a couple of VG_(printf)() invocations accordingly.





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4527
2005-08-26 19:42:27 +00:00
Nicholas Nethercote
45fc4050f8 Move *chown16 syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4523
2005-08-26 04:36:10 +00:00
Nicholas Nethercote
1fa6f9bf7a Move get*16 and set*16 syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4521
2005-08-26 04:27:54 +00:00
Nicholas Nethercote
7fd1f02169 Move cap{get,set} syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4520
2005-08-26 04:03:04 +00:00
Nicholas Nethercote
832989d4af Move timer_* syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4519
2005-08-26 03:54:30 +00:00
Nicholas Nethercote
c42361bf17 Move clock_* syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4518
2005-08-26 03:49:43 +00:00
Nicholas Nethercote
c710281899 Move mq_* syscalls from "generic" to "linux".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4517
2005-08-26 03:43:28 +00:00
Nicholas Nethercote
e266e53970 Minor fixes for problems pointed out by Greg Parker:
* The wrapper for fcntl(F_SETOWN) and fcntl(F_SETSIG) ignores ARG3,
  but should not.

* Linux PRE(sys_umount) doesn't print ARG2.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4487
2005-08-24 13:55:59 +00:00
Tom Hughes
b2f3925a5f Handle the fadvise64 system calls correctly on 32 bit platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4285
2005-07-27 22:57:18 +00:00
Tom Hughes
69ef21a629 Fix some inconsistent system call trace messages.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4251
2005-07-25 15:28:36 +00:00
Tom Hughes
03bc2deb25 Add support for the inotify system calls based on a patch
from John McCutchan <ttb@tentacle.dhs.org>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4250
2005-07-25 15:21:41 +00:00
Tom Hughes
a74aa1e74d Yet more system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4227
2005-07-22 15:04:14 +00:00
Nicholas Nethercote
7a4e062807 Avoid compiler warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4064
2005-06-30 04:09:11 +00:00
Nicholas Nethercote
b9bec5539d Remove all the completely unused SF_* flags. I suspect some of the
remaining ones have no interesting effect, but I left them in.

Also simplify the signature for VG_(get_memory_from_mmap_for_client)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4045
2005-06-28 22:14:53 +00:00
Nicholas Nethercote
5986d3e25f Fix bug #107524 -- epoll_ctl does not access 'events' if it's a
EPOLL_CTL_DEL invocation.

Also renamed our "struct epoll_event" to "struct vki_epoll_event" as it
should be called.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4014
2005-06-24 21:41:28 +00:00
Cerion Armour-Brown
c259dd1e6d VG_() -> ML() for ppc32, amd64
(plus a few scattered ones in comments etc)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4003
2005-06-23 07:52:54 +00:00