Commit Graph

55 Commits

Author SHA1 Message Date
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
Tom Hughes
cf8c1b047f Handle the SCTP_GET_LOCAL_ADDRS and SCTP_GET_PEER_ADDRS getsockopt
calls correctly. Fix to bug #111231.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4549
2005-08-28 10:16:29 +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
1d0665b897 whoops
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4522
2005-08-26 04:30:34 +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
ed0bcea859 Rename vg_preload_core.so to vgpreload_core.so to be consistent with
tool preload modules, which are called vgpreload_<tool>.so.  Also
fixed a couple of comments relating to this.

(This need not be merged into 3_0_X.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4514
2005-08-25 22:53:57 +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
Julian Seward
b42cf14c30 Enable a few more syscalls on ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4463
2005-08-19 10:07:29 +00:00
Tom Hughes
2f83dba402 Don't assert if execve fails. Fixes bug #110875.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4435
2005-08-16 10:19:58 +00:00
Nicholas Nethercote
c1719a4c98 Clarify comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4406
2005-08-14 17:36:07 +00:00
Tom Hughes
ebe67e6134 Check the fields of the new structure passed to sigaction individually
and only check sa_restorer if the SA_RESTORER flag is set.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4338
2005-08-07 15:16:59 +00:00
Tom Hughes
5636f53a8c If the pre-handler for the execve system call fails to state the file
being executed then propagate the error from the stat instead of just
return ENOACCES all the time. Fixes bug #110208.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4330
2005-08-05 07:46:32 +00:00
Tom Hughes
3f28625849 Implement the waitid system call. Fixes bug #110202.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4329
2005-08-05 07:32:04 +00:00
Tom Hughes
888f6e02cf Allow a NULL second argument to clock_getres. Fixes bug #110203.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4328
2005-08-05 07:22:00 +00:00
Tom Hughes
4f8e0cb52b Take the address of the ifr_index member when testing if it is defined
before an SIOCGIFNAME ioctl.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4295
2005-07-29 18:42:22 +00:00
Tom Hughes
cca571d1c9 Handle the TIOCMGET ioctl.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4291
2005-07-28 16:26:34 +00:00
Tom Hughes
1dc053205f Handle the HDIO_GETGEO ioctl. Secondary problem found from bug #109780.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4290
2005-07-28 16:13:42 +00:00
Tom Hughes
fd2217006c Handle a number of additional block device ioctls. Fixes bug #109780.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4288
2005-07-28 16:08:09 +00:00
Julian Seward
ab00074929 Change some int uses to Int (the house types).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4229
2005-07-23 09:22:46 +00:00
Julian Seward
6789f6542e A commit which is almost all trivial change.
- m_main: if --log-file-qualifier applies, do not add ".pid"
  at the end of the name

- Fix the logic which detected whether the just-devised name
  already existed.  This was broken (by me) because it could not
  distinguish the reasons for failing to open the logfile.

  Doing this required changing the return type of VG_(open)
  from Int to SysRes (to make failure reasons visible) and 
  that's the cause of most of the changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4228
2005-07-23 09:18:34 +00:00
Tom Hughes
5c41eefec8 The timeout argument to rt_sigtimedwait is in the third argument not
the fourth, plus linux allows it to be null.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4214
2005-07-20 09:32:35 +00:00
Tom Hughes
5e7b1d48c7 More system call fixups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4213
2005-07-20 09:24:04 +00:00
Tom Hughes
dc892caf68 Fix compiler warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4190
2005-07-19 15:28:31 +00:00
Tom Hughes
bd8021aa26 Fix the mmap2 pre-handler to avoid corrupting the arguments when
it fails with ENOMEM due to a lack of memory.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4184
2005-07-19 13:04:04 +00:00
Tom Hughes
9a1ea2d7cc Fix crash when no environment is given to execve.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4169
2005-07-18 23:23:03 +00:00
Tom Hughes
5914fa6a53 Check members of the stack_t structure passed to sigaltstack
individually to avoid problems with padding on 64 bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4168
2005-07-18 23:18:10 +00:00
Tom Hughes
ada7c716a1 Check each member of the ifconf structure passed to SIOCGIFCONF
individually to avoid problems with padding bytes on 64 bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4167
2005-07-18 22:45:55 +00:00
Tom Hughes
2b08b3a3b0 Check each field of the msghdr structure passed to sendmsg/recvmsg
individually to avoid complaints due to uninitialised padding bytes
on 64 bit platforms.

Also fixed sendmsg to check things which should be initialised (the
msghdr structure and the iov array) properly instead of doing a write
check for everything.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4166
2005-07-18 22:41:33 +00:00
Nicholas Nethercote
776cd36bb4 add comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4163
2005-07-18 14:10:12 +00:00
Tom Hughes
a85d532b0d Take a copy of the environment given to execve before trying to mangle
it as it might be in read only memory. Fixes bug #101881.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4162
2005-07-18 14:02:11 +00:00
Tom Hughes
0fef787853 Handle the BLKGETSIZE64 ioctl. Fixes bug #104797.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4161
2005-07-18 13:26:55 +00:00
Tom Hughes
83dfcfa3f9 Allow a NULL argument to the times system call. Fixes bug #103509.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4158
2005-07-18 11:03:35 +00:00
Tom Hughes
fcf186b9c8 Sort out the mess that is pread64/pwrite64 properly. All three platforms
that we currently support use the same handlers in the kernel without any
platform specific wrappers.

The final argument is a 64 bit argument however, which means that it
requires two registers on x86 and ppc32 and only one on amd64. The
reason it works in the kernel is that x86 and ppc32 calling conventions
inside the kernel work out correctly and the values get joined together.

For our purposes we make x86 and ppc32 use the generic veneer with
five arguments and amd64 use a platform specific one with four...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4110
2005-07-05 23:25:17 +00:00
Nicholas Nethercote
4e8bcf9076 Move the last remaining tests out of corecheck.
Also introduced VG_(showing_core_errors)() to make core error display
more consistent.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4073
2005-07-01 04:15:36 +00:00
Nicholas Nethercote
4560b81e33 Avoid magic numbers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4057
2005-06-30 00:16:02 +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
88b532de40 Simplify atfork to only provide the functionality we need.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4032
2005-06-26 15:11:37 +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
Nicholas Nethercote
d463dd2292 Removed the VGA_/VGO_/VGP_ prefixes for arch/OS/platform-specific
things.  These made sense when the arch/OS/platform-specific code was in
one module, but as that code got mixed in with generic code the boundary
between generic and non-generic blurred, and the distinction made less
sense.  So let's get rid of them.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Nicholas Nethercote
d35537f51f Removed some repetition in the way VG_(record_fd_open)() is called.
As part of this, VG_(resolve_filename)() no longer calls VG_(malloc)()
and so m_libcfile no longer depends on m_mallocfree.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4001
2005-06-23 02:26:47 +00:00
Julian Seward
9cb0696641 For symbols which have C-level global scope but which we regard as
module-local, use the new ML_ prefix instead of VG_.  This makes it
trivial to see which names are those exported from public module
interfaces: precisely those using VG_.

/* VG_ is for symbols exported from modules.  ML_ (module-local) is
   for symbols which are not intended to be visible outside modules,
   but which cannot be declared as C 'static's since they need to be
   visible across C files within a given module.  It is a mistake for
   a ML_ name to appear in a pub_core_*.h or pub_tool_*.h file.
   Likewise it is a mistake for a VG_ name to appear in a priv_*.h
   file. 
*/



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4000
2005-06-23 01:02:53 +00:00
Nicholas Nethercote
40a921359c Move VKI_SIGVGKILL and VKI_SIGVGRTUSERMAX out of vki-linux.h since they're
not really from the kernel and they're defined in terms of VG_(max_signal),
which is in m_signals.  Renamed them with the VG_ prefix too, since they're
now not part of the kernel interface.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3990
2005-06-21 22:23:59 +00:00
Nicholas Nethercote
ba17e79287 Slight reduce m_syswrap's dependence on m_signals by moving
VG_(client_signal_OK)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3982
2005-06-21 03:52:49 +00:00
Nicholas Nethercote
fc38860306 Don't #include pub_core_debuginfo.h in pub_core_aspacemgr.h. So have
to #include it explicitly in lots of other places, but at least the 
dependency is clear now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3974
2005-06-21 00:28:11 +00:00