Commit Graph

49 Commits

Author SHA1 Message Date
Chris Metcalf
ff3474aa5a * mem.c (mremap_flags): Add MREMAP_FIXED 2009-12-24 23:19:19 +00:00
Andreas Schwab
b5600fc3df Factor out printing of 64bit syscall argument
* 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.
2009-11-04 17:10:25 +01:00
Denys Vlasenko
1f45825644 By Michal Nowak <mnowak@redhat.com>:
* mem.c (print_ldt_entry): Fix warning:
Format '%#08lx' expects type 'long unsigned int', but
argument 2 was type 'unsigned int'.
2009-01-23 16:10:22 +00:00
Denys Vlasenko
adedb51019 Fixing many instances of broken indentation with spaces instead of tabs.
No code changes.
2008-12-30 18:47:55 +00:00
Roland McGrath
4a6f652cb7 2008-08-24 Roland McGrath <roland@redhat.com>
* 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-25 03:09:16 +00:00
Roland McGrath
586d6ab9f2 2008-08-24 Roland McGrath <roland@redhat.com>
* mem.c (mmap_prot): Handle PROT_SAO.
	From Simon Murray <simon@transitive.com>.
2008-08-25 03:00:47 +00:00
Roland McGrath
f4021b1466 2008-08-24 Roland McGrath <roland@redhat.com>
* mem.c (madvise_flags): Typo fixes.  Rename to madvise_cmds.
	(sys_madvise): Use printxval, not printflags.
	Reported by Rajeev V. Pillai <rajeevvp@gmail.com>.
2008-08-25 02:59:36 +00:00
Roland McGrath
542c2c6fe2 2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>
* 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.
2008-05-20 01:11:56 +00:00
Roland McGrath
da6c92c234 2007-09-11 Roland McGrath <roland@redhat.com>
* mem.c (sys_getpagesize): Define for [SPARC || SPARC64] too.
	From Jakub Bogusz <qboosh@pld-linux.org>.
2007-09-12 01:26:29 +00:00
Roland McGrath
2c00a4a3cb 2007-07-23 Ulrich Drepper <drepper@redhat.com>
* 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-07-24 01:52:58 +00:00
71f1a1372c 2007-03-30 Dmitry V. Levin <ldv@altlinux.org>
* mem.c (mmap_flags): Add MAP_32BIT.
	Reported by Kirill A. Shutemov.
2007-03-29 23:30:09 +00:00
b9fe011cdf 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
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.
2006-12-13 16:59:44 +00:00
Roland McGrath
520e21f01e 2005-07-05 Roland McGrath <roland@redhat.com>
* mem.c [LINUX] (sys_old_mmap) [X86_64]: Extract 32-bit values if
	child is 32-bit.
	Fixes RH#162467.
2005-07-05 09:50:18 +00:00
Roland McGrath
aa524c88c4 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
Deal with memory management issues.
	* defs.h (tprint_iov): Update prototype.
	* desc.c (sys_epoll_wait) [HAVE_SYS_EPOLL_H]: Do not allocate
	epoll_event array of arbitrary size on the stack, to avoid
	stack overflow.
	* file.c (print_xattr_val): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.
	* io.c (tprint_iov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Change iovec array handling to avoid heap memory allocation.
	* mem.c (get_nodes) [LINUX]: Check for integer overflow during
	size calculation and do not allocate array of arbitrary size on
	the stack, to avoid stack overflow.
	* net.c (printcmsghdr) [HAVE_SENDMSG]: Do not allocate array of
	arbitrary size on the stack, to avoid stack overflow.  Do not
	trust cmsg.cmsg_len to avoid read beyond the end of allocated
	object.
	(printmsghdr) [HAVE_SENDMSG]: Update tprint_iov() usage.
	* process.c (sys_setgroups): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.  Change gid_t
	array handling to avoid heap memory allocation.
	(sys_getgroups): Likewise.
	(sys_setgroups32) [LINUX]: Likewise.
	(sys_getgroups32) [LINUX]: Likewise.
	* stream.c (sys_poll) [HAVE_SYS_POLL_H]: Check for integer
	overflow during malloc size calculation, to avoid heap corruption.
	Change pollfd array handling to avoid heap memory allocation.
	* system.c (sys_sysctl) [LINUX]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	* util.c (dumpiov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Fixes RH#159196.
2005-06-01 19:22:06 +00:00
Roland McGrath
b2dee13345 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* util.c (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument, "const char *", with similar
	meaning to the third argument of printxval().
	* defs.h (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument.
	* bjm.c (sys_query_module) [LINUX]: Pass third argument to
	printflags().
	* desc.c (sys_fcntl): Likewise.
	(sys_flock) [LOCK_SH]: Likewise.
	(print_epoll_event) [HAVE_SYS_EPOLL_H]: Likewise.
	* file.c (sys_open): Likewise.
	(solaris_open) [LINUXSPARC]: Likewise.
	(sys_access): Likewise.
	(sys_chflags, sys_fchflags) [FREEBSD]: Likewise.
	(realprintstat) [HAVE_LONG_LONG_OFF_T &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(printstat64) [HAVE_STAT64 &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(sys_setxattr, sys_fsetxattr): Likewise.
	* ipc.c (sys_msgget, sys_msgsnd, sys_msgrcv, sys_semget,
	sys_shmget, sys_shmat) [LINUX || SUNOS4 || FREEBSD]: Likewise.
	(sys_mq_open) [LINUX]: Likewise.
	(printmqattr) [HAVE_MQUEUE_H]: Likewise.
	* mem.c (print_mmap) [!HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mmap64) [_LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mprotect): Likewise.
	(sys_mremap, sys_madvise, sys_mlockall) [LINUX]: Likewise.
	(sys_msync) [MS_ASYNC]: Likewise.
	(sys_mctl) [MC_SYNC]: Likewise.
	(sys_remap_file_pages, sys_mbind, sys_get_mempolicy) [LINUX]:
	Likewise.
	* net.c (printmsghdr) [HAVE_STRUCT_MSGHDR_MSG_CONTROL]: Likewise.
	(sys_send, sys_sendto): Likewise.
	(sys_sendmsg) [HAVE_SENDMSG]: Likewise.
	(sys_recv, sys_recvfrom): Likewise.
	(sys_recvmsg) [HAVE_SENDMSG]: Likewise.
	(printicmpfilter) [ICMP_FILTER]: Likewise.
	* proc.c (proc_ioctl) [SVR4 && !HAVE_MP_PROCFS || FREEBSD]: Likewise.
	* process.c (sys_clone) [LINUX]: Likewise.
	(printwaitn): Likewise.
	(sys_waitid) [SVR4 || LINUX]: Likewise.
	* signal.c (sys_sigvec) [SUNOS4 || FREEBSD]: Likewise.
	(sys_sigaction): Likewise.
	(printcontext) [SVR4]: Likewise.
	(print_stack_t) [LINUX) || FREEBSD]: Likewise.
	(sys_rt_sigaction) [LINUX]: Likewise.
	* sock.c (sock_ioctl) [LINUX]: Likewise.
	* stream.c (sys_putmsg, sys_getmsg): Likewise.
	(sys_putpmsg) [SYS_putpmsg]: Likewise.
	(sys_getpmsg) [SYS_getpmsg]: Likewise.
	(sys_poll): Likewise.
	(print_transport_message) [TI_BIND]: Likewise.
	(stream_ioctl): Likewise.
	* system.c (sys_mount, sys_reboot): Likewise.
	(sys_cacheflush) [LINUX && M68K]: Likewise.
	(sys_capget, sys_capset) [SYS_capget]: Likewise.
	* term.c (term_ioctl) [TIOCMGET]: Likewise.
	* time.c (sys_clock_nanosleep, sys_timer_settime) [LINUX]:
	Likewise.
	Fixes RH#159310.
2005-06-01 19:02:36 +00:00
Roland McGrath
46100d0725 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* bjm.c (sys_query_module) [LINUX]: Unitize "out of memory"
	errors reporting style.
	* strace.c (rebuild_pollv) [USE_PROCFS]: Likewise.
	* system.c (sys_capget, sys_capset) [SYS_capget]: Likewise.
	* util.c (printstr): Likewise.
	(dumpiov) [HAVE_SYS_UIO_H]: Likewise.
	(fixvfork) [SUNOS4]: Likewise.
	* desc.c (decode_select): Continue to decode syscall arguments
	in case of OOM condition.
	* file.c (sys_getdents): Likewise.
	(sys_getdents64) [_LFS64_LARGEFILE]: Likewise.
	(sys_getdirentries) [FREEBSD]: Likewise.
	* mem.c (sys_mincore): Changed type of variables which deal with
	malloc size from int to unsigned long.
	Fixes RH#159308.
2005-06-01 18:55:42 +00:00
Roland McGrath
b10a33590d 2004-10-07 Roland McGrath <roland@redhat.com>
* mem.c [LINUX] (sys_mbind, sys_set_mempolicy, sys_get_mempolicy):
	New functions.
	* linux/syscall.h: Declare them.
	* linux/x86_64/syscallent.h: Likewise.
	* linux/syscallent.h: Handle mbind, set_mempolicy, get_mempolicy.
	From Ulrich Drepper <drepper@redhat.com>.
2004-10-07 18:53:12 +00:00
Roland McGrath
d9f816f604 2004-09-03 Roland McGrath <roland@redhat.com>
* util.c (xlookup, printxval, addflags, printflags): Use const for
	struct xlat * argument.
	* defs.h (xlookup, printxval, addflags, printflags): Update decls.
	* bjm.c: Add const to all struct xlat defns.
	* desc.c: Likewise.
	* file.c: Likewise.
	* ipc.c: Likewise.
	* mem.c: Likewise.
	* net.c: Likewise.
	* proc.c: Likewise.
	* process.c: Likewise.
	* resource.c: Likewise.
	* signal.c: Likewise.
	* sock.c: Likewise.
	* stream.c: Likewise.
	* system.c: Likewise.
	* term.c: Likewise.
	* time.c: Likewise.
	* util.c: Likewise.
2004-09-04 03:39:20 +00:00
Roland McGrath
05cdd3c6a5 2004-03-01 Roland McGrath <roland@redhat.com>
* mem.c [LINUX]: <asm/mman.h> -> <linux/mman.h>
2004-03-02 06:16:59 +00:00
Roland McGrath
7decfb2298 2004-03-01 Roland McGrath <roland@redhat.com>
* configure.ac: Check for `struct user_desc' in <asm/ldt.h>.
	* process.c [HAVE_STRUCT_USER_DESC]: Use struct user_desc in place of
	struct modify_ldt_ldt_s.
	* mem.c [HAVE_STRUCT_USER_DESC]: Likewise.
2004-03-01 22:10:52 +00:00
Roland McGrath
47eb0e2a0c 2003-09-25 Roland McGrath <roland@redhat.com>
* mem.c (mmap_prot) [PROT_SEM, PROT_GROWSDOWN, PROT_GROWSUP]: Include
	these in the table if they are defined.
2003-09-25 23:06:04 +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
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
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
72c5b7bf73 2003-03-04 Ulrich Drepper <drepper@redhat.com>
* mem.c [LINUX] (sys_remap_file_pages): New function.
	* linux/syscall.h: Declare it.
	* linux/syscallent.h: Use it.
	* linux/powerpc/syscallent.h: Likewise.
2003-03-05 04:08:00 +00:00
Roland McGrath
909875ba26 2002-12-21 Roland McGrath <roland@redhat.com>
* linux/syscallent.h: Add some new 2.5 syscall names.
	Now clone takes 5 args.
	* process.c [LINUX] (clone_flags): Update with 2.5 flag bits.
	[LINUX] (sys_clone): Print new args.
	* mem.c (print_ldt_entry): Make global.
2002-12-22 03:34:36 +00:00
Roland McGrath
34e4a6984c 2002-12-15 Roland McGrath <roland@redhat.com>
* mem.c: Add sys_{get,set}_thread_area.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Update the table for these.
	* linux/dummy.h (sys_modify_ldt): Define only #ifndef I386.
	(sys_get_thread_area, sys_set_thread_area): New macros #ifndef I386.
2002-12-15 23:58:17 +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
John Hughes
aca07f3d18 Implement memcntl for UnixWare 2001-10-16 18:12:27 +00:00
John Hughes
0c79e01d74 replace wimpy get64 by powerful LONG_LONG :-) 2001-03-08 14:40:06 +00:00
John Hughes
70623be853 Use configure to detect 64bit off_t and rlim_t 2001-03-08 13:59:00 +00:00
John Hughes
5a826b8427 Fix off_t args on FreeBSD 2001-03-07 13:21:24 +00:00
John Hughes
bdf48f55f2 Merge Harald Bhme's solaris patches 2001-03-06 15:08:09 +00:00
Wichert Akkerman
bf79f2e16b Add FreeBSD support 2000-09-01 21:03:06 +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
Wichert Akkerman
12f75d1a38 S390 updates 2000-02-14 16:23:40 +00:00
Wichert Akkerman
8b1b40cd8b Merge Trillian patches (Linux ia64) 2000-02-03 21:58:30 +00:00
Wichert Akkerman
4dc8a2aec6 Bunch of stuff 1999-12-23 14:20:14 +00:00
Wichert Akkerman
f5eeabb156 Start merging linux-ip-routing fork 1999-11-18 17:09:47 +00:00
Wichert Akkerman
f90da01fd1 Add Linux MIPS support 1999-10-31 21:15:38 +00:00
Wichert Akkerman
e6f876c49d Linux/powerpc and SunOS fixes 1999-06-22 15:28:30 +00:00
Wichert Akkerman
50a2745c88 Bring Linux/powerpc up to date 1999-06-21 13:07:29 +00:00
Wichert Akkerman
8829a55dc2 Various fixes, see ChangeLog for details 1999-06-11 13:18:40 +00:00
Wichert Akkerman
2e2553a534 Merged in a bunch of patches that I got as reaction to the 3.99 release.
See the ChangeLog for details
1999-05-09 00:29:58 +00:00
Wichert Akkerman
8bc6cfd067 Minor compiliation-fixes 1999-04-21 15:57:38 +00:00
Wichert Akkerman
328c5e7fd8 Added support for old*stat syscalls for Linux
Changed referenced to LINUX to linux in file.c
Fix include for ldt.h in mem.c while we're at it
1999-04-16 00:21:26 +00:00
Wichert Akkerman
5daa028ca3 Simply bugfixes, see patch to debian/changelog for details 1999-03-15 19:49:42 +00:00
Wichert Akkerman
76baf7c9f6 Initial revision 1999-02-19 00:21:36 +00:00