Commit Graph

103 Commits

Author SHA1 Message Date
Andreas Schwab
61b7435ca1 Fix decoding of newfstatat syscall on x86-64
* file.c (printstat64) [LINUX && X68_64]: If tracing a 64-bit
process redirect to printstat.
Fixes RH#529316 "Field values shown for "newfstatat" system
call are incorrect"
2009-10-16 11:37:13 +02:00
Mike Frysinger
229738ce4e Avoid malloc(0) in getdents parsers
On end of directory, getdents returns 0.  This return value is used to
then try and do malloc(0), but on some systems this will always return
NULL.  Since the code won't read the pointer in question if len is 0,
then don't bother calling malloc(0) and set the pointer to NULL ourself.
* file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-08 14:08:57 +00:00
Kirill A. Shutemov
896db21e6d Fix fadvise64 decoding on ARM
* file.c (sys_fadvise64_64) [ARM]: Fix argument ordering.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2009-09-19 00:42:51 +00:00
4bcd5ef922 * bjm.c (sys_query_module): Fix format warning reported by
gcc -Wformat-security.
* file.c (tprint_open_modes): Likewise.
* process.c (printargv): Likewise.
* signal.c (printsignal): Likewise.
2009-06-01 10:32:27 +00:00
Denys Vlasenko
4e718b5ea2 * strace.c (printstatsol, printstat_sparc64):
Remove NULL and error check for addr parameter.
(printoldstat, printstat, printoldstat64):
Move NULL and error check for addr parameter
so that it happens before printstatsol/printstat_sparc64 calls.
2009-04-20 18:30:13 +00:00
Denys Vlasenko
e740fd31d2 * file.c (print_dirfd): Use int for file descriptor, not a long.
* process.c (printwaitn): Use int for PID, not a long.
2009-04-16 12:06:16 +00:00
Denys Vlasenko
1d632468c0 * signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto.
* time.c: Ditto.
* process.c: Ditto.
* resource.c: Ditto.
2009-04-14 12:51:00 +00:00
Denys Vlasenko
eedaac768d Decode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
By Mike Frysinger (vapier AT gentoo.org)
* desc.c: Add F_SETLEASE, F_GETLEASE, F_NOTIFY,
F_DUPFD_CLOEXEC to fcntlcmds[]. Create notifyflags[] array.
(sys_fcntl): Handle new flags.

Optimize printing of open modes.
* defs.h: Declare sprint_open_modes(),
remove unused parameter in tprint_open_modes().
* desc.c (sprint_open_modes): Move fuction definition from here...
* file.c (sprint_open_modes): To here.
(tprint_open_modes): Use sprint_open_modes(), it already
generates needed string.
* ipc.c: Remove unused parameter from calls
to tprint_open_modes().
2009-03-10 20:41:58 +00:00
Denys Vlasenko
5ae2b7c601 AVR32 support by Hans-Christian Egtvedt
(hans-christian.egtvedt AT atmel.com).
* configure.ac: Make it recognize avr32.
* defs.h: Define LINUX_AVR32.
* linux/avr32/syscallent.h: New file.
* Makefile.am: Reference linux/avr32/syscallent.h.
* proc.c (change_syscall, setarg): Add support for avr32.
(struct xlat struct_user_offsets[]): Ditto.
* syscall.c (get_scno): Ditto.
(get_error, force_result, syscall_enter): Ditto.
* util.c (getpc, printcall): Ditto.
2009-02-27 20:32:52 +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
c531e571fe 2008-07-31 Roland McGrath <roland@redhat.com>
* file.c [LINUX] (struct kernel_dirent): Define it locally,
	do not use <linux/dirent.h>.
	Fixes RH#457291.
2008-08-01 01:13:10 +00:00
Roland McGrath
96a9661df6 2008-05-19 Roland McGrath <roland@redhat.com>
* file.c (sys_fallocate): New function.
	* linux/syscall.h: Declare it.
	* linux/syscallent.h: Update entry.
	From Kyle McMartin <kyle@mcmartin.ca>.
2008-05-20 04:56:18 +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
153fbd69d2 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c [_LFS64_LARGEFILE] (sys_getdents64): Do the same
	d_reclen check as in sys_getdents: warn if d_reclen is 0 rather
	than looping forever.
	[FREEBSD] (sys_getdirentries): Likewise.
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:49:58 +00:00
b838b1e0b9 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c [LINUXSPARC] (printstatsol): Fix sprinttime()
	invocation.  The sprinttime() function takes a time_t argument,
	but timestruct_t argument was given.
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:47:47 +00:00
dc7715baad 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>
* file.c (sprinttime): Check localtime() return value, to avoid
	potential NULL dereference due to invalid time structures.
	Signed-off-by: Harald van Dijk <truedfx@gentoo.org>
	Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 23:45:09 +00:00
Roland McGrath
e6d0f71e6a 2007-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>
* file.c [!HAVE_STAT64 && LINUX && X86_64] (struct stat64): Define it.
	[!HAVE_STAT64 && LINUX && X86_64] (HAVE_STAT64, STAT64_SIZE): Define.
	[HAVE_STAT64] (printstat64) [STAT64_SIZE]: Add compile-time assertion.
	Fixes RH#222275.
2007-08-07 01:22:49 +00:00
Roland McGrath
c7bd4d321d 2007-08-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* file.c (printstat64): Test [HAVE_LONG_LONG] for st_size printing
	and cast to widest type available.
2007-08-07 01:05:19 +00:00
Roland McGrath
71d3d663ca 2007-08-03 Ulrich Drepper <drepper@redhat.com>
* file.c (open_mode_flags): Add O_CLOEXEC.
	* net.c (msg_flags): Add MSG_CMSG_CLOEXEC.
2007-08-07 01:00: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
Roland McGrath
7e9817c1bf 2007-07-05 Roland McGrath <roland@redhat.com>
* file.c (sys_utime): Use personality_wordsize to handle biarch.
	Fixes RH#247185.
2007-07-05 20:31:58 +00:00
Roland McGrath
359c8ed57c 2007-03-21 Andreas Schwab <schwab@suse.de>
* file.c (sys_newfstatat): Don't use printstat64 on ppc64.
2007-07-05 19:01:17 +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
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
1f336e59aa 2006-10-14 Dmitry V. Levin <ldv@altlinux.org>
* configure.ac(AC_CHECK_HEADERS): Add inttypes.h.
	* file.c [_LFS64_LARGEFILE && (LINUX || SVR4)]:
	Include <inttypes.h>.
	(sys_getdents64): Use PRIu64/PRId64 to avoid gcc warnings on
	64-bit platforms.
2006-10-14 20:20:46 +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
504eb0b9c6 2006-09-01 Dmitry V. Levin <ldv@altlinux.org>
* file.c (print_xattr_val): Fix memory corruption bug reported
	by James Antill.
	Fixes RH#200621.
2006-10-11 22:58:31 +00:00
Roland McGrath
a4d4853f67 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>
Minor namespace cleanup.
	* defs.h (string_quote): Remove declaration.
	* file.c (openmodessol) [LINUXSPARC]: Make static.
	(fileflags): Likewise.
	(aclcmds, aclipc) [HAVE_SYS_ACL_H]: Likewise.
	(direnttypes) [FREEBSD || LINUX]: Likewise.
	(xattrflags): Likewise.
	* process.c (unalignctl_string): Make static.
	(setarg): Disable.
	* syscall.c (subcalls_table): Make static.
	(socket_map) [!(LINUX && (ALPHA || MIPS))]: Likewise.
	(sparc_socket_decode): Make static, define for [SPARC || SPARC64] only.
	(decode_subcall): Make static.
	(syscall_fixup): Likewise.
	(get_error): Likewise.
	(syscall_enter): Likewise.
	* util.c (tv_tv): Disable.
	(getpc): Likewise.
	(string_quote): Make static.
	Fixes RH#159688.
2005-06-08 20:45:28 +00:00
Roland McGrath
0873843a24 2005-06-02 Roland McGrath <roland@redhat.com>
* file.c (printstatfs64): Cast values to unsigned long long and use
	%llu formats.
	Fixes RH#158243.
2005-06-03 02:40:39 +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
1025c3ed7f 2005-04-25 Anton Blanchard <anton@samba.org>
* file.c (openmodes): Add O_NOATIME flag if defined.
2005-05-09 07:40:35 +00:00
Roland McGrath
f774642aa4 2005-03-01 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): Add a cast.
2005-03-01 23:02:32 +00:00
Roland McGrath
663a8a065c 2005-02-04 Roland McGrath <roland@redhat.com>
* file.c (O_LARGEFILE): Omit when #undef'd because it was zero.
2005-02-04 09:49:56 +00:00
Roland McGrath
fee836eb65 2005-02-02 Roland McGrath <roland@redhat.com>
* file.c (openmodes) [O_LARGEFILE] [O_LARGEFILE == 0]: Redefine to
	known values for Linux.
2005-02-02 22:11:32 +00:00
Roland McGrath
883567c1cc 2005-02-01 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): Don't use auto array sized by syscall
	argument.  Use malloc instead, so it can fail for insane values.
	Fixes Debian bug #283704.
2005-02-02 03:38:32 +00:00
Roland McGrath
e27ed3426d 2004-10-19 Roland McGrath <roland@redhat.com>
* file.c (sys_fadvise64): Conditionalize just on [LINUX].
2004-10-20 02:24:19 +00:00
Roland McGrath
8c304bcc00 2004-10-19 Roland McGrath <roland@redhat.com>
* file.c (sys_llseek): Revert last change.
2004-10-19 22:59:55 +00:00
Roland McGrath
2fe2a3e124 2004-10-07 Roland McGrath <roland@redhat.com>
* file.c (sys_llssek, sys_readahead, sys_fadvise64, sys_fadvise64_64):
	Use LONG_LONG macro.
	* io.c (sys_pread, sys_pwrite, sys_sendfile): Likewise.
2004-10-07 19:09:16 +00:00
Roland McGrath
df13e8f4ca 2004-10-07 Roland McGrath <roland@redhat.com>
* file.c [LINUX && (I386 || X86_64)] (sys_fadvise64, sys_fadvise64_64):
	New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Handle fadvise64 and fadvise64_64 using those.
	From Ulrich Drepper <drepper@redhat.com>.
2004-10-07 18:51:19 +00:00
Roland McGrath
f9c49b24dc 2004-10-06 Roland McGrath <roland@redhat.com>
* file.c (sprintmode): Add const to return type.
	(sprintfstype): Likewise.
	* signal.c (printsiginfo): Add a const.
2004-10-06 22:11:54 +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
3292e229b9 2004-08-30 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): New function to show attribute values.
	(sys_setxattr, sys_fsetxattr, sys_getxattr, sys_fgetxattr): Use it.
	From Ulrich Drepper <drepper@redhat.com>.
	Fixes RH#131177.
2004-08-31 06:30:48 +00:00
Roland McGrath
6d1a65c759 2004-07-07 David S. Miller <davem@nuts.davemloft.net>
* linux/sparc/syscallent.h: Sync with reality.
	* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
	sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
	sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
	sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
	sys_removexattr, sys_lremovexattr, sys_fremovexattr,
	sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
	sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
	sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
	sys_timer_settime, sys_timer_gettime): New declarations.
	* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
	linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
	linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
	linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
	linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent.h, linux/sparc64/signalent.h,
	linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
	linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
	linux/sparc64/syscallent1.h: New files.
	* defs.h (LINUXSPARC): Define also when SPARC64.
	(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
	Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
	Define possibly missing __NR_exit_group.  Declare getrval2.
	* configure.ac (sparc64): New architecture case.
	* config.h.in (SPARC64): New define.
	* file.c (stat_sparc64): New structure.
	(printstat_sparc64): New output routine for that.
	(printstat): Call it, if personality is 2.
	(printstat64): Likewise.
	* util.c: Conditionalize ptrace defines on LINUXSPARC
	not LINUX && SPARC.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(_hack_syscall5): Correct trap number when SPARC64.
	(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
	(getpc): Handle SPARC64 && LINUX.
	(printcall): Likewise.
	(arg fetching/setting): Use same code for SPARC64 LINUX
	as for SPARC.
	(setbpt): Handle SPARC64 && LINUX.
	(clearbpt): Likewise.
	* signal.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(m_siginfo): Use same definition on SPARC64 as SPARC.
	(sys_sigreturn): Handle LINUX && SPARC64.
	* syscall.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(getscno): Use same static state on SPARC64 as SPARC,
	and add SPARC64 handling.
	(get_error): Handle LINUX && SPARC64.
	(force_result): Likewise.
	(syscall_enter): Likewise.
	(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
	just like SPARC.
	(getrval2): Handle LINUX && SPARC64.
	* process.c: Conditionalize ptrace defines on SPARC and
	SPARC64.
	(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
	to PTRACE_FOOREGS64 so that more sparc code can be shared
	between 64-bit and 32-bit.
	(change_syscall): Handle LINUX && SPARC64.
	(struct_user_offsets): Ifdef out those which do not exist
	on SPARC64.
	* net.c (sys_pipe): Handle LINUX && SPARC64.
	* ioctl.c: Fix initializer typo for nioctlents2, was
	nioctlents1 by accident.
2004-07-12 07:44:08 +00:00
Roland McGrath
9205324e8b 2003-12-14 Anton Blanchard <anton@samba.org>
* file.c (sys_getdents64): Don't cast d_ino and d_off to unsigned long.
	Use %llu formats for them.
2004-01-13 10:16:47 +00:00
Roland McGrath
c767ad8e1a 2003-12-14 Anton Blanchard <anton@samba.org>
* file.c [LINUX] (fsmagic): Add SYSFS_MAGIC.
2004-01-13 10:13:45 +00:00
Roland McGrath
4054284e29 2004-01-13 Roland McGrath <roland@redhat.com>
* file.c (direnttypes): Define under [LINUX] as well.  Add DT_UNKNOWN.
	(sys_getdents64) [LINUX]: Print d_type field.
2004-01-13 09:47:49 +00:00
Roland McGrath
6bc1220fe3 2003-09-06 Dmitry V. Levin <ldv@altlinux.org>
* util.c (printuid): New function.
	* defs.h: Declare it.
	* file.c (sys_chown): Use it.
	* file.c (sys_fchown): Likewise.
	* process.c (sys_setreuid, sys_setregid, sys_setresuid,
	sys_setresgid): Likewise.
2003-11-13 22:32:27 +00:00