Commit Graph

71 Commits

Author SHA1 Message Date
Roland McGrath
ee36ce19e0 2004-09-03 Roland McGrath <roland@redhat.com>
* syscall.c (sysent0, sysent1, sysent2, sysent): Add const to defn.
	(nsyscalls0, nsyscalls1, nsyscalls2): Likewise.
	(errnoent0, errnoent1, errnoent2, errnoent): Likewise.
	(nerrnos0, nerrnos1, nerrnos2): Likewise.
	* signal.c (signalent0, signalent1, signalent2): Likewise.
	(nsignals0, nsignals1, nsignals2): Likewise.
	(signame): LIkewise.
	* ioctl.c (ioctlent0, ioctlent1, ioctlent2): Likewise.
	(nioctlents0, nioctlents1, nioctlents2): Likewise.
	(ioctl_lookup, ioctl_next_match): Likewise.
	* defs.h: Update decls.
	* io.c (sys_ioctl): Update users.
2004-09-04 03:53:10 +00:00
Roland McGrath
c74c0b732b 2004-09-01 Roland McGrath <roland@redhat.com>
* process.c (internal_wait): Take second arg giving index of flags
	argument.
	* defs.h: Update prototype.
	* syscall.c (internal_syscall): Update caller.
	Also use internal_wait for SYS_waitid.
	* process.c (sys_waitid): Define for [LINUX] as well.
	Don't tweak TCB_SUSPENDED--internal_wait does that.
	(waitid_types): Conditionalize use of nonstandard P_* macros.
2004-09-01 19:39:46 +00:00
Roland McGrath
aa510629c7 2004-08-31 Roland McGrath <roland@redhat.com>
* syscall.c (dumpio): Match pread and pwrite system calls too.
	Fixes Debian bug #239947.
2004-08-31 07:47:45 +00:00
Roland McGrath
6d1a65c759 2004-07-07 David S. Miller <davem@nuts.davemloft.net>
* linux/sparc/syscallent.h: Sync with reality.
	* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
	sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
	sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
	sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
	sys_removexattr, sys_lremovexattr, sys_fremovexattr,
	sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
	sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
	sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
	sys_timer_settime, sys_timer_gettime): New declarations.
	* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
	linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
	linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
	linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
	linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
	linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
	linux/sparc64/syscallent1.h: New files.
	* defs.h (LINUXSPARC): Define also when SPARC64.
	(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
	Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
	Define possibly missing __NR_exit_group.  Declare getrval2.
	* configure.ac (sparc64): New architecture case.
	* config.h.in (SPARC64): New define.
	* file.c (stat_sparc64): New structure.
	(printstat_sparc64): New output routine for that.
	(printstat): Call it, if personality is 2.
	(printstat64): Likewise.
	* util.c: Conditionalize ptrace defines on LINUXSPARC
	not LINUX && SPARC.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(_hack_syscall5): Correct trap number when SPARC64.
	(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
	(getpc): Handle SPARC64 && LINUX.
	(printcall): Likewise.
	(arg fetching/setting): Use same code for SPARC64 LINUX
	as for SPARC.
	(setbpt): Handle SPARC64 && LINUX.
	(clearbpt): Likewise.
	* signal.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(m_siginfo): Use same definition on SPARC64 as SPARC.
	(sys_sigreturn): Handle LINUX && SPARC64.
	* syscall.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(getscno): Use same static state on SPARC64 as SPARC,
	and add SPARC64 handling.
	(get_error): Handle LINUX && SPARC64.
	(force_result): Likewise.
	(syscall_enter): Likewise.
	(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
	just like SPARC.
	(getrval2): Handle LINUX && SPARC64.
	* process.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(change_syscall): Handle LINUX && SPARC64.
	(struct_user_offsets): Ifdef out those which do not exist
	on SPARC64.
	* net.c (sys_pipe): Handle LINUX && SPARC64.
	* ioctl.c: Fix initializer typo for nioctlents2, was
	nioctlents1 by accident.
2004-07-12 07:44:08 +00:00
Roland McGrath
998fac7049 2004-06-22 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_fixup) [LINUX && X86_64]: For 32-bit process,
	sign extend the low 32 bits of RAX to 64 bits.
	* syscall.c (force_result): [LINUX && X86_64]: Fix RAX*4 -> RAX*8.
2004-06-23 01:40:45 +00:00
Roland McGrath
d62b6711b4 2004-03-01 Roland McGrath <roland@redhat.com>
* strace.c (main): Avoid potential buffer overruns from ludicrous
	arguments or PATH values.
	* syscall.c (qual_signal): Bail out for too-long string.
2004-03-02 06:52:01 +00:00
Roland McGrath
ce9f0740d3 2004-03-01 Roland McGrath <roland@redhat.com>
* configure.ac: Check for `struct pt_all_user_regs'
	and `struct ia64_fpreg' in <sys/ptrace.h>.
	* util.c, process.c, syscall.c: Work around conflicts between
	<sys/ptrace.h> and <linux/ptrace.h> for defining those types.
2004-03-01 21:29:22 +00:00
Roland McGrath
b4ce17690f 2004-02-26 Andreas Schwab <schwab@suse.de>
* defs.h [LINUX && IA64]: Declare getrval2 also on IA64.
	* net.c (sys_pipe) [LINUX && IA64]: For IA64 use the two return values.
	* syscall.c (getrval2) [LINUX && IA64]: Implement for IA64.
2004-03-01 20:30:48 +00:00
Roland McGrath
08267b8d67 2003-12-31 David Mosberger <davidm@hpl.hp.com>
* process.c (internal_exit): For ia64, also recognize IA-32 252
	as exit_group().
	(change_syscall): For IA64, also support changing IA-32 syscalls.
	* syscall.c (internal_syscall): For IA64, also recognize IA-32
        syscall 252 (exit_group) as an internal_exit() syscall.
	* util.c (SYS_fork): For IA64, define them to the IA-32 syscall
	number.
	(SYS_vfork): Likewise.
	(arg_setup): For IA64 version, also support IA-32 syscalls.
	(get_arg0): Likewise.
	(get_arg1): Likewise.
	(set_arg0): Likewise.
	(set_arg1): Likewise.
2004-02-20 22:56:43 +00:00
Roland McGrath
182aa38bb2 2004-01-13 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [LINUX] [S390 || S390X]: Remove bogus upeek
	call.
2004-02-20 02:23:30 +00:00
Roland McGrath
190f8dd7b1 2003-12-14 Anton Blanchard <anton@samba.org>
* syscall.c (get_error) [POWERPC]: Cast result to unsigned long for
	ppc64, we were misreporting syscalls that really succeeded as having
	failed.
2004-01-13 10:13:44 +00:00
Roland McGrath
ee9c5b5d63 2003-11-01 Roland McGrath <roland@redhat.com>
* syscall.c (trace_syscall) [LINUX]: Calculate ONE_TICK once using
	setitimer rather than hard-coding a value based on HZ.
2003-11-01 22:11:22 +00:00
Roland McGrath
bb4833f1ae 2003-10-21 Roland McGrath <roland@redhat.com>
* syscall.c: Revert last change, was broken.
2003-10-22 06:11:30 +00:00
Roland McGrath
a9da8cd179 2003-09-24 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [LINUX] [S390 || S390X]: Bail out of
	instruction decoding branch if TCB_INSYSCALL is clear.
	Reported by <jochen@penguin-breeder.org>.
2003-09-24 22:22:41 +00:00
Roland McGrath
9c555e71d2 2003-07-05 Richard Henderson <rth@twiddle.net>
* process.c (sys_clone): Order arguments for alpha the same as x86_64.
	* syscall.c (ERESTART_RESTARTBLOCK): New.
	(trace_syscall): Print it.
	* linux/alpha/syscallent.h (osf_syscall): Name properly.
	(osf_set_program_attributes): Fix typo.
	(osf_nfssvc): Likewise.
	(osf_sigsendset): Likewise.
	(getdents64, gettid, readahead, tkill, setxattr, lsetxattr, fsetxattr,
	getxattr, lgetxattr, fgetxattr, listxattr, llistxattr, flistxattr,
	removexattr, lremovexattr, fremovexattr, futex, sched_setaffinity,
	sched_getaffinity, tuxcall, io_setup, io_destroy, io_getevents,
	io_submit, io_cancel, exit_group, lookup_dcookie, epoll_create,
	epoll_ctl, epoll_wait, remap_file_pages, set_tid_address,
	restart_syscall, fadvise, timer_create, timer_settime, timer_gettime,
	timer_getoverrun, timer_delete, clock_settime, clock_gettime,
	clock_getres, clock_nanosleep, semtimedop): New.
2003-07-09 09:47:59 +00:00
Roland McGrath
f5a477788e 2003-06-26 Roland McGrath <roland@redhat.com>
* configure.ac: SHMEDIA -> SH64
	* defs.h: Likewise.
	* mem.c: Likewise.
	* process.c: Likewise.
	* sock.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.
	* linux/shmedia/syscallent.h: Moved to ...
	* linux/sh64/syscallent.h: ... here.
2003-06-26 22:40:42 +00:00
Roland McGrath
7c051d2e4c 2003-06-26 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [LINUX] [ARM]: Fix variable usage.
	From: Joshua Neal <tinara@netpipeline.net>.
2003-06-26 22:29:32 +00:00
Roland McGrath
2f924cafae 2003-06-26 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [S390 || S390X]: Fix old vs new mode detection.
	From Michael Holzheu <HOLZHEU@de.ibm.com>.
2003-06-26 22:23:28 +00:00
Roland McGrath
0f87c4972f 2003-06-03 Roland McGrath <roland@redhat.com>
Linux/ARM improvements from Russell King <rmk@arm.linux.org.uk>:
	* defs.h [LINUX] (TCB_WAITEXECVE): Define for [ARM] too.
	* process.c (struct_user_offsets) [LINUX] [ARM]: Add ARM registers.
	* signal.c [LINUX] (sys_sigreturn) [ARM]: New case.
	* syscall.c (get_scno, syscall_fixup) [LINUX] [ARM]: Case rewritten.
	(get_error) [LINUX] [ARM]: Update.
	(syscall_enter) [LINUX] [ARM]: New case.
	* util.c (printcall) [LINUX] [ARM]: New case.
2003-06-03 23:29:04 +00:00
Roland McGrath
e1e584b8fa 2003-06-02 Roland McGrath <roland@redhat.com>
* configure.ac, defs.h, mem.c, process.c, sock.c, syscall.c, util.c:
	Merged in SHmedia port from Stephen Thomas <stephen.thomas@superh.com>.
2003-06-02 19:18:58 +00:00
Roland McGrath
2b61902ee9 2003-04-10 Roland McGrath <roland@redhat.com>
* syscall.c (qual_desc): Return zero after parsing number.
	From Rob Leslie <rob@mars.org>, fixes Debian bug #188379.
2003-04-10 18:58:20 +00:00
Roland McGrath
6b1d43ef29 2003-02-26 Stuart Menefy <stuart.menefy@st.com>
Various fixes for SuperH [SH]:
	* mem.c (sys_old_mmap): mmap() parameters passed in registers
	* net.c (sys_pipe), syscall.c (getrval2): pipe() results returned
	in registers
	* process.c (change_syscall): Fixed register which holds system
	call number
	* util.c (arg0_offset, arg1_offset): provide definition
	* Makefile.am: Added new files in linux/sh
	* linux/sh/syscallent.h: New file.
	* linux/sh/errnoent.h: New file.
	* linux/sh/ioctlent.h: New file.
	* linux/sh/signalent.h: New file.
2003-03-31 01:05:01 +00:00
Roland McGrath
ba95476dd4 2003-03-04 Roland McGrath <roland@redhat.com>
* syscall.c (get_scno) [IA64]: Do TCB_WAITEXECVE check only when
	TCB_INSYSCALL is clear, like other platforms do.
2003-03-05 06:29:06 +00:00
Roland McGrath
f3a0e1bb56 2003-02-19 Roland McGrath <roland@redhat.com>
FreeBSD rfork support changes from Russ Cox <rsc@plan9.bell-labs.com>:
	* syscall.c (internal_syscall): Handle SYS_rfork with internal_fork.
	* process.c (internal_fork) [SYS_rfork]: Bail if RFPROC flag not set.
2003-02-20 02:45:22 +00:00
Roland McGrath
96dc5148ff 2003-01-20 Roland McGrath <roland@redhat.com>
* defs.h [LINUX] [S390 || S390X] (TCB_WAITEXECVE): Define it.
	* syscall.c (get_scno, syscall_fixup) [LINUX] [S390 || S390X]: Handle
	TCB_WAITEXECVE state with special kludges.
2003-01-20 10:23:04 +00:00
Roland McGrath
eb28535990 2003-01-14 Roland McGrath <roland@redhat.com>
* configure.ac: Match powerpc* (includes powerpc64), and don't match
	ppc (never comes out of config.sub).
	* process.c (sys_ptrace): Use #lx format for address argument.
	[POWERPC]: Use sizeof(unsigned long) in place of 4 for multipliers.
	* process.c [POWERPC]: Likewise.
	* signal.c (sys_sigreturn) [POWERPC]: Likewise.
	* syscall.c (get_scno) [POWERPC]: Likewise.
	* util.c [POWERPC]: Likewise.
	(printnum): Use long for NUM.
	From Anton Blanchard <anton@samba.org>.
2003-01-14 09:59:00 +00:00
Roland McGrath
d38809b8bd 2003-01-09 Roland McGrath <roland@redhat.com>
* syscall.c (force_result) [S390 || S390X]: Fix typo.
2003-01-10 07:50:21 +00:00
Roland McGrath
923f750119 2003-01-08 Roland McGrath <roland@redhat.com>
Support for new Linux 2.5 thread features.
	* defs.h [LINUX]: Define __NR_exit_group if not defined.
	(struct tcb): New members nclone_threads, nclone_detached,
	and nclone_waiting.
	(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
	(waiting_parent): Macro removed.
	(pid2tcb): Declare it.
	* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
	child to our parent if we are a CLONE_THREAD child ourselves.
	Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
	(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
	determining if we have any.  If TCB_CLONE_THREAD is set, check
	parent's children instead of our own, and bump nclone_waiting count.
	(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
	the syscall was exit_group.
	* syscall.c (internal_syscall): Use internal_exit for exit_group.
	* strace.c (pid2tcb): No longer static.
	(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
	(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
	If we have thread children, set TCB_EXITING and don't clear the TCB.
	(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
	(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
	children of our parent that might be waiting for us too.
	[TCB_GROUP_EXITING] (handle_group_exit): New function.
	(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
2003-01-09 06:53:27 +00:00
Roland McGrath
9797cebddb 2002-12-30 Roland McGrath <roland@redhat.com>
* syscall.c (qualify_one): New function.
	(qual_options): Replace lookup field with qualify, update initializer.
	(qualify): Update caller.
	(qual_signal, qual_fault, qual_desc): Rewritten from lookup_*.
	(qual_syscall): Rewritten lookup_syscall, match name more than once.
	Fixes RH#70579, bites IA64 -efoo when foo exists on IA32.
2002-12-30 10:23:00 +00:00
Roland McGrath
b69f81b8e5 2002-12-21 Roland McGrath <roland@redhat.com>
* syscall.c (force_result): New function.
	* process.c (internal_wait): Handle ECHILD exit from wait call with
	WNOHANG flag set; force the return value to 0 in the inferior when it
	has live children we are tracing.
2002-12-21 23:25:18 +00:00
Roland McGrath
761b5d790f 2002-12-15 Roland McGrath <roland@redhat.com>
* syscall.c (syscall_enter) [LINUX && POWERPC]: Define PT_ORIG_R3 if
	not defined, since <asm/ptrace.h> defines it only #ifdef __KERNEL__.
	* process.c: Likewise.
	* syscall.c (trace_syscall): Use strerror, not sys_errlist/sys_nerr.
	* syscall.c (get_scno): Move static `currpers' inside #ifdef X86_64.
	(trace_syscall): Fix return without value.
2002-12-15 23:58:31 +00:00
Michal Ludvig
882eda809c 2002-11-09 Heiko Carstens <heiko.carstens@de.ibm.com>
Bugfix for s390/s390x:
        * syscall.c: Fixed scno derivation for s390/s390x.
2002-11-11 12:50:47 +00:00
Michal Ludvig
17f8fb3484 Added switch for printing only succeeding syscalls. 2002-11-06 13:17:21 +00:00
Michal Ludvig
10a88d09eb 2002-10-07 Michal Ludvig <mludvig@suse.cz>
Merged s390x port by Heiko Carstens <Heiko.Carstens@de.ibm.com>
        and bugfixes to s390 by D.J. Barrow.
2002-10-07 14:31:00 +00:00
Michal Ludvig
0e035502d2 2002-09-23 Michal Ludvig <mludvig@suse.cz>
Merged x86-64 port by Andi Kleen <ak@suse.de>
	and Michal Ludvig <mludvig@suse.cz>
	* Makefile.in: New target 'headers'. Failure ignored.
	* acconfig.h: New defines for x86-64.
	* configure.in: Ditto.
	* defs.h: Ditto.
	* file.c: Ditto.
	* signal.c: Ditto.
	* process.c: Added support for x86-64.
	* util.c: Ditto.
	* syscall.c: Ditto + added automatic personality switching.
	* linux/syscall.h: Ditto.
	* linux/x86_64: New directory.
	* linux/x86_64/Makefile.in: New file.
	* linux/x86_64/gentab.pl: Ditto.
	* linux/x86_64/i386-headers.diff: Ditto.
	* linux/x86_64/makeheaders.sh: Ditto.
	* linux/x86_64/syscallent.h: Ditto.
	* mem.c (print_mmap): Always print arg[4] as int.
2002-09-23 15:41:01 +00:00
Michal Ludvig
53b320f61f 2002-09-23 Michal Ludvig <mludvig@suse.cz>
* configure.in: Fix regular expressions.
	* linux/syscall.h: Added missing braces in prototype of
	sys_getdents64().
	* file.c: Use '#ifdef LINUX' instead of '#ifdef linux'.
	(struct fileflags): Made extern to inhibit compiation warnings.
	(sys_getdents64): Merged LINUX and SVR4 part.
	* syscall.c(get_scno): Split multiline string into two distinct
	strings.
2002-09-23 13:30:09 +00:00
Wichert Akkerman
ccef63782c Merge patch from Greg Banks for Linux/SuperH support 2002-05-01 16:39:22 +00:00
Wichert Akkerman
4527dae3b8 check for negative u_errors 2002-03-31 19:03:29 +00:00
Wichert Akkerman
7b3346be42 Import lots of ia64 related changes from David Mosberger 2001-10-09 23:47:38 +00:00
John Hughes
1d08dcf46d Merge iov fixes from Richard Kettlewell 2001-07-10 13:48:44 +00:00
John Hughes
4e36a8151b Handle fork1/forkall on uw, handle rfork1,rforkall,rexecve and ssisys on uw non-stop-clusters 2001-04-18 15:11:51 +00:00
Wichert Akkerman
00a82eed2b several Linux/sparc fixes 2001-03-28 20:29:17 +00:00
Wichert Akkerman
c1652e2095 Add Linux/hppa port, patch from Richard Hirst 2001-03-27 12:17:16 +00:00
John Hughes
61eeb55be4 Fix for freebsd 4.1 2001-03-06 15:51:53 +00:00
John Hughes
bdf48f55f2 Merge Harald Bhme's solaris patches 2001-03-06 15:08:09 +00:00
John Hughes
252997128d Use pr_syscall on UW 2001-03-06 10:10:06 +00:00
Wichert Akkerman
bf79f2e16b Add FreeBSD support 2000-09-01 21:03:06 +00:00
Wichert Akkerman
16a03d2e97 test/clone.c: minor fixup
Another bunch of patches from John Hughes merged:
signal.c:
+ SVR4 printcontext(): sigset_t != sigset_t*
+ getcontext returns a value, so print on exit of syscall
+ add UC_FP to ucontext_flags for OS writers that can't spell
+ sys_signal(): special case SIG_{ERR,DFL,IGN}
+ decode_subcall(): only do subcall range checking when needed
bunch of UnixWare updates
aclocal.m4, acconfig.h, configure.in: add test for long long type
2000-08-10 02:14:04 +00:00
Wichert Akkerman
5ae21ead9f The `too much stuff, just check the ChangeLog' update 2000-05-01 01:53:59 +00:00
Wichert Akkerman
c792698a99 README-linux: updated to note that strace might not compile
with development kernels
bjm.c: sys_query_module: check if malloc succeeds
system.c: sys_cap[gs]et(): check if malloc succeeds, only malloc once
linux/syscallent.h: updated for 2.3.99pre3
linux/alpha/syscallent.h: updated for 2.3.99pre3, add all osf syscalls
even though Linux doesn't implement them
syscall.c: add global variables for MIPS registers as well
syscall.c: move global variables to before get_scno since that uses them
util.c: oops, misspelled defined
process.c: fix ptrace calls in change_syscall
mem.c: decode sys_madvise
Merge patch from Topi Miettinen <Topi.Miettinen@nic.fi>
+ add support for quotactl, fdatasync, mlock, mlockall, munlockall & acct
+ small fix for RLIMIT_* and RUSAGE_BOTH
+ enhace support for capget and capset
2000-04-10 22:22:31 +00:00