summaryrefslogtreecommitdiff
path: root/defs.h
Commit message (Collapse)AuthorAge
* [EMBTK]ARM/MIPS: still need asm/ptrace.h for struct pt_regsAbdoulaye Walsimou Gaye2014-05-25
| | | | Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
* Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_THEADmasterJames Hogan2014-05-21
| | | | | | | | | | | | | | When strace is built with large file support definitions in CFLAGS (as may be provided by buildroot) the C library headers may expose a 64-bit rlim_t even though the struct rlimit fields used by the system call interface are only 32-bit. The SIZEOF_RLIM_T will then be 8 which results in bad decoding of the getrlimit and setrlimit syscalls. This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with checks for current_wordsize. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Fix preadv/pwritev offset decodingDmitry V. Levin2014-04-17
| | | | | | | | | | | | | | | | | | | | * util.c (printllval): Add align argument. * defs.h (printllval): Update prototype. (printllval_aligned, printllval_unaligned): New macros. * file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64, sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2, sys_fallocate): Replace printllval call with printllval_aligned. * io.c (sys_pread, sys_pwrite): Likewise. (sys_preadv, sys_pwritev): Replace printllval call with printllval_unaligned. * linux/arm/syscallent.h: Set the number of preadv and pwritev arguments to 5. * linux/mips/syscallent-o32.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Likewise. Reported-by: Dima Kogan <dima@secretsauce.net>
* Implement fanotify_init and fanotify_mark decodingDmitry V. Levin2014-02-05
| | | | | | | | | | | | | | * fanotify.c: New file. * linux/fanotify.h: Likewise. * Makefile.am (strace_SOURCES): Add fanotify.c. (EXTRA_DIST): Add linux/fanotify.h. * defs.h (print_dirfd): New prototype. * file.c (print_dirfd): Export. * linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove. * linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New prototypes. * pathtrace.c (pathtrace_match): Handle sys_fanotify_init and sys_fanotify_mark.
* Itroduce XLAT_END macro to make xlat structures more compactDmitry V. Levin2014-02-05
| | | | * defs.h (XLAT_END): New macro.
* Introduce XLAT macro to ease maintenance of xlat structuresDmitry V. Levin2014-02-05
| | | | | | * defs.h (XLAT): New macro. Suggested-by: Mike Frysinger <vapier@gentoo.org>
* Decode ptp ioctlsStefan Sørensen2014-02-04
| | | | | | | | | | | | * defs.h (ptp_ioctl): New prototype. * ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='. * Makefile.am (strace_SOURCES): Add ptp.c. (EXTRA_DIST): Add linux/ptp_clock.h. * ptp.c: New file. * linux/ptp_clock.h: New file. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Assume that <sys/ptrace.h> provides a valid ptrace prototypeDmitry V. Levin2013-11-13
| | | | | | | | | | | | We used to explicitly list architectures where <sys/ptrace.h> from glibc is known to provide a valid prototype for ptrace, and use a homegrown replacement for all the rest. Situation seems to be better nowadays, glibc is not the only libc available, so let's use ptrace prototype from <sys/ptrace.h> by default, leaving the replacement for rare broken cases if any. * defs.h: Use ptrace prototype workaround iff NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.
* Stop using _LFS64_LARGEFILEDmitry V. Levin2013-11-12
| | | | | | | | | | | There is only one place left in the code where strace guesses whether libc provides LFS64 functions and structures. The most natural thing to do there is to check for _LARGEFILE64_SOURCE - the macro provided by glibc. Other libc implementations that provide nondegenerate LFS64 interfaces are expected to define this macro as well. * defs.h (_LFS64_LARGEFILE): Remove. * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE.
* Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specificDmitry V. Levin2013-11-12
| | | | | | | | | * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and PTRACE_POKEUSER. * defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if they are not provided by <sys/ptrace.h>. Reported by John Spencer.
* Fix select decoding on e.g. 32-bit ppc process by 64-bit strace.Denys Vlasenko2013-11-09
| | | | | | | | | | Added next_set_bit() function which finds the next set bit, properly taking into account word size of the traced process. Use it in decode_select() instead of fd_isset(). Also, properly round fdsize up to word size of traced process, not to strace's word size. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Add support for ARC Cores from SynopsysVineet Gupta2013-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Take #2 on mainlining strace support for ARC (last one was 4.6 based back in March 2011), see http://sourceforge.net/p/strace/mailman/message/27210168/ The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls), hence very similar to metag port. test/* all seem to work well. * linux/arc/ioctlent.h.in: New file. * linux/arc/syscallent.h: Likewise. * Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and linux/arc/syscallent.h. * configure.ac: Add ARC to the list of supported architectures. * defs.h: Add ARC support. * process.c (struct_user_offsets): Likewise. * signal.c (sys_sigreturn): Likewise. * syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args, get_syscall_result, get_error): Likewise. * util.c (change_syscall): Likewise. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Fix sigset printing via print_sigset().Denys Vlasenko2013-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace print_sigset() with print_sigset_addr_len(), which takes not only addr, but also len parameter. This allows us to drop "do we need to print RT signals?" parameter, and this fixes RT signals printing in many syscalls. sys_epoll_pwait: print RT signals too, print sigmask size argument. sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize), no change in functionality. sys_sigpending: use print_sigset_addr_len(current_wordsize) instead of open-coding it. sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it. sys_rt_sigpending: ditto. sys_rt_sigsuspend: ditto. sys_rt_sigtimedwait: ditto. do_signalfd: print_sigset -> print_sigset_addr_len. This fixes RT signals printing (wasn't showing them before). sys_ppoll: ditto. copy_sigset_len() is folded into its only user, print_sigset_addr_len(), and copy_sigset() is gone. While at it, checked kernel sources and noted where kernel enforces sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)), and where it allows word-sized sigset_size ([rt_]sigpending). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Group USE_CUSTOM_PRINTF define with other tweakablesDenys Vlasenko2013-07-16
| | | | | | No code changes. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Improve sigreturn decoding on x86 to show RT signal bits too.Denys Vlasenko2013-07-16
| | | | | | | | | This includes decoding of 32-bit sigreturn by 64-bit strace, which previously wasn't done. Added a test for it. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* powerpc: fix iflag build issue (static -> extern)Anton Blanchard2013-07-12
| | | | | Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Remove ia64-specific printing of current address on signal deliveryDenys Vlasenko2013-07-01
| | | | | | The address is printed anyway by printleader() if -i is active. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Rename ia32 to ia64_ia32mode, and make it bool, not longDenys Vlasenko2013-07-01
| | | | | | Grepping for just ia32 was turning up many false positives. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fold is_restart_error() into its sole userDenys Vlasenko2013-06-30
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Change upeek() to take pid, not full tcp.Denys Vlasenko2013-06-28
| | | | | | This will be used by next change. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* powerpc: Use PTRACE_GETREGS to fetch all registersAnton Blanchard2013-06-26
| | | | | | | | | | | | * defs.h: declare ppc_regs and get_regs_error. * signal.c (sys_sigreturn): Use ppc_regs instead of upeek. * syscall.c: define ppc_regs. (printcall): Use ppc_regs instead of upeek. (get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call. (get_syscall_result): Likewise. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Get rid of TCB_INUSE and TCB_STRACE_CHILDDenys Vlasenko2013-06-26
| | | | | | | | We can use tcb::pid == 0 as an indicator of free tcb, and we already have strace_child variable which holds pid of our child, if any. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Cleanups. No logic changes.Denys Vlasenko2013-06-18
| | | | | | | | * defs.h: Define new ptrace constants unconditionally. * strace.c (detach): Fix comment. (trace): Remove now unnecessary "if USE_SEIZE". Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Hide startup syscalls.Denys Vlasenko2013-05-14
| | | | | | | | | | | | | | | | | | | Tested with "./strace [-D] [-q] [-bexecve] env true", all cases seem to work. * defs.h: Declare new variable: bool hide_log_until_execve. * strace.c: Define hide_log_until_execve. Rename skip_startup_execve to skip_one_b_execve. (startup_child): Do not set skip_one_b_execve = 1 here. (init): If "strace PROG" case (as opposed to "strace -pPID"), set skip_one_b_execve and hide_log_until_execve to 1. (trace): Don't print signal messages if hide_log_until_execve == 1. * syscall.c (trace_syscall_entering): Skip syscall printing if hide_log_until_execve == 1. Reset hide_log_until_execve if we enter execve syscall. (trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Allow -q to be repeated for very quiet outputDaniel P. Berrange2013-05-13
| | | | | | | | | | | | | | Even with the -q flag specified, tracing output is still mixed with messages about signals and process exit status, which is often irrelevant. Allow the -q option to be repeated to force the suppression of signals / exit status info too. * defs.h: Change 'qflag' from 'bool' to 'unsigned int'. * strace.1: Document ability to repeat '-q' option. * strace.c: Allow '-q' to be repeated to quieten process exit status and signal messages. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* mips: fix build regressionMike Frysinger2013-05-07
| | | | | | | | | | The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled the mips headers around causing it to check the ABI defines before it included the header which set those up. Now all mips builds fail with: In file included from count.c:36:0: defs.h:48:4: error: #error Unsupported _MIPS_SIM * defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check.
* mips o32: raise the max number of syscall arguments to 7Dmitry V. Levin2013-05-07
| | | | | | On mips o32, fadvise64_64 takes 7 arguments. * defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7.
* Decode mtd/ubi ioctlsMike Frysinger2013-05-02
| | | | | | | | | | | | | | | | | Been playing with UBI of late and it'd help if I could see what it was doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes a pointer to a 64bit value, not a strict. * util.c (MAX, MIN): Move to ... * defs.h (MAX, MIN): ... here. (CLAMP): Define. (ubi_ioctl): New prototype. * ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'. * mtd.c: Include ubi user API header. (ubi_volume_types): New enum decode. (ubi_volume_props): Likewise. (ubi_ioctl): Define. * linux/ubi-user.h: Import from linux 3.8.
* Add support for the XTENSA architectureChris Zankel2013-03-25
| | | | | | | | | | | | | | * configure.ac: Add XTENSA to the list of supported architectures. * defs.h: Add XTENSA support. * linux/xtensa/syscallent.h: New file. * linux/xtensa/ioctlent.h.in: Likewise. * process.c (struct_user_offsets): Add XTENSA support. * signal.c (sys_sigreturn): Likewise. * syscall.c (printcall, get_scno, get_syscall_args, get_syscall_result, get_error): Likewise. * util.c (change_syscall): Likewise. Signed-off-by: Chris Zankel <chris@zankel.net>
* i386, tile, x32: do not redefine ptrace prototypeDmitry V. Levin2013-03-18
| | | | * defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h.
* Open-code isprint(c) and isspace(c)Denys Vlasenko2013-03-06
| | | | | | | | | | | | | | | | | | | | We don't call setlocale, thus we always use C locale. But libc supports various other locales, and therefore its ctype interface is general and at times inefficient. For example, in glibc these macros result in function call, whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e suffices. By open-coding ctype checks (we have only 4 of them) we avoid function calls, we get smaller code: text data bss dec hex filename 245127 680 5708 251515 3d67b strace_old 245019 676 5708 251403 3d60b strace and we don't link in ctype tables (beneficial for static builds). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Stop using a large static buffer in getfdpathDenys Vlasenko2013-03-06
| | | | | | | | text data bss dec hex filename 245075 680 9836 255591 3e667 strace_old 245143 680 5708 251531 3d68b strace Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove variable tracing_paths and check in pathtrace_matchDenys Vlasenko2013-03-05
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use dynamically-sized selected[] array for -P PATHDenys Vlasenko2013-03-05
| | | | | | | | | | | While at it, added a small optimization of not remembering the path twice if it happens to be the same. text data bss dec hex filename 245111 680 10860 256651 3ea8b strace_old 245075 680 9804 255559 3e647 strace Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add support for Imagination Technologies MetaJames Hogan2013-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Imagination Technologies Meta architecture (the architecture/ABI is usually referred to as metag in code). The Meta Linux kernel port is in the process of being upstreamed for v3.9 so it uses generic system call numbers. sys_lookup_dcookie writes a filename to buffer argument, so I've set TF flag. nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h so I've left it blank. truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit args which are packed tightly on metag, so less arguments on metag. fchdir/llseek takes a file descriptor so s/TF/TD/ sync_file_range has 2 64bit args so uses 6 args, so s/4/6/ timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/ shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args. oldgetrlimit is just getrlimit for metag. add TM flag to various memory syscalls. metag doesn't directly use sys_mmap_pgoff for mmap2. prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag. fanotify_init doesn't appear to take a file descriptor so remove TD. Add kcmp syscall. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Christian Svensson <blue@cmd.nu> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Assorted NOMMU fixesDenys Vlasenko2013-02-26
| | | | | | | | | | | | With -D, strdup'ing of pathname is necessary only on NOMMU. Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode (try "strace [-D] -b env echo HI" to see whether we detach on correct execve). Fix test_ptrace_FOO shortcuts on NOMMU to always assume success and _properly_ set all variables. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Eliminate MAX_QUALS, make qualifier array dynamicDenys Vlasenko2013-02-22
| | | | | | | | | | | | | | | | | | | | | | | MAX_QUALS was 2048, even though most arches used less than 500 entries in it. MAX_QUALS had to be maintained by hand to be higher than syscall count. It also limited the highest possible fd to track. This change makes qual_flagsN[] arrays start sized to the required minimum (number of syscalls) and grow dynamically if user requested -e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit can be raised with no cost for normal strace invocations. qual_flags is now a define to qual_vec[current_personality]. As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent names in one-personality arches to their corresponding <foo>0 arrays, removing one indirection level. text data bss dec hex filename 244471 700 12928 258099 3f033 strace.t7/strace 244627 680 10860 256167 3e8a7 strace.t8/strace Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Create and use struct_sysent and struct_ioctlent typedefs.Denys Vlasenko2013-02-22
| | | | | | | | | | This is a preparatory mass replace patch with no code changes. The future change will need to typedef sysent to sysent0, which results in compile failures when "struct sysent" string gets mangled into "struct sysent0". Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev()Denys Vlasenko2013-02-22
| | | | | | | | | | | We have hundreds of uses of these macros. Result is more efficient and 1.1 kbyte shorter code: text data bss dec hex filename 245579 700 12928 259207 3f487 strace.t5/strace 244471 700 12928 258099 3f033 strace.t6/strace Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove unused QUAL_FAULT code (was used by non-Linux code only).Denys Vlasenko2013-02-21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use uint8_t for qual_flags[] instead of ints.Denys Vlasenko2013-02-21
| | | | | | | | | | Resulting bss reduction is ~6kbytes: text data bss dec hex filename 245703 700 19072 265475 40d03 strace.t4/strace 245687 700 12928 259315 3f4f3 strace.t5/strace Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Eliminate many SCNO_IS_VALID checksDenys Vlasenko2013-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By adding tcp->s_ent pointer tot syscall table entry, we can replace sysent[tcp->scno] references by tcp->s_ent. More importantly, we may ensure that tcp->s_ent is always valid, regardless of tcp->scno value. This allows us to drop SCNO_IS_VALID(tcp->scno) checks before we access syscall table entry. We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks with a similar technique. Resulting code shrink: text data bss dec hex filename 245975 700 19072 265747 40e13 strace.t3/strace 245703 700 19072 265475 40d03 strace.t4/strace * count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check. * defs.h: Add "int qual_flg" and "const struct sysent *s_ent" to struct tcb. Remove "int u_nargs" from it. Add UNDEFINED_SCNO constant which will mark undefined scnos in tcp->qual_flg. * pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno]. * process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs. (sys_waitid): Likewise. * strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS constant is consistent with init code. * syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent. (decode_ipc_subcall): Likewise. (printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs. (printargs_lu): Likewise. (printargs_ld): Likewise. (get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check. If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values. (internal_fork): Use tcp->s_ent instead of sysent[tcp->scno]. (syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno]. (get_syscall_args): Likewise. (get_error): Drop SCNO_IS_VALID check where it is redundant. (dumpio): Drop SCNO_IS_VALID check where it is redundant. Use tcp->s_ent instead of sysent[tcp->scno]. (trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno]. Drop SCNO_IS_VALID check where it is redundant. Print undefined syscall name with undefined_scno_name(tcp). (trace_syscall_exiting): Likewise. * util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno]. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ARM: make it one-personality archDenys Vlasenko2013-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARM in fact _is_ one personality. We had two personalities for it because it has a handful of syscalls with huge scnos (0x000f00xx). Extending syscall table to have [0x000f0005] index is of course not a good idea. Someone decided to handle that by having a separate personality just for these syscalls. But multi-personality arch does a bit more work in other parts. This patch is another alternative: "move" 0x000f00nn syscalls down to the entries just above last ordinary syscall, by manipulating scno if it falls into the 0x000f00xx range. In order to not worsen genuine undefined scnos' printing, the code remaps scno back to actual value before printing "syscall_NNN" string. * defs.h: Remove multi-reprsonality defines from ARM. * syscall.c (shuffle_scno): New function. (undefined_scno_name): New function. (get_scno): [ARM] Replace personality setting with scno shuffling. (trace_syscall_entering): Print unknown syscall name using undefined_scno_name(). (trace_syscall_exiting): Likewise. * linux/arm/syscallent.h: Add ARM specific syscalls at the end. * linux/arm/errnoent1.h: Deleted. * linux/arm/ioctlent1.h: Deleted. * linux/arm/signalent1.h: Deleted. * linux/arm/syscallent1.h: Deleted. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use the same style of includes in linux/*/* filesDenys Vlasenko2013-02-20
| | | | | | | | While at it, fix some comments which say "we use i386 syscalls/ioctls/errnos" but in reality common ones are used. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Make it possible to to do test builds for NOMMU architecturesDenys Vlasenko2013-02-19
| | | | | | | And while using it, I discovered that -D doesn't work too well on NOMMU. Added a comment about it. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove broken HAVE_LONG_LONG conditionalsDenys Vlasenko2013-02-17
| | | | | | | | | | | | | | | | We use printllval without HAVE_LONG_LONG guards in many places, but define it only if HAVE_LONG_LONG. This means that on !HAVE_LONG_LONG systems we won't build for some time now. * defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro and printllval() function declaration. * util.c: Remove HAVE_LONG_LONG guard around printllval() function definition. (printllval): Add compile-time error check for using wrong if branch. Explain places where we deliberately use mismatched types for printf formats. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Merge two identical tablesDenys Vlasenko2013-02-17
| | | | | | | | | | * defs.h: Declare whence_codes[]. * desc.c: Delete static whence[]. (printflock[64]): Use whence_codes. * file.c: Make whence_codes[] non-static. Add SEEK_DATA and SEEK_HOLE to them. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Simple optimization in get_errorDenys Vlasenko2013-02-16
| | | | | | | | | * defs.h: Define SCNO_IN_RANGE(scno) macro. * syscall.c (get_error): Change return type to void. Use SCNO_IN_RANGE instead of SCNO_IS_VALID. (trace_syscall_exiting): Stop checking get_error() return value. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALIDDenys Vlasenko2013-02-16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Finish prefixing regs struct names with arch_Denys Vlasenko2013-02-16
| | | | | | | | | | * defs: Rename regs -> sparc_regs. * signal.c (sys_sigreturn): Use new variable name. * syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs. (getrval2): Use new variable names. (printcall): Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>