summaryrefslogtreecommitdiff
path: root/mem.c
Commit message (Collapse)AuthorAge
* Use XLAT_END macroDmitry V. Levin2014-02-05
| | | | | Automatically update all xlat structures using the following sed regexp: s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/
* Use XLAT macroDmitry V. Levin2014-02-05
| | | | | | Automatically convert all xlat structures to XLAT form using the following sed regexp: s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/
* mem: add missed MAP_HUGETLB mmap flagKirill A. Shutemov2014-01-05
| | | | | | | * mem.c (mmap_flags): Add MAP_HUGETLB mmap flag. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* tile: remove MAP_CACHE_xxx support in mem.cChris Metcalf2013-05-23
| | | | | | | | | | | | | These flags support functionality in mmap() that has not been pushed back to the community, and which may or may not eventually end up being the final community model. In the interim, having these flags unconditionally present for "#ifdef TILE" just means that the TILE build breaks if using the community versions of the kernel and glibc, so just revert the code until such time as it may end up in the community. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Update MADV_* constantsDmitry V. Levin2013-03-14
| | | | | | | * mem.c (madvise_cmds): Add more MADV_* constants from asm-generic/mman-common.h Reported-by: Robin Hack <hack.robin@gmail.com>
* Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFTDmitry V. Levin2013-03-05
| | | | | | | | | | PAGE_SHIFT couldn't be reliably obtained at compile time, thanks to Chris Metcalf for the hint. * mem.c: Do not include <sys/user.h>. [SH64] Do not include <asm/page.h>. (get_pagesize): New function. (sys_mmap_pgoff, sys_old_mmap_pgoff): Use it.
* Clean up mmap decodingDenys Vlasenko2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code merges too many similar, but different ways of decoding mmap. For example, sys_old_mmap is "params in memory" API... except SH[64], where it is "params in regs", i.e. what sys_mmap ("new mmap") function does on other arches! It's much simpler when every mmap handler has same API regardless of arch. Where API means whether params are in regs or in memory, and whether offset is in bytes, pages, or 4k blocks. Then we just insert correct function pointers into arch syscall tables. It turns out there are four common mmap APIs over all architectures which exist in Linux kernel, and one outlier for S390. A number of mmap decoders were plain wrong in arch tables. For example, BFIN has no old_mmap. It returns ENOSYS. I checked kernel sources for all arches nad fixed the tables. There was dead code for x86_64 for old_mmap: x86_64 has no old_mmap. * mem.c: Refactor mmap functions so that we have five mmap syscall handlers, each with the fixed API (not varying by arch). * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks. * linux/syscall.h: Declare new mmap syscall handler functions. * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff. * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff. * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff. * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff. * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff. * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff. * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff. * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg. * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent1.h: mmap is TD|TM. * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove unused function sys_mmap64Denys Vlasenko2013-02-18
| | | | | | | | | No wonder that it is unused. It's code looked quite questionable. * mem.c (sys_mmap64): Remove this function. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove code which supports systems with long long off_t.Denys Vlasenko2013-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While looking at mmap mess, did experimenting in order to figure out what gets used when. Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686, x86_64 and none of they have long long off_t, which isn't suprprising: we aren't using glibc defines which enable that. Moreover, we SHOULD NOT use off_t in syscall decode! Its size depends on libc, not on arch! I.e. it is essentially unpredictable and can even in theory vary on the same arch with different libc. We should use longs or long longs, in a way which matches architectural ABI for the given syscall. There are usually *at most* two permutations, no need to add yet another variable (sizeof(off_t)) to the mix. This change removes almost all HAVE_LONG_LONG_OFF_T conditionals, which will reveal further possible simplifications. * mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. As a result, never remap sys_mmap64 to sys_mmap. (print_mmap): Compile unconditionally. (sys_old_mmap): Compile unconditionally. (sys_mmap): Compile unconditionally. * io.c (sys_sendfile): Add a FIXME comment. * file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. As a result, never remap sys_*stat64 to sys_*stat etc. (sys_truncate): Compile unconditionally. (realprintstat): Likewise. (sys_stat): Likewise. (sys_fstat): Likewise. (sys_lstat): Likewise. * desc.c (printflock): Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fixes in "new" mmapDenys Vlasenko2013-02-18
| | | | | | | | | * mem.c (sys_mmap): Ensure unsigned expansion of tcp->u_arg[5]. Add page shift of offset for I386. Use tcp->ext_arg[5] as offset for X32. (sys_old_mmap): [X32] Remove this function, X32 doesn't use is. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Preliminary simplifications in mmap functionsDenys Vlasenko2013-02-18
| | | | | | | | | | | * mem.c: Move "define sys_mmap64 sys_mmap" from the top to the only place it affects. (print_mmap): Make offset argument unsigned, for safer implicit conversions. (sys_old_mmap): [IA64] use unsigned narrow_arg[]. Cast u_arg[5] (offset param) to unsigned long, to prevent erroneous signed expansion. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mmap: decode MAP_UNINITIALIZEDBernhard Reutner-Fischer2013-02-05
| | | | | | * mem.c (mmap_flags): Add MAP_UNINITIALIZED. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Add tilegx support to straceChris Metcalf2013-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tilegx support has been in the kernel since 3.0. In addition, fix some issues with the tilepro support already present in strace, primarily the decision to use the <asm/unistd.h> numbering space for system calls. * defs.h [TILE]: Include <asm/ptrace.h> and provide an extern struct pt_regs tile_regs for efficiency. Provide compat 32-bit personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY. * linux/tile/errnoent1.h: New file, includes linux/errnoent.h. * linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h. * linux/tile/signalent1.h: New file, includes linux/signalent.h. * linux/tile/syscallent.h: Update with new asm-generic syscalls. The version previously committed was the from the first tile patch to LKML, which subsequently was changed to use <asm-generic/unistd.h>. * linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h. * mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable. * process.c [TILE]: Choose clone arguments correctly and properly suppress all "struct user" related offsets in user_struct_offsets. * signal.c [TILE]: Use tile_regs not upeek. * syscall.c (update_personality) [TILE]: Print mode. (PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers. (tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state. (get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek. (get_scno) [TILE]: Set personality. (get_syscall_args) [TILE]: Use tile_regs. (get_syscall_result) [TILE]: Update tile_regs. (get_error) [TILE]: Use tile_regs. (printcall) [TILE]: Print pc. (arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]: Properly handle tile call semantics and support tilegx. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* x32: add ia32 supportH.J. Lu2012-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h, linux/x32/ioctlent1.h, linux/x32/signalent1.h and linux/x32/syscallent1.h. * configure.ac: Remove AC_GNU_SOURCE, obsoleted by AC_USE_SYSTEM_EXTENSIONS. * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32. (PERSONALITY1_WORDSIZE): Set to 4 for X32. * file.c (stat64): New struct for X32. (sys_lseek32): New function for X32. (stat64): Undef. (sys_fstat64): Likewise. (sys_stat64): Likewise. (realprintstat64): New function for X32. (sys_fstat64): Likewise. (sys_stat64): Likewise. * mem.c (sys_old_mmap): New function for X32. * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32. * syscall.c (update_personality): Add X32 support. (get_scno): Support currpers == 1 for X32. * linux/syscall.h (sys_lseek32): New function prototype for X32. * linux/x32/errnoent1.h: New file. * linux/x32/ioctlent1.h: Likewise. * linux/x32/signalent1.h: Likewise. * linux/x32/syscallent1.h: Likewise.
* Add x32 support to straceH.J. Lu2012-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with 32bit pointers. At system call level, x32 is also identical to x86-64, as shown by many changes like "defined(X86_64) || defined(X32)". The main differerence bewteen x32 and x86-64 is off_t in x32 is long long instead of long. This patch adds x32 support to strace. Tested on Linux/x32. * configure.ac: Support X32. * defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64, Set PERSONALITY2_WORDSIZE to 4 for X86_64. Add tcb::ext_arg for X32. * file.c (stat): New for X32. (sys_lseek): Use 64-bit version for X32. (printstat64): Check current_personality != 1 for X86_64. * ipc.c (indirect_ipccall): Check current_personality == 1 for X86_64. * mem.c (sys_mmap64): Also use tcp->u_arg for X32. Print NULL for zero address. Call printllval for offset for X32. * pathtrace.c (pathtrace_match): Don't check sys_old_mmap for X32. * process.c (ARG_FLAGS): Defined for X32. (ARG_STACK): Likewise. (ARG_PTID): Likewise. (change_syscall): Handle X32. (struct_user_offsets): Support X32. (sys_arch_prctl): Likewise. * signal.c: Include <asm/sigcontext.h> for X32. (SA_RESTORER): Also define for X32. * syscall.c (update_personality): Support X32 for X86_64. (is_restart_error): Likewise. (syscall_fixup_on_sysenter): Likewise. (get_syscall_args): Likewise. (get_syscall_result): Likewise. (get_error): Likewise. (__X32_SYSCALL_BIT): Define if not defined. (__X32_SYSCALL_MASK): Likewise. (get_scno): Check DS register value for X32. Use __X32_SYSCALL_MASK on X32 system calls. * util.c (printllval): Use ext_arg for X32. (printcall): Support X32. (change_syscall): Likewise. (arg0_offset): Likewise. (arg1_offset): Likewise. * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h, linux/x32/ioctlent.h.in, linux/x32/signalent.h, linux/x32/syscallent.h, linux/x86_64/errnoent2.h, linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and linux/x86_64/syscallent2.h. * linux/x32/errnoent.h: New. * linux/x32/ioctlent.h.in: Likewise. * linux/x32/signalent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/errnoent2.h: Likewise. * linux/x86_64/ioctlent2.h: Likewise. * linux/x86_64/signalent2.h: Likewise. * linux/x86_64/syscallent2.h: Likewise. Signed-off-by: H.J. Lu <hongjiu.lu@intel.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* MAP_ANON is the same as MAP_ANONYMOUS, no need to have the formerDenys Vlasenko2012-03-17
| | | | | | | * mem.c: Do not allocate string for MAP_ANON if it is the same as MAP_ANONYMOUS. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Indentation and whitespace fixes. No code changes.Denys Vlasenko2012-03-17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Tidy up includes and copyright notices, fix indentationDenys Vlasenko2012-03-16
| | | | | | | | | | | | | | | The files not mentioned in changelog below had only copyright notices fixes and indentation fixes. * defs.h: Include <stdint.h> and <inttypes.h>. * file.c: Do not include <inttypes.h>. Move struct kernel_dirent declaration below top include block. * block.c: Do not include <stdint.h> and <inttypes.h>. * quota.c: Likewise. * desc.c: Likewise. * signal.c: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Implement migrate_pages syscall decoderDmitry V. Levin2012-03-11
| | | | | | * linux/dummy.h (sys_migrate_pages): Remove. * linux/syscall.h (sys_migrate_pages): New prototype. * mem.c (sys_migrate_pages): New function.
* Compress blank linesDmitry V. Levin2012-02-25
| | | | | | Suppress repeated empty lines left after automated code removal. This change was made by filtering every source code file through "cat -s".
* Fix defined(FOO) styleDenys Vlasenko2012-02-25
| | | | | | | | | | | * file.c: Consistently use defined(FOO) instead of defined (FOO). * mem.c: Likewise. * net.c: Likewise. * signal.c: Likewise. * sock.c: Likewise. * linux/mips/syscallent.h: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Cleanup after non-Linux code removal.Denys Vlasenko2012-02-25
| | | | | | | | | Conditions such as defined(LINUX) are always true now, defined(FREEBSD) etc are always false. When if directive has them as subexpressions, it can be simplified. Another trivial changes here are fixes for directive indentation. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Automated removal of non-Linux codeDenys Vlasenko2012-02-25
| | | | | | | | | | This change is generated by running every source through the following command: unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD -USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS -UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Print NULL for zero address in sys_mmap64H.J. Lu2012-02-06
| | | | | * mem.c (sys_mmap64): Print NULL for zero address so that it is consistent with sys_mmap.
* Use tprints with literal strings, it may be faster than tprintfDenys Vlasenko2011-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | * bjm.c: Replace tprintf("str") with tprints("str"). * block.c: Likewise. * desc.c: Likewise. * file.c: Likewise. * io.c: Likewise. * ipc.c: Likewise. * mem.c: Likewise. * net.c: Likewise. * proc.c: Likewise. * process.c: Likewise. * quota.c: Likewise. * resource.c: Likewise. * scsi.c: Likewise. * signal.c: Likewise. * sock.c: Likewise. * strace.c: Likewise. * stream.c: Likewise. * syscall.c: Likewise. * system.c: Likewise. * term.c: Likewise. * time.c: Likewise. * util.c: Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Make out-of-memory handling more uniformDenys Vlasenko2011-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes one real bug in dumpstr(). * defs.h: Declare die_out_of_memory(). * strace.c (die_out_of_memory): New function. (strace_popen): If allocation fails, call die_out_of_memory(). (main): Likewise. (expand_tcbtab): Likewise. (rebuild_pollv): Likewise. * count.c (count_syscall): Likewise. (call_summary_pers): Likewise. * desc.c (decode_select): Likewise. * file.c (sys_getdents): Likewise. (sys_getdents64): Likewise. (sys_getdirentries): Likewise. * pathtrace.c (pathtrace_match): Likewise. * syscall.c (qualify): Likewise. * util.c (printstr): Likewise. (dumpiov): Likewise. (dumpstr): Likewise. (fixvfork): Likewise. * mem.c (sys_mincore): Don't check free() parameter for NULL. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix argument printing in sys_mmap64Denys Vlasenko2011-08-23
| | | | | | | * mem.c (sys_mmap64): Fix a bug where we used tcp->u_args[i] instead of argument values copied from memory. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Optimize sys_old_mmapDenys Vlasenko2011-08-23
| | | | | | | | | | | | * mem.c (sys_old_mmap): For Ia64 and 32-bit personality of x86-64, copy narrow parameters from userspace by single umove, not by six separate ones; then assign them to long u_arg[i]. For SH[64], avoid copying of tcp->u_arg. (sys_mmap): Add FIXME comment - SH64 and i386 seem to be handled differently for no apparent reason. * test/mmap_offset_decode.c: New test program, illustrates FIXME. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Untangle ifdef forest in sys_mmap64. No code changesDenys Vlasenko2011-08-23
| | | | | | | | | | | | | | | | After careful analysis, it looks like !LINUX and ALPHA pass all seven parameters in registers; and in all other cases parameters are on stack (pointed to by tcp->u_arg[0]). In light of this, reorganize ifdefs, making them simpler, without changing any logic. After this, it's apparent we use tcp->u_arg[4,5,6] and possibly [7] without checking that it's valid to do so. So far, just add a comment about this. * mem.c (sys_mmap64): Rewrite ifdefs in a much simpler way. Add comments about apparent bugs. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Style and comment fixes, no code changesDenys Vlasenko2011-08-23
| | | | | | | | * mem.c: Indent includes to show nesting better. (addtileflags): Fix style of this function definition; correct wrong endif comment, add another endif comment. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Whitespace cleanups. no code changes.Denys Vlasenko2011-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bjm.c: Fix tabulation (such as extra spaces before tabs), convert punctuation where it deviates from prevalent form elsewhere in strace code, convert sizeof and offsetof where it deviates from from prevalent form, remove space between function/macro/array names and (parameters) or [index], add space between "if" and (condition), correct non-standard or wrong indentaion. * defs.h: Likewise * desc.c: Likewise * file.c: Likewise * ipc.c: Likewise * linux/arm/syscallent.h: Likewise * linux/avr32/syscallent.h: Likewise * linux/hppa/syscallent.h: Likewise * linux/i386/syscallent.h: Likewise * linux/ioctlsort.c: Likewise * linux/m68k/syscallent.h: Likewise * linux/microblaze/syscallent.h: Likewise * linux/powerpc/syscallent.h: Likewise * linux/s390/syscallent.h: Likewise * linux/s390x/syscallent.h: Likewise * linux/sh/syscallent.h: Likewise * linux/sh64/syscallent.h: Likewise * linux/tile/syscallent.h: Likewise * linux/x86_64/syscallent.h: Likewise * mem.c: Likewise * net.c: Likewise * pathtrace.c: Likewise * process.c: Likewise * signal.c: Likewise * sock.c: Likewise * strace.c: Likewise * stream.c: Likewise * sunos4/syscall.h: Likewise * sunos4/syscallent.h: Likewise * svr4/syscall.h: Likewise * svr4/syscallent.h: Likewise * syscall.c: Likewise * system.c: Likewise * test/childthread.c: Likewise * test/leaderkill.c: Likewise * test/skodic.c: Likewise * time.c: Likewise * util.c: Likewise Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* "Modernize" all old-style function parameter declarationsDenys Vlasenko2011-05-30
| | | | | | | | | | | | | | | | | | | | * bjm.c: Convert all remaining old-style C function definitions to a "modern" form. This does not change any actual code. * io.c: Likewise * ioctl.c: Likewise * net.c: Likewise * proc.c: Likewise * process.c: Likewise * signal.c: Likewise * sock.c: Likewise * strace.c: Likewise * stream.c: Likewise * syscall.c: Likewise * system.c: Likewise * time.c: Likewise * util.c: Likewise Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix decoding of file descriptorsDmitry V. Levin2011-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | * defs.h (printfd): New function prototype. * util.c (printfd): New function. * file.c (print_dirfd): Update prototype to use printfd(). (sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat, sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat, sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd(). (sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64, sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64, sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync, sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr, sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64, sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch, sys_fallocate): Use printfd() for decoding of file descriptors. * desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2, decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for decoding of file descriptors. * io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread, sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64, sys_ioctl): Likewise. * mem.c (print_mmap, sys_mmap64): Likewise. * signal.c (do_signalfd): Likewise. * stream.c (decode_poll): Likewise. * time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise. Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.
* Decode TLS syscalls on m68kAndreas Schwab2010-05-28
| | | | | | | | * linux/m68k/syscallent.h: Add entries for get_thread_area, set_thread_area, atomic_comxchg_32, atomic_barrier. * linux/dummy.h (sys_get_thread_area, sys_set_thread_area) [M68K]: Don't redefine. * mem.c (sys_get_thread_area, sys_set_thread_area) [LINUX && M68K]: New.
* Add support for the TILE architectureChris Metcalf2010-02-05
| | | | | | | | | | | | | | | * configure.ac: Add TILE to the list of supported architectures. * defs.h: Define TCB_WAITEXECVE for TILE. * linux/tile/syscallent.h: New file. * Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h * process.c (change_syscall, struct_user_offsets): Add TILE support. * syscall.c (get_scno, get_error, syscall_enter): Likewise. * mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions support. * signal.c (sigact_flags): Add SA_NOPTRACE. (sys_sigreturn): Add TILE support. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
* Decode fifth argument of mremap syscallDmitry V. Levin2009-12-25
| | | | | * mem.c (sys_mremap): Decode fifth argument. * linux/*/syscallent.h: Update the number of mremap syscall arguments.
* * mem.c (sys_mbind): Display first argument in hexChris Metcalf2009-12-24
|
* * mem.c (mremap_flags): Add MREMAP_FIXEDChris Metcalf2009-12-24
|
* Factor out printing of 64bit syscall argumentAndreas Schwab2009-11-04
| | | | | | | | | | | | | | | | | | * defs.h (ALIGN64): Remove. (printllval): Declare. * util.c (printllval): Define. * file.c (sys_readahead): Use printllval. (sys_lseek64): Likewise. (sys_truncate64): Likewise. (sys_ftruncate64): Likewise. (sys_fadvise64): Likewise. (sys_fadvise64_64): Likewise. (sys_fallocate): Likewise. * io.c (sys_pread): Likewise. (sys_pwrite): Likewise. (sys_pread64): Likewise. (sys_pwrite64): Likewise. * mem.c (sys_mmap64): Likewise.
* By Michal Nowak <mnowak@redhat.com>:Denys Vlasenko2009-01-23
| | | | | | * mem.c (print_ldt_entry): Fix warning: Format '%#08lx' expects type 'long unsigned int', but argument 2 was type 'unsigned int'.
* Fixing many instances of broken indentation with spaces instead of tabs.Denys Vlasenko2008-12-30
| | | | No code changes.
* 2008-08-24 Roland McGrath <roland@redhat.com>Roland McGrath2008-08-25
| | | | | | | * linux/powerpc/syscallent.h: Handle subpage_prot. * mem.c [LINUX && POWERPC] (sys_subpage_prot): New function. * linux/syscall.h [POWERPC]: Declare it. From Simon Murray <simon@transitive.com>.
* 2008-08-24 Roland McGrath <roland@redhat.com>Roland McGrath2008-08-25
| | | | | * mem.c (mmap_prot): Handle PROT_SAO. From Simon Murray <simon@transitive.com>.
* 2008-08-24 Roland McGrath <roland@redhat.com>Roland McGrath2008-08-25
| | | | | | * mem.c (madvise_flags): Typo fixes. Rename to madvise_cmds. (sys_madvise): Use printxval, not printflags. Reported by Rajeev V. Pillai <rajeevvp@gmail.com>.
* 2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>Roland McGrath2008-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | * defs.h [MIPS]: Include <sgidefs.h>. (MAX_QUALS): Update for MIPS. (LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define. (struct tcb): Add ext_arg for MIPS N32. (TCB_WAITEXECVE): Define for MIPS. (ALIGN64): Use LINUX_MIPSO32. * file.c (sys_lseek): Use ext_arg for MIPS N32. (sys_readahead, sys_fadvise64_64): Likewise. * io.c (sys_pread64, sys_pwrite64): Likewise. * mem.c (print_mmap): Take OFFSET argument. (sys_old_mmap): Update call to print_mmap. (sys_mmap): Use ext_arg for MIPS N32. * process.c (struct_user_offsets): Add MIPS registers. * signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64. Correct MIPS O32 call to sprintsigmask. * syscall.c (internal_syscall): Handle MIPS N32. Check for TCB_WAITEXECVE on MIPS. (force_result): Add a comment about MIPS N32. (syscall_enter): Handle MIPS N32 and MIPS N64. * linux/syscall.h (sys_pread64, sys_pwrite64): Declare. * linux/mips/syscallent.h: Include "dummy.h". Handle alternate MIPS ABIs.
* 2007-09-11 Roland McGrath <roland@redhat.com>Roland McGrath2007-09-12
| | | | | * mem.c (sys_getpagesize): Define for [SPARC || SPARC64] too. From Jakub Bogusz <qboosh@pld-linux.org>.
* 2007-07-23 Ulrich Drepper <drepper@redhat.com>Roland McGrath2007-07-24
| | | | | | | | * mem.c (move_pages_flags): New variable. (sys_move_pages): New function. * linux/syscall.h: Declare sys_move_pages. * linux/syscallent.h: Add entry for sys_move_pages. * linux/x86_64/syscallent.h: Likewise.
* 2007-03-30 Dmitry V. Levin <ldv@altlinux.org>Dmitry V. Levin2007-03-29
| | | | | * mem.c (mmap_flags): Add MAP_32BIT. Reported by Kirill A. Shutemov.
* 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>Dmitry V. Levin2006-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make several global variables static. #ifdef definitions of rarely unused functions. * defs.h (rflag, tflag, outfname): Remove. * strace.c (iflag, interactive, pflag_seen, rflag, tflag, outfname, username): Make static. * desc.c (sys_getdtablesize): Define only for ALPHA || FREEBSD || SUNOS4. * file.c (sys_fchroot): Define only for SUNOS4 || SVR4. (sys_mkfifo): Define only for FREEBSD. * mem.c (sys_sbrk): Define only for FREEBSD || SUNOS4. (sys_getpagesize): Define only for ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4. * net.c (sys_so_socket): Define only for SVR4. * process.c (sys_gethostid): Define only for FREEBSD || SUNOS4 || SVR4. (sys_gethostname): Define only for ALPHA || FREEBSD || SUNOS4 || SVR4. (sys_setpgrp): Define only for ALPHA || SUNOS4 || SVR4. (sys_execv): Define only for SPARC || SPARC64 || SUNOS4. * signal.c (sys_sigblock): Define only for FREEBSD || SUNOS4. (sys_sighold, sys_sigwait): Define only for SVR4. (sys_killpg): Define only for FREEBSD || SUNOS4. * stream.c (sys_getmsg): Define only for SPARC || SPARC64 || SUNOS4 || SVR4. * syscall.c (sys_indir): Define only for SUNOS4.
* 2005-07-05 Roland McGrath <roland@redhat.com>Roland McGrath2005-07-05
| | | | | | * mem.c [LINUX] (sys_old_mmap) [X86_64]: Extract 32-bit values if child is 32-bit. Fixes RH#162467.