Commit Graph

12 Commits

Author SHA1 Message Date
6bc832e2bc Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-04-05 01:40:00 +00:00
92d7499fbf Treat RVAL_DECIMAL the same way as RVAL_UDECIMAL
Assuming that syscalls may return negative values only as error codes,
always print non-error syscall return codes as unsigned.

* defs.h (RVAL_UDECIMAL): Remove.
(RVAL_DECIMAL): Rename to RVAL_UDECIMAL.
* syscall.c (syscall_exiting_trace) <case RVAL_DECIMAL>: Remove.
* clone.c (SYS_FUNC(fork)): Remove RVAL_UDECIMAL.
* lseek.c (SYS_FUNC(lseek)): Likewise.
* prctl.c (SYS_FUNC(prctl)): Likewise.
* uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Likewise.
* times.c (SYS_FUNC(times)): Always return 0.
* tests/inject-nf.c (main): Update expected output.
2018-03-29 16:00:18 +00:00
Eugene Syromyatnikov
9d095c7860 Add copyright headers 2017-05-22 17:33:51 +00:00
a1e94e9c7a Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval
After transition from long to kernel_ulong_t these fields
are no longer needed.

* defs.h (HAVE_STRUCT_TCB_EXT_ARG): Remove.
(struct tcb) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
[HAVE_STRUCT_TCB_EXT_ARG]: Remove.
(RVAL_MASK): Update.
* io.c (print_lld_from_low_high_val): Check
[SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
instead of [HAVE_STRUCT_TCB_EXT_ARG].
Use u_arg instead of ext_arg.
* linux/mips/get_error.c (get_error) [LINUX_MIPSN32]: Remove.
* linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSN32]:
Remove.
[LINUX_MIPSN64]: Extend to [LINUX_MIPSN32].
* linux/x86_64/get_error.c (get_error) [X32]: Remove.
* linux/x86_64/get_syscall_args.c (get_syscall_args) [X32]: Remove.
* lseek.c: Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
instead of [HAVE_STRUCT_TCB_EXT_ARG].
[SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] (SYS_FUNC(lseek)): Use u_arg
instead of ext_arg.  Use RVAL_UDECIMAL instead of RVAL_LUDECIMAL.
* mem.c (SYS_FUNC(mmap)): Pass offset syscall argument directly
to print_mmap.
* syscall.c (trace_syscall_exiting) [HAVE_STRUCT_TCB_EXT_ARG]: Remove.
* times.c (SYS_FUNC(times)): Use RVAL_UDECIMAL instead
of RVAL_LUDECIMAL.
* util.c (getllval): Check [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG]
instead of [HAVE_STRUCT_TCB_EXT_ARG].  Use u_arg instead of ext_arg.
2016-12-26 10:43:35 +00:00
031fc80059 Rename widen_to_ull to zero_extend_signed_to_ull
* defs.h (widen_to_ull): Rename to zero_extend_signed_to_ull.
All callers changed.
* tests/tests.h: Likewise.
2016-08-23 00:24:10 +00:00
84a979c9ee Fix explicit casts of signed integer types to unsigned long long
* defs.h (widen_to_ull): New macro.
* dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place
of explicit casts to unsigned long long.
* io.c (print_lld_from_low_high_val): Likewise.
* lseek.c (SYS_FUNC(llseek)): Likewise.
* printsiginfo.c (print_si_info): Likewise.
* printstat.h (DO_PRINTSTAT): Likewise.
* sysinfo.c (SYS_FUNC(sysinfo)): Likewise.
* times.c (SYS_FUNC(times)): Likewise.
* fetch_struct_statfs.c (ASSIGN_NUMBER): Remove.
(fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER
with widen_to_ull.
2016-05-26 14:44:13 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
e67c8e44db Replace %Ld/%Lu printf format specifiers with %lld/%llu
As %Ld and %Lu printf format specifiers are not quite portable,
replace them with %lld and %llu, respectively.

* desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu.
* dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise.
* times.c (SYS_FUNC(times)): Likewise.
* fcntl.c (print_struct_flock64): Replace %Ld with %lld.
* tests/ftruncate.c (main): Replace %Lu with %llu.
* tests/ftruncate64.c (main): Likewise.
* tests/getdents.c (print_dirent): Likewise.
* tests/llseek.c (main): Likewise.
* tests/lseek.c (main): Likewise.
* tests/truncate.c (main): Likewise.
* tests/truncate64.c (main): Likewise.
* tests/xstatx.c (main): Likewise.
* tests/pselect6.c (main): Replace %Ld with %lld.
* tests/xselect.c(main): Likewise.

Reported-by: Szabolcs Nagy <nsz@port70.net>
2015-12-16 00:07:16 +00:00
bb509aafb6 mips n32, x32: fix printing of times syscall return value
As times syscall returns kernel's long value, it has to be printed as
RVAL_LUDECIMAL on systems where long type is less than kernel's long.

* times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]:
Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL.
2015-12-06 07:24:16 +00:00
Elvira Khabirova
6773d6d8a1 Mpersify parser of times syscall
Fix multiple personalities support in parser of times syscall by
mpersifying struct tms.

* times.c (tms_t): New typedef.  Mpersify it.
(sys_times): Use it instead of struct tms.
2015-08-28 08:46:23 +00:00
d8ef5e70db Fix decoding of times syscall return value
Always print return value of successful times syscall
as unsigned long integer.

* times.c (sys_times): Return RVAL_UDECIMAL unless syserror.
2015-08-20 21:37:41 +00:00
Elvira Khabirova
254ff1e623 resource.c: move times parser to a separate file
* times.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* resource.c (sys_times): Move to times.c.
2015-08-16 10:05:19 +00:00