1999-02-19 00:21:36 +00:00
/*
* Copyright ( c ) 1991 , 1992 Paul Kranenburg < pk @ cs . few . eur . nl >
* Copyright ( c ) 1993 Branko Lankester < branko @ hacktic . nl >
* Copyright ( c ) 1993 , 1994 , 1995 , 1996 Rick Sladkey < jrs @ world . std . com >
1999-12-23 14:20:14 +00:00
* Copyright ( c ) 1996 - 1999 Wichert Akkerman < wichert @ cistron . nl >
1999-02-19 00:21:36 +00:00
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions
* are met :
* 1. Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
* 2. Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the distribution .
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission .
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS ' ' AND ANY EXPRESS OR
* IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED .
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT , INDIRECT ,
* INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT
* NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE ,
* DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
*
* $ Id $
*/
# include "defs.h"
# include <dirent.h>
2008-08-01 01:13:10 +00:00
2002-09-23 13:30:09 +00:00
# ifdef LINUX
2008-08-01 01:13:10 +00:00
struct kernel_dirent {
unsigned long d_ino ;
unsigned long d_off ;
unsigned short d_reclen ;
char d_name [ 1 ] ;
} ;
1999-05-25 23:11:18 +00:00
# else
2008-08-01 01:13:10 +00:00
# define kernel_dirent dirent
1999-05-25 23:11:18 +00:00
# endif
1999-02-19 00:21:36 +00:00
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-06-03 14:21:07 +00:00
# ifdef LINUXSPARC
struct stat {
unsigned short st_dev ;
unsigned int st_ino ;
unsigned short st_mode ;
short st_nlink ;
unsigned short st_uid ;
unsigned short st_gid ;
unsigned short st_rdev ;
unsigned int st_size ;
int st_atime ;
unsigned int __unused1 ;
int st_mtime ;
unsigned int __unused2 ;
int st_ctime ;
unsigned int __unused3 ;
int st_blksize ;
int st_blocks ;
unsigned int __unused4 [ 2 ] ;
} ;
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
# if defined(SPARC64)
struct stat_sparc64 {
unsigned int st_dev ;
unsigned long st_ino ;
unsigned int st_mode ;
unsigned int st_nlink ;
unsigned int st_uid ;
unsigned int st_gid ;
unsigned int st_rdev ;
long st_size ;
long st_atime ;
long st_mtime ;
long st_ctime ;
long st_blksize ;
long st_blocks ;
unsigned long __unused4 [ 2 ] ;
} ;
# endif /* SPARC64 */
1999-06-03 14:21:07 +00:00
# define stat kernel_stat
# include <asm / stat.h>
# undef stat
# else
1999-07-09 00:32:54 +00:00
# undef dev_t
# undef ino_t
# undef mode_t
# undef nlink_t
# undef uid_t
# undef gid_t
# undef off_t
# undef loff_t
1999-07-08 14:00:58 +00:00
# define dev_t __kernel_dev_t
# define ino_t __kernel_ino_t
# define mode_t __kernel_mode_t
# define nlink_t __kernel_nlink_t
# define uid_t __kernel_uid_t
# define gid_t __kernel_gid_t
# define off_t __kernel_off_t
# define loff_t __kernel_loff_t
1999-06-03 14:21:07 +00:00
# include <asm / stat.h>
1999-07-08 14:00:58 +00:00
# undef dev_t
# undef ino_t
# undef mode_t
# undef nlink_t
# undef uid_t
# undef gid_t
# undef off_t
# undef loff_t
1999-07-09 00:32:54 +00:00
# define dev_t dev_t
# define ino_t ino_t
# define mode_t mode_t
# define nlink_t nlink_t
# define uid_t uid_t
# define gid_t gid_t
# define off_t off_t
# define loff_t loff_t
1999-06-03 14:21:07 +00:00
# endif
2001-03-27 12:17:16 +00:00
# ifdef HPPA /* asm-parisc/stat.h defines stat64 */
# undef stat64
# endif
1999-04-18 23:30:29 +00:00
# define stat libc_stat
1999-12-24 07:18:28 +00:00
# define stat64 libc_stat64
1999-04-18 23:30:29 +00:00
# include <sys / stat.h>
# undef stat
1999-12-24 07:18:28 +00:00
# undef stat64
2003-01-09 06:53:22 +00:00
/* These might be macros. */
# undef st_atime
# undef st_mtime
# undef st_ctime
2001-03-27 12:17:16 +00:00
# ifdef HPPA
# define stat64 hpux_stat64
# endif
1999-04-18 23:30:29 +00:00
# else
# include <sys / stat.h>
1999-04-16 00:21:26 +00:00
# endif
1999-04-18 23:30:29 +00:00
1999-02-19 00:21:36 +00:00
# include <fcntl.h>
# ifdef SVR4
# include <sys / cred.h>
# endif /* SVR4 */
2000-09-01 21:03:06 +00:00
# ifdef HAVE_SYS_VFS_H
1999-02-19 00:21:36 +00:00
# include <sys/vfs.h>
2000-09-01 21:03:06 +00:00
# endif
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# ifdef HAVE_LINUX_XATTR_H
# include <linux/xattr.h>
# elif defined linux
# define XATTR_CREATE 1
# define XATTR_REPLACE 2
# endif
2000-09-01 21:03:06 +00:00
# ifdef FREEBSD
# include <sys/param.h>
# include <sys/mount.h>
# include <sys/stat.h>
2001-03-08 13:59:00 +00:00
# endif
2006-10-14 20:20:46 +00:00
# if _LFS64_LARGEFILE && (defined(LINUX) || defined(SVR4))
# ifdef HAVE_INTTYPES_H
# include <inttypes.h>
# else
# define PRId64 "lld"
# define PRIu64 "llu"
# endif
# endif
2001-03-08 13:59:00 +00:00
# if HAVE_LONG_LONG_OFF_T
/*
* Ugly hacks for systems that have typedef long long off_t
*/
2001-03-07 16:53:07 +00:00
# define stat64 stat
# define HAVE_STAT64 1 /* Ugly hack */
2001-03-08 13:59:00 +00:00
# define sys_stat64 sys_stat
# define sys_fstat64 sys_fstat
# define sys_lstat64 sys_lstat
# define sys_lseek64 sys_lseek
# define sys_truncate64 sys_truncate
# define sys_ftruncate64 sys_ftruncate
2000-09-01 21:03:06 +00:00
# endif
1999-02-19 00:21:36 +00:00
# ifdef MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
# endif
# ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
# endif
# ifdef HAVE_SYS_ASYNCH_H
# include <sys/asynch.h>
# endif
# ifdef SUNOS4
# include <ustat.h>
# endif
2007-01-11 23:19:55 +00:00
const struct xlat open_access_modes [ ] = {
{ O_RDONLY , " O_RDONLY " } ,
{ O_WRONLY , " O_WRONLY " } ,
{ O_RDWR , " O_RDWR " } ,
# ifdef O_ACCMODE
{ O_ACCMODE , " O_ACCMODE " } ,
# endif
{ 0 , NULL } ,
} ;
const struct xlat open_mode_flags [ ] = {
1999-02-19 00:21:36 +00:00
{ O_CREAT , " O_CREAT " } ,
{ O_EXCL , " O_EXCL " } ,
{ O_NOCTTY , " O_NOCTTY " } ,
2007-01-11 23:19:55 +00:00
{ O_TRUNC , " O_TRUNC " } ,
{ O_APPEND , " O_APPEND " } ,
{ O_NONBLOCK , " O_NONBLOCK " } ,
1999-02-19 00:21:36 +00:00
# ifdef O_SYNC
{ O_SYNC , " O_SYNC " } ,
# endif
# ifdef O_ASYNC
{ O_ASYNC , " O_ASYNC " } ,
# endif
# ifdef O_DSYNC
{ O_DSYNC , " O_DSYNC " } ,
# endif
# ifdef O_RSYNC
{ O_RSYNC , " O_RSYNC " } ,
# endif
2009-03-10 20:41:58 +00:00
# if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK)
1999-02-19 00:21:36 +00:00
{ O_NDELAY , " O_NDELAY " } ,
# endif
# ifdef O_PRIV
{ O_PRIV , " O_PRIV " } ,
# endif
# ifdef O_DIRECT
2000-05-01 01:53:59 +00:00
{ O_DIRECT , " O_DIRECT " } ,
1999-02-19 00:21:36 +00:00
# endif
# ifdef O_LARGEFILE
2005-02-02 22:11:32 +00:00
# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */
# undef O_LARGEFILE
# ifdef SPARC64
# define O_LARGEFILE 0x40000
# elif defined X86_64 || defined S390X
# define O_LARGEFILE 0100000
# endif
# endif
2005-02-04 09:49:56 +00:00
# ifdef O_LARGEFILE
2011-06-07 12:13:24 +02:00
{ O_LARGEFILE , " O_LARGEFILE " } ,
2005-02-04 09:49:56 +00:00
# endif
1999-02-19 00:21:36 +00:00
# endif
# ifdef O_DIRECTORY
2011-06-07 12:13:24 +02:00
{ O_DIRECTORY , " O_DIRECTORY " } ,
2000-05-01 01:53:59 +00:00
# endif
# ifdef O_NOFOLLOW
2011-06-07 12:13:24 +02:00
{ O_NOFOLLOW , " O_NOFOLLOW " } ,
1999-02-19 00:21:36 +00:00
# endif
2005-05-09 07:40:35 +00:00
# ifdef O_NOATIME
2011-06-07 12:13:24 +02:00
{ O_NOATIME , " O_NOATIME " } ,
2005-05-09 07:40:35 +00:00
# endif
2007-08-07 01:00:26 +00:00
# ifdef O_CLOEXEC
{ O_CLOEXEC , " O_CLOEXEC " } ,
# endif
1999-02-19 00:21:36 +00:00
# ifdef FNDELAY
{ FNDELAY , " FNDELAY " } ,
# endif
# ifdef FAPPEND
{ FAPPEND , " FAPPEND " } ,
# endif
# ifdef FMARK
{ FMARK , " FMARK " } ,
# endif
# ifdef FDEFER
{ FDEFER , " FDEFER " } ,
# endif
# ifdef FASYNC
{ FASYNC , " FASYNC " } ,
# endif
# ifdef FSHLOCK
{ FSHLOCK , " FSHLOCK " } ,
# endif
# ifdef FEXLOCK
{ FEXLOCK , " FEXLOCK " } ,
# endif
# ifdef FCREAT
{ FCREAT , " FCREAT " } ,
# endif
# ifdef FTRUNC
{ FTRUNC , " FTRUNC " } ,
# endif
# ifdef FEXCL
{ FEXCL , " FEXCL " } ,
# endif
# ifdef FNBIO
{ FNBIO , " FNBIO " } ,
# endif
# ifdef FSYNC
{ FSYNC , " FSYNC " } ,
# endif
# ifdef FNOCTTY
{ FNOCTTY , " FNOCTTY " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
2000-09-01 21:03:06 +00:00
# ifdef O_SHLOCK
{ O_SHLOCK , " O_SHLOCK " } ,
# endif
# ifdef O_EXLOCK
{ O_EXLOCK , " O_EXLOCK " } ,
1999-02-19 00:21:36 +00:00
# endif
{ 0 , NULL } ,
} ;
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
# ifdef LINUX
# ifndef AT_FDCWD
# define AT_FDCWD -100
# endif
2009-04-16 12:06:16 +00:00
/* The fd is an "int", so when decoding x86 on x86_64, we need to force sign
* extension to get the right value . We do this by declaring fd as int here .
*/
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
static void
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( struct tcb * tcp , int fd )
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
{
if ( fd = = AT_FDCWD )
2011-09-01 10:00:28 +02:00
tprints ( " AT_FDCWD, " ) ;
2011-06-22 14:32:43 +02:00
else {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , fd ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
}
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
}
# endif
2007-01-11 23:19:55 +00:00
/*
* low bits of the open ( 2 ) flags define access mode ,
* other bits are real flags .
*/
2009-03-10 20:41:58 +00:00
const char *
sprint_open_modes ( mode_t flags )
2007-01-11 23:19:55 +00:00
{
2012-01-29 22:38:35 +01:00
static char outstr [ ( 1 + ARRAY_SIZE ( open_mode_flags ) ) * sizeof ( " O_LARGEFILE " ) ] ;
2009-03-10 20:41:58 +00:00
char * p ;
2012-01-29 22:38:35 +01:00
char sep ;
2009-03-10 20:41:58 +00:00
const char * str ;
const struct xlat * x ;
2012-01-29 22:38:35 +01:00
sep = ' ' ;
p = stpcpy ( outstr , " flags " ) ;
2009-03-10 20:41:58 +00:00
str = xlookup ( open_access_modes , flags & 3 ) ;
if ( str ) {
2012-01-29 22:38:35 +01:00
* p + + = sep ;
2011-08-31 12:07:38 +02:00
p = stpcpy ( p , str ) ;
2007-01-11 23:19:55 +00:00
flags & = ~ 3 ;
if ( ! flags )
2009-03-10 20:41:58 +00:00
return outstr ;
sep = ' | ' ;
2007-01-11 23:19:55 +00:00
}
2009-03-10 20:41:58 +00:00
for ( x = open_mode_flags ; x - > str ; x + + ) {
if ( ( flags & x - > val ) = = x - > val ) {
2012-01-29 22:38:35 +01:00
* p + + = sep ;
2011-08-31 12:07:38 +02:00
p = stpcpy ( p , x - > str ) ;
2009-03-10 20:41:58 +00:00
flags & = ~ x - > val ;
if ( ! flags )
return outstr ;
sep = ' | ' ;
}
}
/* flags is still nonzero */
2012-01-29 22:38:35 +01:00
* p + + = sep ;
2009-03-10 20:41:58 +00:00
sprintf ( p , " %#x " , flags ) ;
return outstr ;
}
void
tprint_open_modes ( mode_t flags )
{
2011-09-01 09:55:05 +02:00
tprints ( sprint_open_modes ( flags ) + sizeof ( " flags " ) ) ;
2007-01-11 23:19:55 +00:00
}
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
static int
decode_open ( struct tcb * tcp , int offset )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
/* flags */
2009-03-10 20:41:58 +00:00
tprint_open_modes ( tcp - > u_arg [ offset + 1 ] ) ;
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
if ( tcp - > u_arg [ offset + 1 ] & O_CREAT ) {
1999-02-19 00:21:36 +00:00
/* mode */
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
tprintf ( " , %#lo " , tcp - > u_arg [ offset + 2 ] ) ;
1999-02-19 00:21:36 +00:00
}
}
return 0 ;
}
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
int
sys_open ( struct tcb * tcp )
{
return decode_open ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_openat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_open ( tcp , 1 ) ;
}
# endif
1999-02-19 00:21:36 +00:00
# ifdef LINUXSPARC
2005-06-08 20:45:28 +00:00
static const struct xlat openmodessol [ ] = {
1999-02-19 00:21:36 +00:00
{ 0 , " O_RDWR " } ,
{ 1 , " O_RDONLY " } ,
{ 2 , " O_WRONLY " } ,
{ 0x80 , " O_NONBLOCK " } ,
{ 8 , " O_APPEND " } ,
{ 0x100 , " O_CREAT " } ,
{ 0x200 , " O_TRUNC " } ,
{ 0x400 , " O_EXCL " } ,
{ 0x800 , " O_NOCTTY " } ,
{ 0x10 , " O_SYNC " } ,
{ 0x40 , " O_DSYNC " } ,
{ 0x8000 , " O_RSYNC " } ,
{ 4 , " O_NDELAY " } ,
{ 0x1000 , " O_PRIV " } ,
{ 0 , NULL } ,
} ;
int
2009-04-14 12:51:00 +00:00
solaris_open ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
/* flags */
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
printflags ( openmodessol , tcp - > u_arg [ 1 ] + 1 , " O_??? " ) ;
1999-02-19 00:21:36 +00:00
if ( tcp - > u_arg [ 1 ] & 0x100 ) {
/* mode */
tprintf ( " , %#lo " , tcp - > u_arg [ 2 ] ) ;
}
}
return 0 ;
}
# endif
int
2009-04-14 12:51:00 +00:00
sys_creat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %#lo " , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2004-09-04 03:39:20 +00:00
static const struct xlat access_flags [ ] = {
1999-02-19 00:21:36 +00:00
{ F_OK , " F_OK " , } ,
{ R_OK , " R_OK " } ,
{ W_OK , " W_OK " } ,
{ X_OK , " X_OK " } ,
# ifdef EFF_ONLY_OK
{ EFF_ONLY_OK , " EFF_ONLY_OK " } ,
# endif
# ifdef EX_OK
{ EX_OK , " EX_OK " } ,
# endif
{ 0 , NULL } ,
} ;
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
static int
decode_access ( struct tcb * tcp , int offset )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( access_flags , tcp - > u_arg [ offset + 1 ] , " ?_OK " ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
int
sys_access ( struct tcb * tcp )
{
return decode_access ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_faccessat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_access ( tcp , 1 ) ;
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_umask ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %#lo " , tcp - > u_arg [ 0 ] ) ;
}
return RVAL_OCTAL ;
}
2004-09-04 03:39:20 +00:00
static const struct xlat whence [ ] = {
1999-02-19 00:21:36 +00:00
{ SEEK_SET , " SEEK_SET " } ,
{ SEEK_CUR , " SEEK_CUR " } ,
{ SEEK_END , " SEEK_END " } ,
{ 0 , NULL } ,
} ;
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
2008-05-20 01:11:56 +00:00
# if defined (LINUX_MIPSN32)
int
2009-04-14 12:51:00 +00:00
sys_lseek ( struct tcb * tcp )
2008-05-20 01:11:56 +00:00
{
long long offset ;
int _whence ;
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2008-05-20 01:11:56 +00:00
offset = tcp - > ext_arg [ 1 ] ;
_whence = tcp - > u_arg [ 2 ] ;
if ( _whence = = SEEK_SET )
tprintf ( " %llu, " , offset ) ;
else
tprintf ( " %lld, " , offset ) ;
printxval ( whence , _whence , " SEEK_??? " ) ;
}
return RVAL_UDECIMAL ;
}
# else /* !LINUX_MIPSN32 */
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_lseek ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
2000-09-01 21:03:06 +00:00
off_t offset ;
int _whence ;
1999-02-19 00:21:36 +00:00
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2000-09-01 21:03:06 +00:00
offset = tcp - > u_arg [ 1 ] ;
_whence = tcp - > u_arg [ 2 ] ;
if ( _whence = = SEEK_SET )
tprintf ( " %lu, " , offset ) ;
1999-02-19 00:21:36 +00:00
else
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
tprintf ( " %ld, " , offset ) ;
2000-09-01 21:03:06 +00:00
printxval ( whence , _whence , " SEEK_??? " ) ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
1999-02-19 00:21:36 +00:00
return RVAL_UDECIMAL ;
}
2008-05-20 01:11:56 +00:00
# endif /* LINUX_MIPSN32 */
2001-03-07 13:21:24 +00:00
# endif
1999-02-19 00:21:36 +00:00
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_llseek ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2009-04-14 12:51:00 +00:00
/*
* This one call takes explicitly two 32 - bit arguments hi , lo ,
* rather than one 64 - bit argument for which LONG_LONG works
* appropriate for the native byte order .
*/
if ( tcp - > u_arg [ 4 ] = = SEEK_SET )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
tprintf ( " , %llu, " ,
( ( long long int ) tcp - > u_arg [ 1 ] ) < < 32 |
( unsigned long long ) ( unsigned ) tcp - > u_arg [ 2 ] ) ;
2009-04-14 12:51:00 +00:00
else
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
tprintf ( " , %lld, " ,
( ( long long int ) tcp - > u_arg [ 1 ] ) < < 32 |
( unsigned long long ) ( unsigned ) tcp - > u_arg [ 2 ] ) ;
2009-04-14 12:51:00 +00:00
}
else {
long long int off ;
if ( syserror ( tcp ) | | umove ( tcp , tcp - > u_arg [ 3 ] , & off ) < 0 )
tprintf ( " %#lx, " , tcp - > u_arg [ 3 ] ) ;
else
tprintf ( " [%llu], " , off ) ;
printxval ( whence , tcp - > u_arg [ 4 ] , " SEEK_??? " ) ;
}
return 0 ;
1999-02-19 00:21:36 +00:00
}
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
int
2009-04-14 12:51:00 +00:00
sys_readahead ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
2009-11-04 17:08:34 +01:00
int argn ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-11-04 17:08:34 +01:00
argn = printllval ( tcp , " %lld " , 1 ) ;
tprintf ( " , %ld " , tcp - > u_arg [ argn ] ) ;
2009-04-14 12:51:00 +00:00
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
1999-02-19 00:21:36 +00:00
# endif
2001-03-08 13:59:00 +00:00
# if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
2001-03-06 15:08:09 +00:00
int
2009-04-14 12:51:00 +00:00
sys_lseek64 ( struct tcb * tcp )
2001-03-06 15:08:09 +00:00
{
if ( entering ( tcp ) ) {
2009-11-04 17:08:34 +01:00
int argn ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2001-03-06 15:08:09 +00:00
if ( tcp - > u_arg [ 3 ] = = SEEK_SET )
2009-11-04 17:08:34 +01:00
argn = printllval ( tcp , " %llu, " , 1 ) ;
2001-03-06 15:08:09 +00:00
else
2009-11-04 17:08:34 +01:00
argn = printllval ( tcp , " %lld, " , 1 ) ;
printxval ( whence , tcp - > u_arg [ argn ] , " SEEK_??? " ) ;
2001-03-06 15:08:09 +00:00
}
return RVAL_LUDECIMAL ;
}
# endif
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_truncate ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2001-03-07 13:21:24 +00:00
# endif
1999-02-19 00:21:36 +00:00
2001-03-08 13:59:00 +00:00
# if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
2001-03-06 16:50:41 +00:00
int
2009-04-14 12:51:00 +00:00
sys_truncate64 ( struct tcb * tcp )
2001-03-06 16:50:41 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2009-11-04 17:08:34 +01:00
printllval ( tcp , " , %llu " , 1 ) ;
2001-03-06 16:50:41 +00:00
}
return 0 ;
}
# endif
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_ftruncate ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 1 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
2001-03-07 13:21:24 +00:00
# endif
1999-02-19 00:21:36 +00:00
2001-03-08 13:59:00 +00:00
# if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
2001-03-06 16:50:41 +00:00
int
2009-04-14 12:51:00 +00:00
sys_ftruncate64 ( struct tcb * tcp )
2001-03-06 16:50:41 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-11-04 17:08:34 +01:00
printllval ( tcp , " %llu " , 1 ) ;
2001-03-06 16:50:41 +00:00
}
return 0 ;
}
# endif
1999-02-19 00:21:36 +00:00
/* several stats */
2004-09-04 03:39:20 +00:00
static const struct xlat modetypes [ ] = {
1999-02-19 00:21:36 +00:00
{ S_IFREG , " S_IFREG " } ,
{ S_IFSOCK , " S_IFSOCK " } ,
{ S_IFIFO , " S_IFIFO " } ,
{ S_IFLNK , " S_IFLNK " } ,
{ S_IFDIR , " S_IFDIR " } ,
{ S_IFBLK , " S_IFBLK " } ,
{ S_IFCHR , " S_IFCHR " } ,
{ 0 , NULL } ,
} ;
2004-10-06 22:11:54 +00:00
static const char *
2009-04-14 12:51:00 +00:00
sprintmode ( int mode )
1999-02-19 00:21:36 +00:00
{
static char buf [ 64 ] ;
2004-10-06 22:11:54 +00:00
const char * s ;
1999-02-19 00:21:36 +00:00
if ( ( mode & S_IFMT ) = = 0 )
s = " " ;
else if ( ( s = xlookup ( modetypes , mode & S_IFMT ) ) = = NULL ) {
sprintf ( buf , " %#o " , mode ) ;
return buf ;
}
sprintf ( buf , " %s%s%s%s " , s ,
( mode & S_ISUID ) ? " |S_ISUID " : " " ,
( mode & S_ISGID ) ? " |S_ISGID " : " " ,
( mode & S_ISVTX ) ? " |S_ISVTX " : " " ) ;
mode & = ~ ( S_IFMT | S_ISUID | S_ISGID | S_ISVTX ) ;
if ( mode )
sprintf ( buf + strlen ( buf ) , " |%#o " , mode ) ;
s = ( * buf = = ' | ' ) ? buf + 1 : buf ;
return * s ? s : " 0 " ;
}
static char *
2008-04-19 23:45:09 +00:00
sprinttime ( time_t t )
1999-02-19 00:21:36 +00:00
{
struct tm * tmp ;
static char buf [ 32 ] ;
if ( t = = 0 ) {
2008-04-19 23:45:09 +00:00
strcpy ( buf , " 0 " ) ;
1999-02-19 00:21:36 +00:00
return buf ;
}
2011-08-20 12:48:18 +02:00
tmp = localtime ( & t ) ;
if ( tmp )
2008-04-19 23:45:09 +00:00
snprintf ( buf , sizeof buf , " %02d/%02d/%02d-%02d:%02d:%02d " ,
tmp - > tm_year + 1900 , tmp - > tm_mon + 1 , tmp - > tm_mday ,
tmp - > tm_hour , tmp - > tm_min , tmp - > tm_sec ) ;
else
snprintf ( buf , sizeof buf , " %lu " , ( unsigned long ) t ) ;
1999-02-19 00:21:36 +00:00
return buf ;
}
# ifdef LINUXSPARC
typedef struct {
2008-12-30 18:47:55 +00:00
int tv_sec ;
int tv_nsec ;
1999-02-19 00:21:36 +00:00
} timestruct_t ;
struct solstat {
2008-12-30 18:47:55 +00:00
unsigned st_dev ;
int st_pad1 [ 3 ] ; /* network id */
unsigned st_ino ;
unsigned st_mode ;
unsigned st_nlink ;
unsigned st_uid ;
unsigned st_gid ;
unsigned st_rdev ;
int st_pad2 [ 2 ] ;
int st_size ;
int st_pad3 ; /* st_size, off_t expansion */
timestruct_t st_atime ;
timestruct_t st_mtime ;
timestruct_t st_ctime ;
int st_blksize ;
int st_blocks ;
char st_fstype [ 16 ] ;
int st_pad4 [ 8 ] ; /* expansion area */
1999-02-19 00:21:36 +00:00
} ;
static void
2008-04-19 23:47:47 +00:00
printstatsol ( struct tcb * tcp , long addr )
1999-02-19 00:21:36 +00:00
{
struct solstat statbuf ;
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-02-19 00:21:36 +00:00
return ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " {st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, " ,
( unsigned long ) ( ( statbuf . st_dev > > 18 ) & 0x3fff ) ,
( unsigned long ) ( statbuf . st_dev & 0x3ffff ) ,
( unsigned long ) statbuf . st_ino ,
sprintmode ( statbuf . st_mode ) ) ;
tprintf ( " st_nlink=%lu, st_uid=%lu, st_gid=%lu, " ,
( unsigned long ) statbuf . st_nlink ,
( unsigned long ) statbuf . st_uid ,
( unsigned long ) statbuf . st_gid ) ;
tprintf ( " st_blksize=%lu, " , ( unsigned long ) statbuf . st_blksize ) ;
tprintf ( " st_blocks=%lu, " , ( unsigned long ) statbuf . st_blocks ) ;
}
else
tprintf ( " {st_mode=%s, " , sprintmode ( statbuf . st_mode ) ) ;
switch ( statbuf . st_mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
tprintf ( " st_rdev=makedev(%lu, %lu), " ,
( unsigned long ) ( ( statbuf . st_rdev > > 18 ) & 0x3fff ) ,
( unsigned long ) ( statbuf . st_rdev & 0x3ffff ) ) ;
break ;
default :
tprintf ( " st_size=%u, " , statbuf . st_size ) ;
break ;
}
if ( ! abbrev ( tcp ) ) {
2008-04-19 23:47:47 +00:00
tprintf ( " st_atime=%s, " , sprinttime ( statbuf . st_atime . tv_sec ) ) ;
tprintf ( " st_mtime=%s, " , sprinttime ( statbuf . st_mtime . tv_sec ) ) ;
tprintf ( " st_ctime=%s} " , sprinttime ( statbuf . st_ctime . tv_sec ) ) ;
1999-02-19 00:21:36 +00:00
}
else
2011-09-01 10:00:28 +02:00
tprints ( " ...} " ) ;
1999-02-19 00:21:36 +00:00
}
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
# if defined (SPARC64)
static void
2009-04-14 12:51:00 +00:00
printstat_sparc64 ( struct tcb * tcp , long addr )
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
{
struct stat_sparc64 statbuf ;
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
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
return ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " {st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, " ,
( unsigned long ) major ( statbuf . st_dev ) ,
( unsigned long ) minor ( statbuf . st_dev ) ,
( unsigned long ) statbuf . st_ino ,
sprintmode ( statbuf . st_mode ) ) ;
tprintf ( " st_nlink=%lu, st_uid=%lu, st_gid=%lu, " ,
( unsigned long ) statbuf . st_nlink ,
( unsigned long ) statbuf . st_uid ,
( unsigned long ) statbuf . st_gid ) ;
tprintf ( " st_blksize=%lu, " ,
( unsigned long ) statbuf . st_blksize ) ;
tprintf ( " st_blocks=%lu, " ,
( unsigned long ) statbuf . st_blocks ) ;
}
else
tprintf ( " {st_mode=%s, " , sprintmode ( statbuf . st_mode ) ) ;
switch ( statbuf . st_mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
tprintf ( " st_rdev=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf . st_rdev ) ,
( unsigned long ) minor ( statbuf . st_rdev ) ) ;
break ;
default :
tprintf ( " st_size=%lu, " , statbuf . st_size ) ;
break ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " st_atime=%s, " , sprinttime ( statbuf . st_atime ) ) ;
tprintf ( " st_mtime=%s, " , sprinttime ( statbuf . st_mtime ) ) ;
tprintf ( " st_ctime=%s " , sprinttime ( statbuf . st_ctime ) ) ;
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
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
}
else
2011-09-01 10:00:28 +02:00
tprints ( " ...} " ) ;
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
}
# endif /* SPARC64 */
1999-04-18 22:50:50 +00:00
# endif /* LINUXSPARC */
1999-02-19 00:21:36 +00:00
2010-07-12 21:39:57 +02:00
# if defined LINUX && defined POWERPC64
struct stat_powerpc32 {
unsigned int st_dev ;
unsigned int st_ino ;
unsigned int st_mode ;
unsigned short st_nlink ;
unsigned int st_uid ;
unsigned int st_gid ;
unsigned int st_rdev ;
unsigned int st_size ;
unsigned int st_blksize ;
unsigned int st_blocks ;
unsigned int st_atime ;
unsigned int st_atime_nsec ;
unsigned int st_mtime ;
unsigned int st_mtime_nsec ;
unsigned int st_ctime ;
unsigned int st_ctime_nsec ;
unsigned int __unused4 ;
unsigned int __unused5 ;
} ;
static void
printstat_powerpc32 ( struct tcb * tcp , long addr )
{
struct stat_powerpc32 statbuf ;
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
2010-07-12 21:39:57 +02:00
return ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " {st_dev=makedev(%u, %u), st_ino=%u, st_mode=%s, " ,
major ( statbuf . st_dev ) , minor ( statbuf . st_dev ) ,
statbuf . st_ino ,
sprintmode ( statbuf . st_mode ) ) ;
tprintf ( " st_nlink=%u, st_uid=%u, st_gid=%u, " ,
statbuf . st_nlink , statbuf . st_uid , statbuf . st_gid ) ;
tprintf ( " st_blksize=%u, " , statbuf . st_blksize ) ;
tprintf ( " st_blocks=%u, " , statbuf . st_blocks ) ;
}
else
tprintf ( " {st_mode=%s, " , sprintmode ( statbuf . st_mode ) ) ;
switch ( statbuf . st_mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
tprintf ( " st_rdev=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf . st_rdev ) ,
( unsigned long ) minor ( statbuf . st_rdev ) ) ;
break ;
default :
tprintf ( " st_size=%u, " , statbuf . st_size ) ;
break ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " st_atime=%s, " , sprinttime ( statbuf . st_atime ) ) ;
tprintf ( " st_mtime=%s, " , sprinttime ( statbuf . st_mtime ) ) ;
tprintf ( " st_ctime=%s " , sprinttime ( statbuf . st_ctime ) ) ;
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2010-07-12 21:39:57 +02:00
}
else
2011-09-01 10:00:28 +02:00
tprints ( " ...} " ) ;
2010-07-12 21:39:57 +02:00
}
# endif /* LINUX && POWERPC64 */
2005-06-08 20:45:28 +00:00
static const struct xlat fileflags [ ] = {
2001-03-08 16:10:40 +00:00
# ifdef FREEBSD
2000-09-01 21:03:06 +00:00
{ UF_NODUMP , " UF_NODUMP " } ,
{ UF_IMMUTABLE , " UF_IMMUTABLE " } ,
{ UF_APPEND , " UF_APPEND " } ,
{ UF_OPAQUE , " UF_OPAQUE " } ,
{ UF_NOUNLINK , " UF_NOUNLINK " } ,
{ SF_ARCHIVED , " SF_ARCHIVED " } ,
{ SF_IMMUTABLE , " SF_IMMUTABLE " } ,
{ SF_APPEND , " SF_APPEND " } ,
{ SF_NOUNLINK , " SF_NOUNLINK " } ,
2001-03-08 16:10:40 +00:00
# elif UNIXWARE >= 2
2011-06-07 12:13:24 +02:00
# ifdef _S_ISMLD
{ _S_ISMLD , " _S_ISMLD " } ,
2001-03-08 16:10:40 +00:00
# endif
2011-06-07 12:13:24 +02:00
# ifdef _S_ISMOUNTED
{ _S_ISMOUNTED , " _S_ISMOUNTED " } ,
2001-03-08 16:10:40 +00:00
# endif
# endif
2000-09-01 21:03:06 +00:00
{ 0 , NULL } ,
} ;
2001-03-08 16:10:40 +00:00
# ifdef FREEBSD
2000-09-01 21:03:06 +00:00
int
2009-04-14 12:51:00 +00:00
sys_chflags ( struct tcb * tcp )
2000-09-01 21:03:06 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( fileflags , tcp - > u_arg [ 1 ] , " UF_??? " ) ;
2000-09-01 21:03:06 +00:00
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_fchflags ( struct tcb * tcp )
2000-09-01 21:03:06 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
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
printflags ( fileflags , tcp - > u_arg [ 1 ] , " UF_??? " ) ;
2000-09-01 21:03:06 +00:00
}
return 0 ;
}
# endif
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-04-16 00:21:26 +00:00
static void
2009-04-14 12:51:00 +00:00
realprintstat ( struct tcb * tcp , struct stat * statbuf )
{
if ( ! abbrev ( tcp ) ) {
tprintf ( " {st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, " ,
( unsigned long ) major ( statbuf - > st_dev ) ,
( unsigned long ) minor ( statbuf - > st_dev ) ,
( unsigned long ) statbuf - > st_ino ,
sprintmode ( statbuf - > st_mode ) ) ;
tprintf ( " st_nlink=%lu, st_uid=%lu, st_gid=%lu, " ,
( unsigned long ) statbuf - > st_nlink ,
( unsigned long ) statbuf - > st_uid ,
( unsigned long ) statbuf - > st_gid ) ;
2002-12-30 00:51:30 +00:00
# ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
2009-04-14 12:51:00 +00:00
tprintf ( " st_blksize=%lu, " , ( unsigned long ) statbuf - > st_blksize ) ;
# endif
2002-12-30 00:51:30 +00:00
# ifdef HAVE_STRUCT_STAT_ST_BLOCKS
2009-04-14 12:51:00 +00:00
tprintf ( " st_blocks=%lu, " , ( unsigned long ) statbuf - > st_blocks ) ;
# endif
}
else
tprintf ( " {st_mode=%s, " , sprintmode ( statbuf - > st_mode ) ) ;
switch ( statbuf - > st_mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
2002-12-30 00:51:30 +00:00
# ifdef HAVE_STRUCT_STAT_ST_RDEV
2009-04-14 12:51:00 +00:00
tprintf ( " st_rdev=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf - > st_rdev ) ,
( unsigned long ) minor ( statbuf - > st_rdev ) ) ;
2002-12-30 00:51:30 +00:00
# else /* !HAVE_STRUCT_STAT_ST_RDEV */
2009-04-14 12:51:00 +00:00
tprintf ( " st_size=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf - > st_size ) ,
( unsigned long ) minor ( statbuf - > st_size ) ) ;
2002-12-30 00:51:30 +00:00
# endif /* !HAVE_STRUCT_STAT_ST_RDEV */
2009-04-14 12:51:00 +00:00
break ;
default :
2011-02-23 16:16:50 +00:00
tprintf ( " st_size=%lu, " , ( unsigned long ) statbuf - > st_size ) ;
2009-04-14 12:51:00 +00:00
break ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " st_atime=%s, " , sprinttime ( statbuf - > st_atime ) ) ;
tprintf ( " st_mtime=%s, " , sprinttime ( statbuf - > st_mtime ) ) ;
tprintf ( " st_ctime=%s " , sprinttime ( statbuf - > st_ctime ) ) ;
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_FLAGS
2011-09-01 10:00:28 +02:00
tprints ( " , st_flags= " ) ;
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
printflags ( fileflags , statbuf - > st_flags , " UF_??? " ) ;
2001-03-08 16:10:40 +00:00
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_ACLCNT
2001-03-08 16:10:40 +00:00
tprintf ( " , st_aclcnt=%d " , statbuf - > st_aclcnt ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_LEVEL
2001-03-08 16:10:40 +00:00
tprintf ( " , st_level=%ld " , statbuf - > st_level ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_FSTYPE
2001-03-08 16:10:40 +00:00
tprintf ( " , st_fstype=%.*s " ,
( int ) sizeof statbuf - > st_fstype , statbuf - > st_fstype ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_GEN
2001-03-08 16:10:40 +00:00
tprintf ( " , st_gen=%u " , statbuf - > st_gen ) ;
# endif
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2009-04-14 12:51:00 +00:00
}
else
2011-09-01 10:00:28 +02:00
tprints ( " ...} " ) ;
1999-04-16 00:21:26 +00:00
}
1999-04-05 22:39:31 +00:00
1999-02-19 00:21:36 +00:00
static void
2009-04-14 12:51:00 +00:00
printstat ( struct tcb * tcp , long addr )
1999-02-19 00:21:36 +00:00
{
1999-04-16 00:21:26 +00:00
struct stat statbuf ;
1999-02-19 00:21:36 +00:00
2009-04-20 18:30:13 +00:00
if ( ! addr ) {
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
2009-04-20 18:30:13 +00:00
return ;
}
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
1999-02-19 00:21:36 +00:00
# ifdef LINUXSPARC
2009-02-27 20:32:52 +00:00
if ( current_personality = = 1 ) {
printstatsol ( tcp , addr ) ;
return ;
}
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
# ifdef SPARC64
else if ( current_personality = = 2 ) {
printstat_sparc64 ( tcp , addr ) ;
return ;
}
# endif
1999-02-19 00:21:36 +00:00
# endif /* LINUXSPARC */
2010-07-12 21:39:57 +02:00
# if defined LINUX && defined POWERPC64
if ( current_personality = = 1 ) {
printstat_powerpc32 ( tcp , addr ) ;
return ;
}
# endif
1999-02-19 00:21:36 +00:00
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-02-19 00:21:36 +00:00
return ;
}
1999-04-16 00:21:26 +00:00
realprintstat ( tcp , & statbuf ) ;
}
2001-03-08 13:59:00 +00:00
# endif /* !HAVE_LONG_LONG_OFF_T */
1999-04-16 00:21:26 +00:00
2007-08-07 01:22:49 +00:00
# if !defined HAVE_STAT64 && defined LINUX && defined X86_64
/*
* Linux x86_64 has unified ` struct stat ' but its i386 biarch needs
* ` struct stat64 ' . Its < asm - i386 / stat . h > definition expects 32 - bit ` long ' .
* < linux / include / asm - x86_64 / ia32 . h > is not in the public includes set .
* __GNUC__ is needed for the required __attribute__ below .
*/
struct stat64 {
unsigned long long st_dev ;
unsigned char __pad0 [ 4 ] ;
unsigned int __st_ino ;
unsigned int st_mode ;
unsigned int st_nlink ;
unsigned int st_uid ;
unsigned int st_gid ;
unsigned long long st_rdev ;
unsigned char __pad3 [ 4 ] ;
long long st_size ;
unsigned int st_blksize ;
unsigned long long st_blocks ;
unsigned int st_atime ;
unsigned int st_atime_nsec ;
unsigned int st_mtime ;
unsigned int st_mtime_nsec ;
unsigned int st_ctime ;
unsigned int st_ctime_nsec ;
unsigned long long st_ino ;
} __attribute__ ( ( packed ) ) ;
# define HAVE_STAT64 1
# define STAT64_SIZE 96
# endif
2000-04-10 22:22:31 +00:00
# ifdef HAVE_STAT64
1999-12-24 08:01:34 +00:00
static void
2009-04-14 12:51:00 +00:00
printstat64 ( struct tcb * tcp , long addr )
1999-12-24 08:01:34 +00:00
{
struct stat64 statbuf ;
2009-04-20 18:30:13 +00:00
# ifdef STAT64_SIZE
2007-08-07 01:22:49 +00:00
( void ) sizeof ( char [ sizeof statbuf = = STAT64_SIZE ? 1 : - 1 ] ) ;
# endif
2009-04-20 18:30:13 +00:00
if ( ! addr ) {
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
2009-04-20 18:30:13 +00:00
return ;
}
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
1999-12-24 08:01:34 +00:00
# ifdef LINUXSPARC
2009-02-27 20:32:52 +00:00
if ( current_personality = = 1 ) {
printstatsol ( tcp , addr ) ;
return ;
}
2009-04-20 18:30:13 +00:00
# ifdef SPARC64
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
else if ( current_personality = = 2 ) {
printstat_sparc64 ( tcp , addr ) ;
return ;
}
2009-04-20 18:30:13 +00:00
# endif
1999-12-24 08:01:34 +00:00
# endif /* LINUXSPARC */
2009-10-16 11:37:13 +02:00
# if defined LINUX && defined X86_64
if ( current_personality = = 0 ) {
printstat ( tcp , addr ) ;
return ;
}
# endif
2009-10-21 13:43:57 +00:00
1999-12-24 08:01:34 +00:00
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-12-24 08:01:34 +00:00
return ;
}
if ( ! abbrev ( tcp ) ) {
2000-08-10 18:16:15 +00:00
# ifdef HAVE_LONG_LONG
tprintf ( " {st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, " ,
# else
1999-12-24 08:01:34 +00:00
tprintf ( " {st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, " ,
2000-08-10 18:16:15 +00:00
# endif
1999-12-24 08:01:34 +00:00
( unsigned long ) major ( statbuf . st_dev ) ,
( unsigned long ) minor ( statbuf . st_dev ) ,
2000-08-10 18:16:15 +00:00
# ifdef HAVE_LONG_LONG
( unsigned long long ) statbuf . st_ino ,
# else
1999-12-24 08:01:34 +00:00
( unsigned long ) statbuf . st_ino ,
2000-08-10 18:16:15 +00:00
# endif
1999-12-24 08:01:34 +00:00
sprintmode ( statbuf . st_mode ) ) ;
tprintf ( " st_nlink=%lu, st_uid=%lu, st_gid=%lu, " ,
( unsigned long ) statbuf . st_nlink ,
( unsigned long ) statbuf . st_uid ,
( unsigned long ) statbuf . st_gid ) ;
2002-12-30 00:51:30 +00:00
# ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
1999-12-24 08:01:34 +00:00
tprintf ( " st_blksize=%lu, " ,
( unsigned long ) statbuf . st_blksize ) ;
2002-12-30 00:51:30 +00:00
# endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
# ifdef HAVE_STRUCT_STAT_ST_BLOCKS
1999-12-24 08:01:34 +00:00
tprintf ( " st_blocks=%lu, " , ( unsigned long ) statbuf . st_blocks ) ;
2002-12-30 00:51:30 +00:00
# endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
1999-12-24 08:01:34 +00:00
}
else
tprintf ( " {st_mode=%s, " , sprintmode ( statbuf . st_mode ) ) ;
switch ( statbuf . st_mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
2002-12-30 00:51:30 +00:00
# ifdef HAVE_STRUCT_STAT_ST_RDEV
1999-12-24 08:01:34 +00:00
tprintf ( " st_rdev=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf . st_rdev ) ,
( unsigned long ) minor ( statbuf . st_rdev ) ) ;
2002-12-30 00:51:30 +00:00
# else /* !HAVE_STRUCT_STAT_ST_RDEV */
1999-12-24 08:01:34 +00:00
tprintf ( " st_size=makedev(%lu, %lu), " ,
( unsigned long ) major ( statbuf . st_size ) ,
( unsigned long ) minor ( statbuf . st_size ) ) ;
2002-12-30 00:51:30 +00:00
# endif /* !HAVE_STRUCT_STAT_ST_RDEV */
1999-12-24 08:01:34 +00:00
break ;
default :
2007-08-07 01:05:19 +00:00
# ifdef HAVE_LONG_LONG
tprintf ( " st_size=%llu, " , ( unsigned long long ) statbuf . st_size ) ;
# else
tprintf ( " st_size=%lu, " , ( unsigned long ) statbuf . st_size ) ;
# endif
1999-12-24 08:01:34 +00:00
break ;
}
if ( ! abbrev ( tcp ) ) {
tprintf ( " st_atime=%s, " , sprinttime ( statbuf . st_atime ) ) ;
tprintf ( " st_mtime=%s, " , sprinttime ( statbuf . st_mtime ) ) ;
2001-03-08 16:10:40 +00:00
tprintf ( " st_ctime=%s " , sprinttime ( statbuf . st_ctime ) ) ;
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_FLAGS
2011-09-01 10:00:28 +02:00
tprints ( " , st_flags= " ) ;
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
printflags ( fileflags , statbuf . st_flags , " UF_??? " ) ;
2001-03-08 16:10:40 +00:00
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_ACLCNT
2001-03-08 16:10:40 +00:00
tprintf ( " , st_aclcnt=%d " , statbuf . st_aclcnt ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_LEVEL
2001-03-08 16:10:40 +00:00
tprintf ( " , st_level=%ld " , statbuf . st_level ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_FSTYPE
2001-03-08 16:10:40 +00:00
tprintf ( " , st_fstype=%.*s " ,
( int ) sizeof statbuf . st_fstype , statbuf . st_fstype ) ;
# endif
2002-12-30 00:51:30 +00:00
# if HAVE_STRUCT_STAT_ST_GEN
2001-03-08 16:10:40 +00:00
tprintf ( " , st_gen=%u " , statbuf . st_gen ) ;
# endif
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
1999-12-24 08:01:34 +00:00
}
else
2011-09-01 10:00:28 +02:00
tprints ( " ...} " ) ;
1999-12-24 08:01:34 +00:00
}
2000-04-10 22:22:31 +00:00
# endif /* HAVE_STAT64 */
1999-12-24 08:01:34 +00:00
2003-06-27 21:20:09 +00:00
# if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1999-04-16 00:21:26 +00:00
static void
2009-04-14 12:51:00 +00:00
convertoldstat ( const struct __old_kernel_stat * oldbuf , struct stat * newbuf )
{
newbuf - > st_dev = oldbuf - > st_dev ;
newbuf - > st_ino = oldbuf - > st_ino ;
newbuf - > st_mode = oldbuf - > st_mode ;
newbuf - > st_nlink = oldbuf - > st_nlink ;
newbuf - > st_uid = oldbuf - > st_uid ;
newbuf - > st_gid = oldbuf - > st_gid ;
newbuf - > st_rdev = oldbuf - > st_rdev ;
newbuf - > st_size = oldbuf - > st_size ;
newbuf - > st_atime = oldbuf - > st_atime ;
newbuf - > st_mtime = oldbuf - > st_mtime ;
newbuf - > st_ctime = oldbuf - > st_ctime ;
newbuf - > st_blksize = 0 ; /* not supported in old_stat */
newbuf - > st_blocks = 0 ; /* not supported in old_stat */
1999-04-16 00:21:26 +00:00
}
static void
2009-04-14 12:51:00 +00:00
printoldstat ( struct tcb * tcp , long addr )
1999-04-16 00:21:26 +00:00
{
1999-04-18 19:35:42 +00:00
struct __old_kernel_stat statbuf ;
struct stat newstatbuf ;
1999-04-16 00:21:26 +00:00
if ( ! addr ) {
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
1999-04-16 00:21:26 +00:00
return ;
1999-02-19 00:21:36 +00:00
}
1999-04-16 00:21:26 +00:00
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
2000-02-03 21:58:30 +00:00
tprintf ( " %#lx " , addr ) ;
1999-04-16 00:21:26 +00:00
return ;
1999-02-19 00:21:36 +00:00
}
2009-04-20 18:30:13 +00:00
# ifdef LINUXSPARC
if ( current_personality = = 1 ) {
printstatsol ( tcp , addr ) ;
return ;
}
# endif /* LINUXSPARC */
1999-04-16 00:21:26 +00:00
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-04-16 00:21:26 +00:00
return ;
1999-02-19 00:21:36 +00:00
}
1999-04-16 00:21:26 +00:00
convertoldstat ( & statbuf , & newstatbuf ) ;
realprintstat ( tcp , & newstatbuf ) ;
1999-02-19 00:21:36 +00:00
}
2002-10-07 14:31:00 +00:00
# endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
1999-04-16 00:21:26 +00:00
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_stat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
printstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2001-03-07 16:53:07 +00:00
# endif
1999-02-19 00:21:36 +00:00
1999-12-24 08:01:34 +00:00
int
2009-04-14 12:51:00 +00:00
sys_stat64 ( struct tcb * tcp )
1999-12-24 08:01:34 +00:00
{
# ifdef HAVE_STAT64
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-12-24 08:01:34 +00:00
} else {
printstat64 ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
# else
return printargs ( tcp ) ;
# endif
}
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
# ifdef LINUX
static const struct xlat fstatatflags [ ] = {
# ifndef AT_SYMLINK_NOFOLLOW
# define AT_SYMLINK_NOFOLLOW 0x100
# endif
{ AT_SYMLINK_NOFOLLOW , " AT_SYMLINK_NOFOLLOW " } ,
{ 0 , NULL } ,
} ;
2007-07-24 01:57:11 +00:00
# define utimensatflags fstatatflags
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
int
sys_newfstatat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
} else {
2010-07-12 21:39:57 +02:00
# ifdef POWERPC64
if ( current_personality = = 0 )
printstat ( tcp , tcp - > u_arg [ 2 ] ) ;
else
printstat64 ( tcp , tcp - > u_arg [ 2 ] ) ;
# elif defined HAVE_STAT64
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
printstat64 ( tcp , tcp - > u_arg [ 2 ] ) ;
# else
printstat ( tcp , tcp - > u_arg [ 2 ] ) ;
# endif
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( fstatatflags , tcp - > u_arg [ 3 ] , " AT_??? " ) ;
}
return 0 ;
}
# endif
2003-06-27 21:20:09 +00:00
# if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1999-04-16 00:21:26 +00:00
int
2009-04-14 12:51:00 +00:00
sys_oldstat ( struct tcb * tcp )
1999-04-16 00:21:26 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-04-16 00:21:26 +00:00
} else {
printoldstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2003-06-27 21:20:09 +00:00
# endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1999-04-16 00:21:26 +00:00
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fstat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
if ( entering ( tcp ) ) {
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
} else {
1999-02-19 00:21:36 +00:00
printstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2001-03-07 16:53:07 +00:00
# endif
1999-02-19 00:21:36 +00:00
1999-12-24 08:01:34 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fstat64 ( struct tcb * tcp )
1999-12-24 08:01:34 +00:00
{
# ifdef HAVE_STAT64
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
if ( entering ( tcp ) ) {
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
} else {
1999-12-24 08:01:34 +00:00
printstat64 ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
# else
return printargs ( tcp ) ;
# endif
}
2003-06-27 21:20:09 +00:00
# if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1999-04-16 00:21:26 +00:00
int
2009-04-14 12:51:00 +00:00
sys_oldfstat ( struct tcb * tcp )
1999-04-16 00:21:26 +00:00
{
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
if ( entering ( tcp ) ) {
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
} else {
1999-04-16 00:21:26 +00:00
printoldstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2003-06-27 21:20:09 +00:00
# endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1999-04-16 00:21:26 +00:00
2001-03-08 13:59:00 +00:00
# ifndef HAVE_LONG_LONG_OFF_T
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_lstat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
printstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2001-03-07 16:53:07 +00:00
# endif
1999-02-19 00:21:36 +00:00
1999-12-24 08:01:34 +00:00
int
2009-04-14 12:51:00 +00:00
sys_lstat64 ( struct tcb * tcp )
1999-12-24 08:01:34 +00:00
{
# ifdef HAVE_STAT64
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-12-24 08:01:34 +00:00
} else {
printstat64 ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
# else
return printargs ( tcp ) ;
# endif
}
2003-06-27 21:20:09 +00:00
# if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1999-04-16 00:21:26 +00:00
int
2009-04-14 12:51:00 +00:00
sys_oldlstat ( struct tcb * tcp )
1999-04-16 00:21:26 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-04-16 00:21:26 +00:00
} else {
printoldstat ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2003-06-27 21:20:09 +00:00
# endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1999-04-16 00:21:26 +00:00
1999-02-19 00:21:36 +00:00
# if defined(SVR4) || defined(LINUXSPARC)
int
2009-04-14 12:51:00 +00:00
sys_xstat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
2001-03-06 09:45:18 +00:00
# ifdef _STAT64_VER
if ( tcp - > u_arg [ 0 ] = = _STAT64_VER )
printstat64 ( tcp , tcp - > u_arg [ 2 ] ) ;
else
# endif
1999-02-19 00:21:36 +00:00
printstat ( tcp , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_fxstat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) )
tprintf ( " %ld, %ld, " , tcp - > u_arg [ 0 ] , tcp - > u_arg [ 1 ] ) ;
else {
2001-03-06 09:45:18 +00:00
# ifdef _STAT64_VER
if ( tcp - > u_arg [ 0 ] = = _STAT64_VER )
printstat64 ( tcp , tcp - > u_arg [ 2 ] ) ;
else
# endif
1999-02-19 00:21:36 +00:00
printstat ( tcp , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_lxstat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
2001-03-06 09:45:18 +00:00
# ifdef _STAT64_VER
if ( tcp - > u_arg [ 0 ] = = _STAT64_VER )
printstat64 ( tcp , tcp - > u_arg [ 2 ] ) ;
else
# endif
1999-02-19 00:21:36 +00:00
printstat ( tcp , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_xmknod ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
int mode = tcp - > u_arg [ 2 ] ;
if ( entering ( tcp ) ) {
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
tprintf ( " , %s " , sprintmode ( mode ) ) ;
switch ( mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
# ifdef LINUXSPARC
tprintf ( " , makedev(%lu, %lu) " ,
( unsigned long ) ( ( tcp - > u_arg [ 3 ] > > 18 ) & 0x3fff ) ,
( unsigned long ) ( tcp - > u_arg [ 3 ] & 0x3ffff ) ) ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# else
1999-02-19 00:21:36 +00:00
tprintf ( " , makedev(%lu, %lu) " ,
( unsigned long ) major ( tcp - > u_arg [ 3 ] ) ,
( unsigned long ) minor ( tcp - > u_arg [ 3 ] ) ) ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-02-19 00:21:36 +00:00
break ;
default :
break ;
}
}
return 0 ;
}
1999-06-11 13:18:40 +00:00
# ifdef HAVE_SYS_ACL_H
# include <sys/acl.h>
2005-06-08 20:45:28 +00:00
static const struct xlat aclcmds [ ] = {
1999-11-26 09:54:08 +00:00
# ifdef SETACL
1999-06-11 13:18:40 +00:00
{ SETACL , " SETACL " } ,
1999-11-26 09:54:08 +00:00
# endif
# ifdef GETACL
1999-06-11 13:18:40 +00:00
{ GETACL , " GETACL " } ,
1999-11-26 09:54:08 +00:00
# endif
# ifdef GETACLCNT
1999-06-11 13:18:40 +00:00
{ GETACLCNT , " GETACLCNT " } ,
1999-11-26 09:54:08 +00:00
# endif
# ifdef ACL_GET
{ ACL_GET , " ACL_GET " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-11-26 09:54:08 +00:00
# ifdef ACL_SET
{ ACL_SET , " ACL_SET " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-11-26 09:54:08 +00:00
# ifdef ACL_CNT
{ ACL_CNT , " ACL_CNT " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-06-11 13:18:40 +00:00
{ 0 , NULL } ,
} ;
int
2009-04-14 12:51:00 +00:00
sys_acl ( struct tcb * tcp )
1999-06-11 13:18:40 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-06-11 13:18:40 +00:00
printxval ( aclcmds , tcp - > u_arg [ 1 ] , " ???ACL??? " ) ;
tprintf ( " , %ld " , tcp - > u_arg [ 2 ] ) ;
/*
* FIXME - dump out the list of aclent_t ' s pointed to
* by " tcp->u_arg[3] " if it ' s not NULL .
*/
if ( tcp - > u_arg [ 3 ] )
tprintf ( " , %#lx " , tcp - > u_arg [ 3 ] ) ;
else
2011-09-01 10:00:28 +02:00
tprints ( " , NULL " ) ;
1999-06-11 13:18:40 +00:00
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_facl ( struct tcb * tcp )
1999-06-11 13:18:40 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
printxval ( aclcmds , tcp - > u_arg [ 1 ] , " ???ACL??? " ) ;
tprintf ( " , %ld " , tcp - > u_arg [ 2 ] ) ;
/*
* FIXME - dump out the list of aclent_t ' s pointed to
* by " tcp->u_arg[3] " if it ' s not NULL .
*/
if ( tcp - > u_arg [ 3 ] )
tprintf ( " , %#lx " , tcp - > u_arg [ 3 ] ) ;
else
2011-09-01 10:00:28 +02:00
tprints ( " , NULL " ) ;
1999-06-11 13:18:40 +00:00
}
return 0 ;
}
1999-11-26 09:54:08 +00:00
2005-06-08 20:45:28 +00:00
static const struct xlat aclipc [ ] = {
1999-11-26 09:54:08 +00:00
# ifdef IPC_SHM
{ IPC_SHM , " IPC_SHM " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-11-26 09:54:08 +00:00
# ifdef IPC_SEM
{ IPC_SEM , " IPC_SEM " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-11-26 09:54:08 +00:00
# ifdef IPC_MSG
{ IPC_MSG , " IPC_MSG " } ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-11-26 09:54:08 +00:00
{ 0 , NULL } ,
} ;
int
2009-04-14 12:51:00 +00:00
sys_aclipc ( struct tcb * tcp )
1999-11-26 09:54:08 +00:00
{
if ( entering ( tcp ) ) {
printxval ( aclipc , tcp - > u_arg [ 0 ] , " ???IPC??? " ) ;
tprintf ( " , %#lx, " , tcp - > u_arg [ 1 ] ) ;
printxval ( aclcmds , tcp - > u_arg [ 2 ] , " ???ACL??? " ) ;
tprintf ( " , %ld " , tcp - > u_arg [ 3 ] ) ;
/*
* FIXME - dump out the list of aclent_t ' s pointed to
* by " tcp->u_arg[4] " if it ' s not NULL .
*/
if ( tcp - > u_arg [ 4 ] )
tprintf ( " , %#lx " , tcp - > u_arg [ 4 ] ) ;
else
2011-09-01 10:00:28 +02:00
tprints ( " , NULL " ) ;
1999-11-26 09:54:08 +00:00
}
return 0 ;
}
1999-06-11 13:18:40 +00:00
# endif /* HAVE_SYS_ACL_H */
1999-02-19 00:21:36 +00:00
# endif /* SVR4 || LINUXSPARC */
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-02-19 00:21:36 +00:00
2004-09-04 03:39:20 +00:00
static const struct xlat fsmagic [ ] = {
2000-06-27 17:33:32 +00:00
{ 0x73757245 , " CODA_SUPER_MAGIC " } ,
{ 0x012ff7b7 , " COH_SUPER_MAGIC " } ,
{ 0x1373 , " DEVFS_SUPER_MAGIC " } ,
{ 0x1cd1 , " DEVPTS_SUPER_MAGIC " } ,
{ 0x414A53 , " EFS_SUPER_MAGIC " } ,
1999-02-19 00:21:36 +00:00
{ 0xef51 , " EXT2_OLD_SUPER_MAGIC " } ,
{ 0xef53 , " EXT2_SUPER_MAGIC " } ,
{ 0x137d , " EXT_SUPER_MAGIC " } ,
2000-06-27 17:33:32 +00:00
{ 0xf995e849 , " HPFS_SUPER_MAGIC " } ,
1999-02-19 00:21:36 +00:00
{ 0x9660 , " ISOFS_SUPER_MAGIC " } ,
{ 0x137f , " MINIX_SUPER_MAGIC " } ,
{ 0x138f , " MINIX_SUPER_MAGIC2 " } ,
1999-05-09 00:29:58 +00:00
{ 0x2468 , " MINIX2_SUPER_MAGIC " } ,
{ 0x2478 , " MINIX2_SUPER_MAGIC2 " } ,
1999-02-19 00:21:36 +00:00
{ 0x4d44 , " MSDOS_SUPER_MAGIC " } ,
2000-06-27 17:33:32 +00:00
{ 0x564c , " NCP_SUPER_MAGIC " } ,
1999-02-19 00:21:36 +00:00
{ 0x6969 , " NFS_SUPER_MAGIC " } ,
{ 0x9fa0 , " PROC_SUPER_MAGIC " } ,
2000-06-27 17:33:32 +00:00
{ 0x002f , " QNX4_SUPER_MAGIC " } ,
{ 0x52654973 , " REISERFS_SUPER_MAGIC " } ,
{ 0x02011994 , " SHMFS_SUPER_MAGIC " } ,
{ 0x517b , " SMB_SUPER_MAGIC " } ,
{ 0x012ff7b6 , " SYSV2_SUPER_MAGIC " } ,
{ 0x012ff7b5 , " SYSV4_SUPER_MAGIC " } ,
{ 0x00011954 , " UFS_MAGIC " } ,
{ 0x54190100 , " UFS_CIGAM " } ,
{ 0x012ff7b4 , " XENIX_SUPER_MAGIC " } ,
1999-02-19 00:21:36 +00:00
{ 0x012fd16d , " XIAFS_SUPER_MAGIC " } ,
2004-01-13 10:13:45 +00:00
{ 0x62656572 , " SYSFS_MAGIC " } ,
1999-02-19 00:21:36 +00:00
{ 0 , NULL } ,
} ;
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
# ifndef SVR4
2004-10-06 22:11:54 +00:00
static const char *
2009-04-14 12:51:00 +00:00
sprintfstype ( int magic )
1999-02-19 00:21:36 +00:00
{
static char buf [ 32 ] ;
2002-09-23 13:30:09 +00:00
# ifdef LINUX
2004-10-06 22:11:54 +00:00
const char * s ;
1999-02-19 00:21:36 +00:00
s = xlookup ( fsmagic , magic ) ;
if ( s ) {
sprintf ( buf , " \" %s \" " , s ) ;
return buf ;
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
sprintf ( buf , " %#x " , magic ) ;
return buf ;
}
static void
2009-04-14 12:51:00 +00:00
printstatfs ( struct tcb * tcp , long addr )
1999-02-19 00:21:36 +00:00
{
struct statfs statbuf ;
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-02-19 00:21:36 +00:00
return ;
}
# ifdef ALPHA
tprintf ( " {f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, " ,
sprintfstype ( statbuf . f_type ) ,
statbuf . f_bsize , statbuf . f_blocks , statbuf . f_bfree ) ;
2003-07-17 09:03:02 +00:00
tprintf ( " f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u " ,
2011-06-07 12:13:24 +02:00
statbuf . f_bavail , statbuf . f_files , statbuf . f_ffree ,
2003-07-17 09:03:02 +00:00
statbuf . f_fsid . __val [ 0 ] , statbuf . f_fsid . __val [ 1 ] ,
statbuf . f_namelen ) ;
1999-02-19 00:21:36 +00:00
# else /* !ALPHA */
tprintf ( " {f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, " ,
sprintfstype ( statbuf . f_type ) ,
1999-04-06 01:37:51 +00:00
( unsigned long ) statbuf . f_bsize ,
( unsigned long ) statbuf . f_blocks ,
( unsigned long ) statbuf . f_bfree ) ;
2003-07-17 09:03:02 +00:00
tprintf ( " f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d} " ,
( unsigned long ) statbuf . f_bavail ,
1999-04-06 01:37:51 +00:00
( unsigned long ) statbuf . f_files ,
2003-07-17 09:03:02 +00:00
( unsigned long ) statbuf . f_ffree ,
statbuf . f_fsid . __val [ 0 ] , statbuf . f_fsid . __val [ 1 ] ) ;
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-05-09 00:29:58 +00:00
tprintf ( " , f_namelen=%lu " , ( unsigned long ) statbuf . f_namelen ) ;
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
# endif /* !ALPHA */
2003-07-17 09:03:02 +00:00
# ifdef _STATFS_F_FRSIZE
tprintf ( " , f_frsize=%lu " , ( unsigned long ) statbuf . f_frsize ) ;
# endif
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
1999-02-19 00:21:36 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_statfs ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
printstatfs ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_fstatfs ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
printstatfs ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2009-10-14 16:33:58 +02:00
# if defined LINUX && defined HAVE_STATFS64
2003-07-17 09:03:02 +00:00
static void
2009-04-14 12:51:00 +00:00
printstatfs64 ( struct tcb * tcp , long addr )
2003-07-17 09:03:02 +00:00
{
struct statfs64 statbuf ;
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
2003-07-17 09:03:02 +00:00
return ;
}
2005-06-03 02:40:39 +00:00
tprintf ( " {f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, " ,
2003-07-17 09:03:02 +00:00
sprintfstype ( statbuf . f_type ) ,
2005-06-03 02:40:39 +00:00
( unsigned long long ) statbuf . f_bsize ,
( unsigned long long ) statbuf . f_blocks ,
( unsigned long long ) statbuf . f_bfree ) ;
tprintf ( " f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d} " ,
( unsigned long long ) statbuf . f_bavail ,
( unsigned long long ) statbuf . f_files ,
( unsigned long long ) statbuf . f_ffree ,
2003-07-17 09:03:02 +00:00
statbuf . f_fsid . __val [ 0 ] , statbuf . f_fsid . __val [ 1 ] ) ;
tprintf ( " , f_namelen=%lu " , ( unsigned long ) statbuf . f_namelen ) ;
# ifdef _STATFS_F_FRSIZE
2005-06-03 02:40:39 +00:00
tprintf ( " , f_frsize=%llu " , ( unsigned long long ) statbuf . f_frsize ) ;
2012-01-17 18:13:33 +01:00
# endif
# ifdef _STATFS_F_FLAGS
tprintf ( " , f_flags=%llu " , ( unsigned long long ) statbuf . f_flags ) ;
2003-07-17 09:03:02 +00:00
# endif
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2003-07-17 09:03:02 +00:00
}
2012-01-17 18:14:22 +01:00
struct compat_statfs64 {
uint32_t f_type ;
uint32_t f_bsize ;
uint64_t f_blocks ;
uint64_t f_bfree ;
uint64_t f_bavail ;
uint64_t f_files ;
uint64_t f_ffree ;
fsid_t f_fsid ;
uint32_t f_namelen ;
uint32_t f_frsize ;
uint32_t f_flags ;
uint32_t f_spare [ 4 ] ;
}
# if defined(X86_64) || defined(IA64)
__attribute__ ( ( packed , aligned ( 4 ) ) )
# endif
;
static void
printcompat_statfs64 ( struct tcb * tcp , long addr )
{
struct compat_statfs64 statbuf ;
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
if ( umove ( tcp , addr , & statbuf ) < 0 ) {
tprints ( " {...} " ) ;
return ;
}
tprintf ( " {f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, " ,
sprintfstype ( statbuf . f_type ) ,
( unsigned long ) statbuf . f_bsize ,
( unsigned long long ) statbuf . f_blocks ,
( unsigned long long ) statbuf . f_bfree ) ;
tprintf ( " f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d} " ,
( unsigned long long ) statbuf . f_bavail ,
( unsigned long long ) statbuf . f_files ,
( unsigned long long ) statbuf . f_ffree ,
statbuf . f_fsid . __val [ 0 ] , statbuf . f_fsid . __val [ 1 ] ) ;
tprintf ( " , f_namelen=%lu " , ( unsigned long ) statbuf . f_namelen ) ;
tprintf ( " , f_frsize=%lu " , ( unsigned long ) statbuf . f_frsize ) ;
tprintf ( " , f_flags=%lu " , ( unsigned long ) statbuf . f_frsize ) ;
tprints ( " } " ) ;
}
2003-07-17 09:03:02 +00:00
int
2009-04-14 12:51:00 +00:00
sys_statfs64 ( struct tcb * tcp )
2003-07-17 09:03:02 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %lu, " , tcp - > u_arg [ 1 ] ) ;
} else {
2011-06-07 12:13:24 +02:00
if ( tcp - > u_arg [ 1 ] = = sizeof ( struct statfs64 ) )
2003-07-17 09:03:02 +00:00
printstatfs64 ( tcp , tcp - > u_arg [ 2 ] ) ;
2012-01-17 18:14:22 +01:00
else if ( tcp - > u_arg [ 1 ] = = sizeof ( struct compat_statfs64 ) )
printcompat_statfs64 ( tcp , tcp - > u_arg [ 2 ] ) ;
2003-07-17 09:03:02 +00:00
else
2011-09-01 10:00:28 +02:00
tprints ( " {???} " ) ;
2003-07-17 09:03:02 +00:00
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_fstatfs64 ( struct tcb * tcp )
2003-07-17 09:03:02 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %lu, " , tcp - > u_arg [ 1 ] ) ;
2003-07-17 09:03:02 +00:00
} else {
2011-06-07 12:13:24 +02:00
if ( tcp - > u_arg [ 1 ] = = sizeof ( struct statfs64 ) )
2003-07-17 09:03:02 +00:00
printstatfs64 ( tcp , tcp - > u_arg [ 2 ] ) ;
2012-01-17 18:14:22 +01:00
else if ( tcp - > u_arg [ 1 ] = = sizeof ( struct compat_statfs64 ) )
printcompat_statfs64 ( tcp , tcp - > u_arg [ 2 ] ) ;
2003-07-17 09:03:02 +00:00
else
2011-09-01 10:00:28 +02:00
tprints ( " {???} " ) ;
2003-07-17 09:03:02 +00:00
}
return 0 ;
}
# endif
2002-09-23 13:30:09 +00:00
# if defined(LINUX) && defined(__alpha)
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
osf_statfs ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
printstatfs ( tcp , tcp - > u_arg [ 1 ] ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
osf_fstatfs ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
tprintf ( " %lu, " , tcp - > u_arg [ 0 ] ) ;
} else {
printstatfs ( tcp , tcp - > u_arg [ 1 ] ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX && __alpha */
1999-02-19 00:21:36 +00:00
# endif /* !SVR4 */
# ifdef SUNOS4
int
2009-04-14 12:51:00 +00:00
sys_ustat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
struct ustat statbuf ;
if ( entering ( tcp ) ) {
tprintf ( " makedev(%lu, %lu), " ,
( long ) major ( tcp - > u_arg [ 0 ] ) ,
( long ) minor ( tcp - > u_arg [ 0 ] ) ) ;
}
else {
if ( syserror ( tcp ) | | ! verbose ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 1 ] ) ;
else if ( umove ( tcp , tcp - > u_arg [ 1 ] , & statbuf ) < 0 )
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-02-19 00:21:36 +00:00
else {
tprintf ( " {f_tfree=%lu, f_tinode=%lu, " ,
statbuf . f_tfree , statbuf . f_tinode ) ;
tprintf ( " f_fname= \" %.*s \" , " ,
( int ) sizeof ( statbuf . f_fname ) ,
statbuf . f_fname ) ;
tprintf ( " f_fpack= \" %.*s \" } " ,
( int ) sizeof ( statbuf . f_fpack ) ,
statbuf . f_fpack ) ;
}
}
return 0 ;
}
# endif /* SUNOS4 */
/* directory */
int
2009-04-14 12:51:00 +00:00
sys_chdir ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
}
return 0 ;
}
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
static int
decode_mkdir ( struct tcb * tcp , int offset )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
tprintf ( " , %#lo " , tcp - > u_arg [ offset + 1 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
int
sys_mkdir ( struct tcb * tcp )
{
return decode_mkdir ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_mkdirat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_mkdir ( tcp , 1 ) ;
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_link ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
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
# ifdef LINUX
int
sys_linkat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 2 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 3 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 4 ] ) ;
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
}
return 0 ;
}
# endif
# ifdef LINUX
static const struct xlat unlinkatflags [ ] = {
# ifndef AT_REMOVEDIR
# define AT_REMOVEDIR 0x200
# endif
{ AT_REMOVEDIR , " AT_REMOVEDIR " } ,
{ 0 , NULL } ,
} ;
int
sys_unlinkat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( unlinkatflags , tcp - > u_arg [ 2 ] , " AT_??? " ) ;
}
return 0 ;
}
# endif
# ifdef LINUX
1999-02-19 00:21:36 +00:00
int
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
sys_symlinkat ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 1 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
# endif
static int
decode_readlink ( struct tcb * tcp , int offset )
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
if ( syserror ( tcp ) )
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
tprintf ( " %#lx " , tcp - > u_arg [ offset + 1 ] ) ;
1999-02-19 00:21:36 +00:00
else
2012-01-27 17:24:26 +01:00
/* Used to use printpathn(), but readlink
* neither includes NUL in the returned count ,
* nor actually writes it into memory .
* printpathn ( ) would decide on printing
* " ... " continuation based on garbage
* past return buffer ' s end .
*/
printstr ( tcp , tcp - > u_arg [ offset + 1 ] , tcp - > u_rval ) ;
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
tprintf ( " , %lu " , tcp - > u_arg [ offset + 2 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
int
sys_readlink ( struct tcb * tcp )
{
return decode_readlink ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_readlinkat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_readlink ( tcp , 1 ) ;
}
# endif
# ifdef LINUX
int
sys_renameat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 2 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 3 ] ) ;
}
return 0 ;
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_chown ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2003-11-13 22:32:27 +00:00
printuid ( " , " , tcp - > u_arg [ 1 ] ) ;
printuid ( " , " , tcp - > u_arg [ 2 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
# ifdef LINUX
int
sys_fchownat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
printuid ( " , " , tcp - > u_arg [ 2 ] ) ;
printuid ( " , " , tcp - > u_arg [ 3 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( fstatatflags , tcp - > u_arg [ 4 ] , " AT_??? " ) ;
}
return 0 ;
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fchown ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2003-11-13 22:32:27 +00:00
printuid ( " , " , tcp - > u_arg [ 1 ] ) ;
printuid ( " , " , tcp - > u_arg [ 2 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
static int
decode_chmod ( struct tcb * tcp , int offset )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
tprintf ( " , %#lo " , tcp - > u_arg [ offset + 1 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
int
sys_chmod ( struct tcb * tcp )
{
return decode_chmod ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_fchmodat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_chmod ( tcp , 1 ) ;
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fchmod ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %#lo " , tcp - > u_arg [ 1 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
1999-11-18 17:09:47 +00:00
# ifdef ALPHA
int
2009-04-14 12:51:00 +00:00
sys_osf_utimes ( struct tcb * tcp )
1999-11-18 17:09:47 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printtv_bitness ( tcp , tcp - > u_arg [ 1 ] , BITNESS_32 , 0 ) ;
}
return 0 ;
1999-11-18 17:09:47 +00:00
}
# endif
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
static int
2007-07-24 01:57:11 +00:00
decode_utimes ( struct tcb * tcp , int offset , int special )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2007-07-24 01:57:11 +00:00
if ( tcp - > u_arg [ offset + 1 ] = = 0 )
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
2007-07-24 01:57:11 +00:00
else {
2011-09-01 10:00:28 +02:00
tprints ( " { " ) ;
2007-07-24 01:57:11 +00:00
printtv_bitness ( tcp , tcp - > u_arg [ offset + 1 ] ,
BITNESS_CURRENT , special ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2007-08-07 01:22:49 +00:00
printtv_bitness ( tcp , tcp - > u_arg [ offset + 1 ]
2011-06-07 12:13:24 +02:00
+ sizeof ( struct timeval ) ,
2007-07-24 01:57:11 +00:00
BITNESS_CURRENT , special ) ;
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2007-07-24 01:57:11 +00:00
}
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
int
sys_utimes ( struct tcb * tcp )
{
2007-07-24 01:57:11 +00:00
return decode_utimes ( tcp , 0 , 0 ) ;
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
}
# ifdef LINUX
int
sys_futimesat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2007-07-24 01:57:11 +00:00
return decode_utimes ( tcp , 1 , 0 ) ;
}
int
sys_utimensat ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2007-07-24 01:57:11 +00:00
decode_utimes ( tcp , 1 , 1 ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2007-07-24 01:57:11 +00:00
printflags ( utimensatflags , tcp - > u_arg [ 3 ] , " AT_??? " ) ;
}
return 0 ;
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
}
# endif
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_utime ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
2007-07-05 20:31:58 +00:00
union {
long utl [ 2 ] ;
int uti [ 2 ] ;
} u ;
1999-02-19 00:21:36 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
if ( ! tcp - > u_arg [ 1 ] )
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
1999-02-19 00:21:36 +00:00
else if ( ! verbose ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 1 ] ) ;
2007-07-05 20:31:58 +00:00
else if ( umoven ( tcp , tcp - > u_arg [ 1 ] ,
2 * personality_wordsize [ current_personality ] ,
( char * ) & u ) < 0 )
2011-09-01 10:00:28 +02:00
tprints ( " [?, ?] " ) ;
2007-07-05 20:31:58 +00:00
else if ( personality_wordsize [ current_personality ]
= = sizeof u . utl [ 0 ] ) {
tprintf ( " [%s, " , sprinttime ( u . utl [ 0 ] ) ) ;
tprintf ( " %s] " , sprinttime ( u . utl [ 1 ] ) ) ;
}
else if ( personality_wordsize [ current_personality ]
= = sizeof u . uti [ 0 ] ) {
tprintf ( " [%s, " , sprinttime ( u . uti [ 0 ] ) ) ;
tprintf ( " %s] " , sprinttime ( u . uti [ 1 ] ) ) ;
1999-02-19 00:21:36 +00:00
}
2007-07-05 20:31:58 +00:00
else
abort ( ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
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
static int
decode_mknod ( struct tcb * tcp , int offset )
1999-02-19 00:21:36 +00:00
{
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
int mode = tcp - > u_arg [ offset + 1 ] ;
1999-02-19 00:21:36 +00:00
if ( entering ( tcp ) ) {
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
printpath ( tcp , tcp - > u_arg [ offset ] ) ;
1999-02-19 00:21:36 +00:00
tprintf ( " , %s " , sprintmode ( mode ) ) ;
switch ( mode & S_IFMT ) {
case S_IFCHR : case S_IFBLK :
# ifdef LINUXSPARC
if ( current_personality = = 1 )
tprintf ( " , makedev(%lu, %lu) " ,
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
( unsigned long ) ( ( tcp - > u_arg [ offset + 2 ] > > 18 ) & 0x3fff ) ,
( unsigned long ) ( tcp - > u_arg [ offset + 2 ] & 0x3ffff ) ) ;
1999-02-19 00:21:36 +00:00
else
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif
1999-02-19 00:21:36 +00:00
tprintf ( " , makedev(%lu, %lu) " ,
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
( unsigned long ) major ( tcp - > u_arg [ offset + 2 ] ) ,
( unsigned long ) minor ( tcp - > u_arg [ offset + 2 ] ) ) ;
1999-02-19 00:21:36 +00:00
break ;
default :
break ;
}
}
return 0 ;
}
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
int
sys_mknod ( struct tcb * tcp )
{
return decode_mknod ( tcp , 0 ) ;
}
# ifdef LINUX
int
sys_mknodat ( struct tcb * tcp )
{
if ( entering ( tcp ) )
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
print_dirfd ( tcp , tcp - > u_arg [ 0 ] ) ;
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
return decode_mknod ( tcp , 1 ) ;
}
# endif
2006-12-13 16:59:44 +00:00
# ifdef FREEBSD
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_mkfifo ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %#lo " , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}
2006-12-13 16:59:44 +00:00
# endif /* FREEBSD */
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fsync ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
1999-02-19 00:21:36 +00:00
}
return 0 ;
}
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-02-19 00:21:36 +00:00
static void
2009-04-14 12:51:00 +00:00
printdir ( struct tcb * tcp , long addr )
1999-02-19 00:21:36 +00:00
{
struct dirent d ;
if ( ! verbose ( tcp ) ) {
tprintf ( " %#lx " , addr ) ;
return ;
}
if ( umove ( tcp , addr , & d ) < 0 ) {
2011-09-01 10:00:28 +02:00
tprints ( " {...} " ) ;
1999-02-19 00:21:36 +00:00
return ;
}
tprintf ( " {d_ino=%ld, " , ( unsigned long ) d . d_ino ) ;
2011-09-01 10:00:28 +02:00
tprints ( " d_name= " ) ;
1999-02-19 00:21:36 +00:00
printpathn ( tcp , ( long ) ( ( struct dirent * ) addr ) - > d_name , d . d_reclen ) ;
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
1999-02-19 00:21:36 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_readdir ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
} else {
if ( syserror ( tcp ) | | tcp - > u_rval = = 0 | | ! verbose ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 1 ] ) ;
else
printdir ( tcp , tcp - > u_arg [ 1 ] ) ;
/* Not much point in printing this out, it is always 1. */
if ( tcp - > u_arg [ 2 ] ! = 1 )
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
2004-01-13 09:47:49 +00:00
# if defined FREEBSD || defined LINUX
2005-06-08 20:45:28 +00:00
static const struct xlat direnttypes [ ] = {
2011-06-07 12:13:24 +02:00
{ DT_UNKNOWN , " DT_UNKNOWN " } ,
{ DT_FIFO , " DT_FIFO " } ,
{ DT_CHR , " DT_CHR " } ,
{ DT_DIR , " DT_DIR " } ,
{ DT_BLK , " DT_BLK " } ,
{ DT_REG , " DT_REG " } ,
{ DT_LNK , " DT_LNK " } ,
{ DT_SOCK , " DT_SOCK " } ,
{ DT_WHT , " DT_WHT " } ,
2000-09-01 21:03:06 +00:00
{ 0 , NULL } ,
} ;
# endif
1999-02-19 00:21:36 +00:00
int
2008-04-19 23:49:58 +00:00
sys_getdents ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
int i , len , dents = 0 ;
char * buf ;
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
1999-02-19 00:21:36 +00:00
return 0 ;
}
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx, %lu " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
return 0 ;
}
len = tcp - > u_rval ;
2011-09-01 16:35:44 +02:00
/* Beware of insanely large or negative values in tcp->u_rval */
if ( tcp - > u_rval > 1024 * 1024 )
len = 1024 * 1024 ;
if ( tcp - > u_rval < 0 )
len = 0 ;
2009-10-07 20:41:56 -04:00
buf = len ? malloc ( len ) : NULL ;
2011-08-31 14:00:02 +02:00
if ( len & & ! buf )
die_out_of_memory ( ) ;
1999-02-19 00:21:36 +00:00
if ( umoven ( tcp , tcp - > u_arg [ 1 ] , len , buf ) < 0 ) {
2005-06-01 18:55:42 +00:00
tprintf ( " %#lx, %lu " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
1999-02-19 00:21:36 +00:00
free ( buf ) ;
return 0 ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " { " ) ;
1999-02-19 00:21:36 +00:00
for ( i = 0 ; i < len ; ) {
1999-05-25 23:11:18 +00:00
struct kernel_dirent * d = ( struct kernel_dirent * ) & buf [ i ] ;
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-02-19 00:21:36 +00:00
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_ino=%lu, d_off=%lu, " ,
i ? " " : " " , d - > d_ino , d - > d_off ) ;
tprintf ( " d_reclen=%u, d_name= \" %s \" } " ,
d - > d_reclen , d - > d_name ) ;
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
# ifdef SVR4
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_ino=%lu, d_off=%lu, " ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
i ? " " : " " ,
( unsigned long ) d - > d_ino ,
( unsigned long ) d - > d_off ) ;
1999-02-19 00:21:36 +00:00
tprintf ( " d_reclen=%u, d_name= \" %s \" } " ,
d - > d_reclen , d - > d_name ) ;
}
# endif /* SVR4 */
# ifdef SUNOS4
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_off=%lu, d_fileno=%lu, d_reclen=%u, " ,
i ? " " : " " , d - > d_off , d - > d_fileno ,
d - > d_reclen ) ;
tprintf ( " d_namlen=%u, d_name= \" %.*s \" } " ,
d - > d_namlen , d - > d_namlen , d - > d_name ) ;
}
# endif /* SUNOS4 */
2000-09-01 21:03:06 +00:00
# ifdef FREEBSD
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_fileno=%u, d_reclen=%u, d_type= " ,
i ? " " : " " , d - > d_fileno , d - > d_reclen ) ;
printxval ( direnttypes , d - > d_type , " DT_??? " ) ;
tprintf ( " , d_namlen=%u, d_name= \" %.*s \" } " ,
d - > d_namlen , d - > d_namlen , d - > d_name ) ;
}
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
# endif /* FREEBSD */
2000-02-01 16:22:52 +00:00
if ( ! d - > d_reclen ) {
2011-09-01 10:00:28 +02:00
tprints ( " /* d_reclen == 0, problem here */ " ) ;
2000-02-01 16:22:52 +00:00
break ;
}
1999-02-19 00:21:36 +00:00
i + = d - > d_reclen ;
dents + + ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
1999-02-19 00:21:36 +00:00
else
tprintf ( " /* %u entries */ " , dents ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
free ( buf ) ;
return 0 ;
}
2001-03-06 15:08:09 +00:00
# if _LFS64_LARGEFILE
int
2008-04-19 23:49:58 +00:00
sys_getdents64 ( struct tcb * tcp )
2001-03-06 15:08:09 +00:00
{
int i , len , dents = 0 ;
char * buf ;
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2001-03-06 15:08:09 +00:00
return 0 ;
}
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx, %lu " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
return 0 ;
}
2011-09-01 16:35:44 +02:00
2001-03-06 15:08:09 +00:00
len = tcp - > u_rval ;
2011-09-01 16:35:44 +02:00
/* Beware of insanely large or negative tcp->u_rval */
if ( tcp - > u_rval > 1024 * 1024 )
len = 1024 * 1024 ;
if ( tcp - > u_rval < 0 )
len = 0 ;
2009-10-07 20:41:56 -04:00
buf = len ? malloc ( len ) : NULL ;
2011-08-31 14:00:02 +02:00
if ( len & & ! buf )
die_out_of_memory ( ) ;
2011-09-01 16:35:44 +02:00
2001-03-06 15:08:09 +00:00
if ( umoven ( tcp , tcp - > u_arg [ 1 ] , len , buf ) < 0 ) {
2005-06-01 18:55:42 +00:00
tprintf ( " %#lx, %lu " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
2001-03-06 15:08:09 +00:00
free ( buf ) ;
return 0 ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " { " ) ;
2001-03-06 15:08:09 +00:00
for ( i = 0 ; i < len ; ) {
struct dirent64 * d = ( struct dirent64 * ) & buf [ i ] ;
2002-09-23 13:30:09 +00:00
# if defined(LINUX) || defined(SVR4)
2001-03-06 15:08:09 +00:00
if ( ! abbrev ( tcp ) ) {
2006-10-14 20:20:46 +00:00
tprintf ( " %s{d_ino=% " PRIu64 " , d_off=% " PRId64 " , " ,
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
i ? " " : " " ,
2004-01-13 10:16:47 +00:00
d - > d_ino ,
d - > d_off ) ;
2004-01-13 09:47:49 +00:00
# ifdef LINUX
2011-09-01 10:00:28 +02:00
tprints ( " d_type= " ) ;
2004-01-13 09:47:49 +00:00
printxval ( direnttypes , d - > d_type , " DT_??? " ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2004-01-13 09:47:49 +00:00
# endif
2001-03-06 15:08:09 +00:00
tprintf ( " d_reclen=%u, d_name= \" %s \" } " ,
d - > d_reclen , d - > d_name ) ;
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX || SVR4 */
2001-03-06 15:08:09 +00:00
# ifdef SUNOS4
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_off=%lu, d_fileno=%lu, d_reclen=%u, " ,
i ? " " : " " , d - > d_off , d - > d_fileno ,
d - > d_reclen ) ;
tprintf ( " d_namlen=%u, d_name= \" %.*s \" } " ,
d - > d_namlen , d - > d_namlen , d - > d_name ) ;
}
# endif /* SUNOS4 */
2008-04-19 23:49:58 +00:00
if ( ! d - > d_reclen ) {
2011-09-01 10:00:28 +02:00
tprints ( " /* d_reclen == 0, problem here */ " ) ;
2008-04-19 23:49:58 +00:00
break ;
}
2001-03-06 15:08:09 +00:00
i + = d - > d_reclen ;
dents + + ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2001-03-06 15:08:09 +00:00
else
tprintf ( " /* %u entries */ " , dents ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
free ( buf ) ;
return 0 ;
}
# endif
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
2000-09-01 21:03:06 +00:00
# ifdef FREEBSD
int
2008-04-19 23:49:58 +00:00
sys_getdirentries ( struct tcb * tcp )
2000-09-01 21:03:06 +00:00
{
int i , len , dents = 0 ;
long basep ;
char * buf ;
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2000-09-01 21:03:06 +00:00
return 0 ;
}
if ( syserror ( tcp ) | | ! verbose ( tcp ) ) {
tprintf ( " %#lx, %lu, %#lx " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
return 0 ;
}
2011-09-01 16:35:44 +02:00
2000-09-01 21:03:06 +00:00
len = tcp - > u_rval ;
2011-09-01 16:35:44 +02:00
/* Beware of insanely large or negative tcp->u_rval */
if ( tcp - > u_rval > 1024 * 1024 )
len = 1024 * 1024 ;
if ( tcp - > u_rval < 0 )
len = 0 ;
2011-08-20 12:48:18 +02:00
buf = malloc ( len ) ;
2011-08-31 14:00:02 +02:00
if ( ! buf )
die_out_of_memory ( ) ;
2011-09-01 16:35:44 +02:00
2000-09-01 21:03:06 +00:00
if ( umoven ( tcp , tcp - > u_arg [ 1 ] , len , buf ) < 0 ) {
2005-06-01 18:55:42 +00:00
tprintf ( " %#lx, %lu, %#lx " , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
2000-09-01 21:03:06 +00:00
free ( buf ) ;
return 0 ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " { " ) ;
2000-09-01 21:03:06 +00:00
for ( i = 0 ; i < len ; ) {
struct kernel_dirent * d = ( struct kernel_dirent * ) & buf [ i ] ;
if ( ! abbrev ( tcp ) ) {
tprintf ( " %s{d_fileno=%u, d_reclen=%u, d_type= " ,
i ? " " : " " , d - > d_fileno , d - > d_reclen ) ;
printxval ( direnttypes , d - > d_type , " DT_??? " ) ;
tprintf ( " , d_namlen=%u, d_name= \" %.*s \" } " ,
d - > d_namlen , d - > d_namlen , d - > d_name ) ;
}
2008-04-19 23:49:58 +00:00
if ( ! d - > d_reclen ) {
2011-09-01 10:00:28 +02:00
tprints ( " /* d_reclen == 0, problem here */ " ) ;
2008-04-19 23:49:58 +00:00
break ;
}
2000-09-01 21:03:06 +00:00
i + = d - > d_reclen ;
dents + + ;
}
if ( ! abbrev ( tcp ) )
2011-09-01 10:00:28 +02:00
tprints ( " } " ) ;
2000-09-01 21:03:06 +00:00
else
tprintf ( " /* %u entries */ " , dents ) ;
free ( buf ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 2 ] ) ;
if ( umove ( tcp , tcp - > u_arg [ 3 ] , & basep ) < 0 )
tprintf ( " , %#lx " , tcp - > u_arg [ 3 ] ) ;
else
tprintf ( " , [%lu] " , basep ) ;
return 0 ;
}
# endif
1999-02-19 00:21:36 +00:00
2002-09-23 13:30:09 +00:00
# ifdef LINUX
1999-02-19 00:21:36 +00:00
int
2009-04-14 12:51:00 +00:00
sys_getcwd ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
2009-04-14 12:51:00 +00:00
if ( exiting ( tcp ) ) {
if ( syserror ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 0 ] ) ;
else
printpathn ( tcp , tcp - > u_arg [ 0 ] , tcp - > u_rval - 1 ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
1999-02-19 00:21:36 +00:00
}
2002-09-23 13:30:09 +00:00
# endif /* LINUX */
1999-02-19 00:21:36 +00:00
2000-09-01 21:03:06 +00:00
# ifdef FREEBSD
int
2009-04-14 12:51:00 +00:00
sys___getcwd ( struct tcb * tcp )
2000-09-01 21:03:06 +00:00
{
2009-04-14 12:51:00 +00:00
if ( exiting ( tcp ) ) {
if ( syserror ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 0 ] ) ;
else
printpathn ( tcp , tcp - > u_arg [ 0 ] , tcp - > u_arg [ 1 ] ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
2000-09-01 21:03:06 +00:00
}
# endif
1999-02-19 00:21:36 +00:00
# ifdef HAVE_SYS_ASYNCH_H
int
2009-04-14 12:51:00 +00:00
sys_aioread ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
struct aio_result_t res ;
if ( entering ( tcp ) ) {
tprintf ( " %lu, " , tcp - > u_arg [ 0 ] ) ;
} else {
if ( syserror ( tcp ) )
tprintf ( " %#lx " , tcp - > u_arg [ 1 ] ) ;
else
printstr ( tcp , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
tprintf ( " , %lu, %lu, " , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
printxval ( whence , tcp - > u_arg [ 4 ] , " L_??? " ) ;
if ( syserror ( tcp ) | | tcp - > u_arg [ 5 ] = = 0
| | umove ( tcp , tcp - > u_arg [ 5 ] , & res ) < 0 )
tprintf ( " , %#lx " , tcp - > u_arg [ 5 ] ) ;
else
tprintf ( " , {aio_return %d aio_errno %d} " ,
res . aio_return , res . aio_errno ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_aiowrite ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
struct aio_result_t res ;
if ( entering ( tcp ) ) {
tprintf ( " %lu, " , tcp - > u_arg [ 0 ] ) ;
printstr ( tcp , tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
tprintf ( " , %lu, %lu, " , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
printxval ( whence , tcp - > u_arg [ 4 ] , " L_??? " ) ;
}
else {
if ( tcp - > u_arg [ 5 ] = = 0 )
2011-09-01 10:00:28 +02:00
tprints ( " , NULL " ) ;
1999-02-19 00:21:36 +00:00
else if ( syserror ( tcp )
| | umove ( tcp , tcp - > u_arg [ 5 ] , & res ) < 0 )
tprintf ( " , %#lx " , tcp - > u_arg [ 5 ] ) ;
else
tprintf ( " , {aio_return %d aio_errno %d} " ,
res . aio_return , res . aio_errno ) ;
}
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_aiowait ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
if ( entering ( tcp ) )
printtv ( tcp , tcp - > u_arg [ 0 ] ) ;
return 0 ;
}
int
2009-04-14 12:51:00 +00:00
sys_aiocancel ( struct tcb * tcp )
1999-02-19 00:21:36 +00:00
{
struct aio_result_t res ;
if ( exiting ( tcp ) ) {
if ( tcp - > u_arg [ 0 ] = = 0 )
2011-09-01 10:00:28 +02:00
tprints ( " NULL " ) ;
1999-02-19 00:21:36 +00:00
else if ( syserror ( tcp )
| | umove ( tcp , tcp - > u_arg [ 0 ] , & res ) < 0 )
tprintf ( " %#lx " , tcp - > u_arg [ 0 ] ) ;
else
tprintf ( " {aio_return %d aio_errno %d} " ,
res . aio_return , res . aio_errno ) ;
}
return 0 ;
}
# endif /* HAVE_SYS_ASYNCH_H */
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
2005-06-08 20:45:28 +00:00
static const struct xlat xattrflags [ ] = {
2003-04-02 01:10:44 +00:00
# ifdef XATTR_CREATE
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{ XATTR_CREATE , " XATTR_CREATE " } ,
{ XATTR_REPLACE , " XATTR_REPLACE " } ,
2003-04-02 01:10:44 +00:00
# endif
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{ 0 , NULL }
} ;
2004-08-31 06:30:48 +00:00
static void
2009-04-14 12:51:00 +00:00
print_xattr_val ( struct tcb * tcp , int failed ,
unsigned long arg ,
unsigned long insize ,
unsigned long size )
{
if ( ! failed ) {
unsigned long capacity = 4 * size + 1 ;
unsigned char * buf = ( capacity < size ) ? NULL : malloc ( capacity ) ;
if ( buf = = NULL | | /* probably a bogus size argument */
umoven ( tcp , arg , size , ( char * ) & buf [ 3 * size ] ) < 0 ) {
failed = 1 ;
}
2005-02-02 03:38:32 +00:00
else {
2009-04-14 12:51:00 +00:00
unsigned char * out = buf ;
unsigned char * in = & buf [ 3 * size ] ;
size_t i ;
for ( i = 0 ; i < size ; + + i ) {
if ( isprint ( in [ i ] ) )
* out + + = in [ i ] ;
else {
2004-08-31 06:30:48 +00:00
# define tohex(n) "0123456789abcdef"[n]
2009-04-14 12:51:00 +00:00
* out + + = ' \\ ' ;
* out + + = ' x ' ;
* out + + = tohex ( in [ i ] / 16 ) ;
* out + + = tohex ( in [ i ] % 16 ) ;
}
}
/* Don't print terminating NUL if there is one. */
if ( i > 0 & & in [ i - 1 ] = = ' \0 ' )
out - = 4 ;
* out = ' \0 ' ;
tprintf ( " , \" %s \" , %ld " , buf , insize ) ;
2005-02-02 03:38:32 +00:00
}
2009-04-14 12:51:00 +00:00
free ( buf ) ;
2005-02-02 03:38:32 +00:00
}
2009-04-14 12:51:00 +00:00
if ( failed )
tprintf ( " , 0x%lx, %ld " , arg , insize ) ;
2004-08-31 06:30:48 +00:00
}
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
int
2009-04-14 12:51:00 +00:00
sys_setxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
print_xattr_val ( tcp , 0 , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] , tcp - > u_arg [ 3 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printflags ( xattrflags , tcp - > u_arg [ 4 ] , " XATTR_??? " ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_fsetxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
print_xattr_val ( tcp , 0 , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] , tcp - > u_arg [ 3 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printflags ( xattrflags , tcp - > u_arg [ 4 ] , " XATTR_??? " ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_getxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
} else {
print_xattr_val ( tcp , syserror ( tcp ) , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ,
tcp - > u_rval ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_fgetxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
} else {
print_xattr_val ( tcp , syserror ( tcp ) , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ,
tcp - > u_rval ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_listxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
} else {
/* XXX Print value in format */
tprintf ( " , %p, %lu " , ( void * ) tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_flistxattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2009-04-14 12:51:00 +00:00
} else {
/* XXX Print value in format */
tprintf ( " , %p, %lu " , ( void * ) tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_removexattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
printpath ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
int
2009-04-14 12:51:00 +00:00
sys_fremovexattr ( struct tcb * tcp )
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-04-14 12:51:00 +00:00
printstr ( tcp , tcp - > u_arg [ 1 ] , - 1 ) ;
}
return 0 ;
2002-12-15 Roland McGrath <roland@redhat.com>
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
2002-12-15 23:58:23 +00:00
}
2004-10-07 18:51:19 +00:00
static const struct xlat advise [ ] = {
{ POSIX_FADV_NORMAL , " POSIX_FADV_NORMAL " } ,
{ POSIX_FADV_RANDOM , " POSIX_FADV_RANDOM " } ,
{ POSIX_FADV_SEQUENTIAL , " POSIX_FADV_SEQUENTIAL " } ,
{ POSIX_FADV_WILLNEED , " POSIX_FADV_WILLNEED " } ,
{ POSIX_FADV_DONTNEED , " POSIX_FADV_DONTNEED " } ,
{ POSIX_FADV_NOREUSE , " POSIX_FADV_NOREUSE " } ,
{ 0 , NULL }
} ;
2004-10-20 02:24:19 +00:00
# ifdef LINUX
2004-10-07 18:51:19 +00:00
int
2009-04-14 12:51:00 +00:00
sys_fadvise64 ( struct tcb * tcp )
2004-10-07 18:51:19 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
2009-11-04 17:08:34 +01:00
int argn ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-11-04 17:08:34 +01:00
argn = printllval ( tcp , " %lld " , 1 ) ;
tprintf ( " , %ld, " , tcp - > u_arg [ argn + + ] ) ;
printxval ( advise , tcp - > u_arg [ argn ] , " POSIX_FADV_??? " ) ;
2009-04-14 12:51:00 +00:00
}
return 0 ;
2004-10-07 18:51:19 +00:00
}
# endif
int
2009-04-14 12:51:00 +00:00
sys_fadvise64_64 ( struct tcb * tcp )
2004-10-07 18:51:19 +00:00
{
2009-04-14 12:51:00 +00:00
if ( entering ( tcp ) ) {
2009-11-04 17:08:34 +01:00
int argn ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2009-11-04 17:08:34 +01:00
# if defined ARM || defined POWERPC
argn = printllval ( tcp , " %lld, " , 2 ) ;
# else
argn = printllval ( tcp , " %lld, " , 1 ) ;
# endif
argn = printllval ( tcp , " %lld, " , argn ) ;
# if defined ARM || defined POWERPC
2009-09-19 03:21:33 +03:00
printxval ( advise , tcp - > u_arg [ 1 ] , " POSIX_FADV_??? " ) ;
2004-10-07 18:51:19 +00:00
# else
2009-11-04 17:08:34 +01:00
printxval ( advise , tcp - > u_arg [ argn ] , " POSIX_FADV_??? " ) ;
2004-10-07 18:51:19 +00:00
# endif
2009-04-14 12:51:00 +00:00
}
return 0 ;
2004-10-07 18:51:19 +00:00
}
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
# ifdef LINUX
static const struct xlat inotify_modes [ ] = {
2011-03-03 01:02:41 +00:00
{ 0x00000001 , " IN_ACCESS " } ,
{ 0x00000002 , " IN_MODIFY " } ,
{ 0x00000004 , " IN_ATTRIB " } ,
{ 0x00000008 , " IN_CLOSE_WRITE " } ,
{ 0x00000010 , " IN_CLOSE_NOWRITE " } ,
{ 0x00000020 , " IN_OPEN " } ,
{ 0x00000040 , " IN_MOVED_FROM " } ,
{ 0x00000080 , " IN_MOVED_TO " } ,
{ 0x00000100 , " IN_CREATE " } ,
{ 0x00000200 , " IN_DELETE " } ,
{ 0x00000400 , " IN_DELETE_SELF " } ,
{ 0x00000800 , " IN_MOVE_SELF " } ,
{ 0x00002000 , " IN_UNMOUNT " } ,
{ 0x00004000 , " IN_Q_OVERFLOW " } ,
{ 0x00008000 , " IN_IGNORED " } ,
{ 0x01000000 , " IN_ONLYDIR " } ,
{ 0x02000000 , " IN_DONT_FOLLOW " } ,
{ 0x20000000 , " IN_MASK_ADD " } ,
{ 0x40000000 , " IN_ISDIR " } ,
{ 0x80000000 , " IN_ONESHOT " } ,
{ 0 , NULL }
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
} ;
2011-03-03 00:50:55 +01:00
static const struct xlat inotify_init_flags [ ] = {
{ 0x00000800 , " IN_NONBLOCK " } ,
2011-06-07 12:13:24 +02:00
{ 0x00080000 , " IN_CLOEXEC " } ,
{ 0 , NULL }
2011-03-03 00:50:55 +01:00
} ;
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
int
sys_inotify_add_watch ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printpath ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
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
printflags ( inotify_modes , tcp - > u_arg [ 2 ] , " IN_??? " ) ;
}
return 0 ;
}
int
sys_inotify_rm_watch ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
tprintf ( " , %ld " , tcp - > u_arg [ 1 ] ) ;
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
}
return 0 ;
}
2008-05-20 04:56:18 +00:00
2010-03-21 14:41:26 +01:00
int
sys_inotify_init1 ( struct tcb * tcp )
{
if ( entering ( tcp ) )
2011-03-03 00:50:55 +01:00
printflags ( inotify_init_flags , tcp - > u_arg [ 0 ] , " IN_??? " ) ;
2010-03-21 14:41:26 +01:00
return 0 ;
}
2008-05-20 04:56:18 +00:00
int
sys_fallocate ( struct tcb * tcp )
{
if ( entering ( tcp ) ) {
2009-11-04 17:08:34 +01:00
int argn ;
Fix decoding of file descriptors
* 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>.
2011-03-04 05:08:02 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ; /* fd */
2011-09-01 10:00:28 +02:00
tprints ( " , " ) ;
2008-05-20 04:56:18 +00:00
tprintf ( " %#lo, " , tcp - > u_arg [ 1 ] ) ; /* mode */
2009-11-04 17:08:34 +01:00
argn = printllval ( tcp , " %llu, " , 2 ) ; /* offset */
printllval ( tcp , " %llu " , argn ) ; /* len */
2008-05-20 04:56:18 +00:00
}
return 0 ;
}
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
# endif