Commit Graph

136 Commits

Author SHA1 Message Date
Denys Vlasenko
b1efe53531 Fix build breakage from my previous commit.
Now I test for PT_SETOPTIONS being #defined.
Remove trailing whitespace.
No actual code changes.
2008-12-23 16:14:42 +00:00
4371b10b30 2008-10-23 Dmitry V. Levin <ldv@altlinux.org>
Implement parsers for new linux syscalls.
	* desc.c (do_dup2, [LINUX] sys_dup3): New functions.
	(sys_dup2): Use do_dup2.
	[LINUX] (sys_epoll_create1): New function.
	[LINUX] (do_eventfd, sys_eventfd2): New functions.
	[LINUX] (sys_eventfd): Use do_eventfd.
	* net.c (do_pipe, [LINUX] sys_pipe2): New functions.
	(sys_pipe): Use do_pipe.
	* signal.c [LINUX] (do_signalfd, sys_signalfd4): New functions.
	[LINUX] (sys_signalfd): Use do_signalfd.
	* linux/syscall.h: Declare new sys_* functions.
	* linux/syscallent.h: Hook up signalfd4, eventfd2, epoll_create1,
	dup3, pipe2, inotify_init1.
	* linux/x86_64/syscallent.h: Hook up paccept, signalfd4, eventfd2,
	epoll_create1, dup3, pipe2, inotify_init1.
2008-11-10 22:53:02 +00:00
21a7534745 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* desc.c (sys_fcntl): Do not initialize auxstr for failed syscall.
	* process.c (sys_fork, sys_rfork) [USE_PROCFS]: Likewise.
	* signal.c (sys_signal): Likewise.
	* stream.c (internal_stream_ioctl): Likewise.
	* time.c (sys_adjtimex): Likewise.
	* syscall.c (trace_syscall): If RVAL_STR is set, then
	print auxstr for failed syscall as well.
2008-09-03 01:22:18 +00:00
Roland McGrath
fe10aa70a7 2007-09-22 Dmitry V. Levin <ldv@altlinux.org>
* desc.c (sys_pselect6): Decode signal mask when entering syscall.
	Relax signal mask size check.
2007-11-01 21:52:20 +00:00
Roland McGrath
6bc09daaf6 2007-09-22 Dmitry V. Levin <ldv@altlinux.org>
* time.c (print_timespec, sprint_timespec): New functions.
	* defs.h (print_timespec, sprint_timespec): Declare them.
	* desc.c (sys_io_getevents): Use print_timespec.
	* stream.c (sys_ppoll): Likewise.
	(decode_poll): Use sprint_timespec.
2007-11-01 21:50:54 +00:00
Roland McGrath
a6c0d8c90a 2007-09-22 Dmitry V. Levin <ldv@altlinux.org>
* desc.c (sprintflags): Remove static qualifier, add "prefix"
	argument, move function to ...
	* util.c (sprintflags): ... here.
	* defs.h (sprintflags): Declare it.
2007-11-01 21:46:22 +00:00
Roland McGrath
e7c3967019 2007-07-23 Ulrich Drepper <drepper@redhat.com>
* desc.c (sys_eventfd): New function.
	* linux/syscall.h: Declare sys_eventfd.
	* linux/syscallent.h: Add entry for eventfd.
	* linux/x86_64/syscallent.h: Likewise.
2007-08-02 01:32:17 +00:00
Roland McGrath
f240005701 2007-07-23 Ulrich Drepper <drepper@redhat.com>
* desc.c (sys_epoll_wait): Move body of function to ...
	(epoll_wait_common): ...here.  New function.
	(sys_epoll_pwait): New function.
	* linux/syscall.h: Declare sys_epoll_pwait.
	* linux/syscallent.h: Add entry for epoll_pwait.
	* linux/x86_64/syscallent.h: Likewise.
2007-08-02 01:13:26 +00:00
Roland McGrath
6afc5659ac 2007-07-23 Ulrich Drepper <drepper@redhat.com>
* defs.h: Add new parameter to printtv_bitness prototype.
	(printttv): Pass zero for the new parameter.
	(printtv_special): New macro.
	* desc.c (decode_select): Pass zero for the new parameter of
	printtv_bitness.
	* file.c (utimensatflags): New macro.
	(sys_osf_utimes): Pass zero for the new parameter of
	printtv_bitness.
	(sys_utimes): Likewise.
	(sys_futimesat): Likewise.
	(decode_utimes): Add new parameter.  Pass it to the
	printtv_bitness calls.  Fix printing of time values.
	(sys_utimensat): New function.
	* time.c (UTIME_NOW, UTIME_OMIT): Define if not already
	happened.
	(printtv_bitness): Add new parameter.  Print special UTIME_*
	values as strings if set.
	(sys_osf_gettimeofday): Pass zero for the new parameter of
	printtv_bitness.
	(sys_osf_settimeofday): Likewise.
	* linux/syscall.h: Declare sys_utimensat.
	* linux/syscallent.h: Add utimensat entry.
	* linux/x86_64/syscallent.h: Likewise.
2007-07-24 01:57:11 +00:00
9b5b67eb43 2007-01-11 Dmitry V. Levin <ldv@altlinux.org>
Fix open(2) flags parser.
	* defs.h (tprint_open_modes): New function.
	* desc.c (sprint_open_modes): New function.
	(sys_fcntl): Use tprint_open_modes() and sprint_open_modes().
	* file.c (openmodes): Split xlat into open_access_modes and
	open_mode_flags.
	(tprint_open_modes): New function.
	(decode_open): Use it.
	* ipc.c (sys_mq_open, printmqattr): Likewise.
	Fixes RH#222385.
2007-01-11 23:19:55 +00:00
ab9008bc08 2006-12-27 Dmitry V. Levin <ldv@altlinux.org>
Add const qualifier to xlookup() return value

	* defs.h (xlookup): Add const qualifier to return value.
	* desc.c (sprintflags): Likewise.
	* process.c (printpriv): Update xlookup() use.
	* signal.c (sprintsigmask): Add const qualifier to first argument and return value.
	* util.c (xlookup): Add const qualifier to return value.
	(printxval): Update xlookup() use.
2007-01-11 22:05:04 +00:00
a7945a3d4e 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>
Add biarch support for "struct timeval".
	* defs.h (bitness_t): New enum type.
	(printtv_bitness, sprinttv): New function prototypes.
	(printtv): Convert to macro wrapper around printtv_bitness().
	(printtv32): Remove.
	* desc.c (decode_select): Use printtv_bitness() and sprinttv().
	(sys_oldselect, sys_osf_select, sys_select, sys_pselect6):
	Update decode_select() use.
	* file.c [ALPHA] (sys_osf_utimes): Use printtv_bitness().
	* time.c (printtv_bitness, sprinttv): New functions.
	(printtv, printtv32): Remove.
	[ALPHA] (sys_osf_settimeofday, sys_osf_settimeofday):
	Use printtv_bitness().
	Fixes RH#171626, RH#173050.
2006-12-13 17:10:11 +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
95ebf5abfc 2006-10-13 Ulrich Drepper <drepper@redhat.com>
Bernhard Kaindl <bk@suse.de>
	    Dmitry V. Levin  <ldv@altlinux.org>
	    Michael Holzheu <holzheu@de.ibm.com>

	Add hooks for new syscalls.  Add decoders for *at, inotify*,
	pselect6, ppoll and unshare syscalls.

	* defs.h: Declare print_sigset.
	* desc.c (sys_pselect6): New function.
	* file.c (decode_open, decode_access, decode_mkdir,
	decode_readlink, decode_chmod, decode_utimes, decode_mknod):
	New functions.
	(sys_open, sys_access, sys_mkdir, sys_readlink, sys_chmod,
	sys_utimes, sys_mknod): Use them.
	[LINUX] (fstatatflags, unlinkatflags, inotify_modes): New
	variables.
	[LINUX] (print_dirfd, sys_openat, sys_faccessat,
	sys_newfstatat, sys_mkdirat, sys_linkat, sys_unlinkat,
	sys_symlinkat, sys_readlinkat, sys_renameat, sys_fchownat,
	sys_fchmodat, sys_futimesat, sys_mknodat, sys_inotify_add_watch,
	sys_inotify_rm_watch): New functions.
	* process.c [LINUX] (sys_unshare): New function.
	* signal.c (print_sigset): New function.
	(sys_sigprocmask): Use it.
	* stream.c (decode_poll): New function.
	(sys_poll): Use it.
	[LINUX] (sys_ppoll): New function.
	* linux/syscall.h: Delcare new syscall handlers.
	* linux/syscallent.h: Hook up new syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	Fixes RH#178633.
2006-10-13 20:25:12 +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
37b9f8480c 2005-05-09 Roland McGrath <roland@redhat.com>
* desc.c (sys_io_setup, sys_io_submit, sys_io_cancel,
	sys_io_getevents, sys_io_destroy): New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Use those for io_* syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	From Zach Brown <zach.brown@oracle.com>.
	Fixes RH#155065.
2005-05-09 08:02:00 +00:00
Roland McGrath
183df961ee 2005-03-22 Roland McGrath <roland@redhat.com>
* desc.c (decode_select): Increase local buffer size.
	Fixes RH#151570.
2005-03-23 03:18:59 +00:00
Roland McGrath
e85aaa459a 2005-02-05 Roland McGrath <roland@redhat.com>
* desc.c (decode_select): Calculate size of passed fd_set vectors and
	copy in the user's size rather than the standard sizeof(fd_set).
	Fixes Debian bug #65654.
2005-02-06 01:55:12 +00:00
Roland McGrath
6e52d23cc6 2004-10-19 Roland McGrath <roland@redhat.com>
* configure.ac: Check for sys/epoll.h.
	* desc.c: Protect #include <sys/epoll.h> with [HAVE_SYS_EPOLL_H].
	(epollctls, epollevents): Protect each entry with #ifdef on its macro.
2004-10-20 02:17:41 +00:00
Roland McGrath
63d6e54c8b 2004-10-19 Roland McGrath <roland@redhat.com>
* configure.ac: Check for sys/epoll.h.
	* desc.c: Protect #include <sys/epoll.h> with [HAVE_SYS_EPOLL_H].
	(epollctls, epollevents): Protect each entry with #ifdef on its macro.
2004-10-20 02:17:41 +00:00
Roland McGrath
93817bfb82 2004-10-06 Roland McGrath <roland@redhat.com>
* desc.c [LINUX] (sys_epoll_create, sys_epoll_ctl, sys_epoll_wait):
	New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Use those for epoll_* syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/sparc/syscallent.h: Likewise.
	* linux/sparc64/syscallent.h: Likewise.
	* linux/sparc64/syscallent2.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	From Ulrich Drepper <drepper@redhat.com>.
	Fixes RH#134463.
2004-10-06 22:23:31 +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
81634e482e 2003-01-13 Roland McGrath <roland@redhat.com>
* desc.c (printflock64): Fix ADDR argument type.
	From Anton Blanchard <anton@samba.org>.
2003-01-14 07:53:31 +00:00
Roland McGrath
e948faf94e 2002-12-15 Roland McGrath <roland@redhat.com>
* desc.c (sys_osf_select): Add missing return type.
2002-12-15 23:58:18 +00:00
Wichert Akkerman
7b3346be42 Import lots of ia64 related changes from David Mosberger 2001-10-09 23:47:38 +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
b8c9f77c6d FreeBSD uses 64 bit off_t, fix stat&fcntl(flock) 2001-03-07 16:53:07 +00:00
John Hughes
bdf48f55f2 Merge Harald Bhme's solaris patches 2001-03-06 15:08:09 +00:00
Wichert Akkerman
5ae21ead9f The `too much stuff, just check the ChangeLog' update 2000-05-01 01:53:59 +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
221f54f721 Now it builds on alpha again... 1999-11-18 17:26:45 +00:00
Wichert Akkerman
f5eeabb156 Start merging linux-ip-routing fork 1999-11-18 17:09:47 +00:00
Wichert Akkerman
76baf7c9f6 Initial revision 1999-02-19 00:21:36 +00:00