1999-02-19 03:21:36 +03: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 >
* 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 .
*/
# include "defs.h"
2014-12-31 03:08:50 +03:00
# include <fcntl.h>
2015-07-18 02:56:54 +03:00
# include <signal.h>
2000-10-13 16:47:12 +04:00
# include <sys/timex.h>
2007-07-24 05:57:11 +04:00
2015-09-18 19:15:49 +03:00
static void
print_timezone ( struct tcb * tcp , const long addr )
{
struct timezone tz ;
if ( umove_or_printaddr ( tcp , addr , & tz ) )
return ;
tprintf ( " {tz_minuteswest=%d, tz_dsttime=%d} " ,
tz . tz_minuteswest , tz . tz_dsttime ) ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( gettimeofday )
1999-02-19 03:21:36 +03:00
{
if ( exiting ( tcp ) ) {
2015-09-18 18:16:11 +03:00
print_timeval ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-18 19:15:49 +03:00
print_timezone ( tcp , tcp - > u_arg [ 1 ] ) ;
1999-02-19 03:21:36 +03:00
}
return 0 ;
}
1999-11-18 20:09:47 +03:00
# ifdef ALPHA
2015-04-07 04:36:50 +03:00
SYS_FUNC ( osf_gettimeofday )
1999-11-18 20:09:47 +03:00
{
2009-04-14 16:51:00 +04:00
if ( exiting ( tcp ) ) {
2015-09-18 18:16:11 +03:00
print_timeval32 ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-18 19:15:49 +03:00
print_timezone ( tcp , tcp - > u_arg [ 1 ] ) ;
2009-04-14 16:51:00 +04:00
}
return 0 ;
1999-11-18 20:09:47 +03:00
}
# endif
2015-04-07 04:36:50 +03:00
SYS_FUNC ( settimeofday )
1999-02-19 03:21:36 +03:00
{
2015-09-18 18:16:11 +03:00
print_timeval ( tcp , tcp - > u_arg [ 0 ] ) ;
2015-07-17 00:07:06 +03:00
tprints ( " , " ) ;
2015-09-18 19:15:49 +03:00
print_timezone ( tcp , tcp - > u_arg [ 1 ] ) ;
2015-07-17 00:07:06 +03:00
return RVAL_DECODED ;
1999-02-19 03:21:36 +03:00
}
1999-11-18 20:09:47 +03:00
# ifdef ALPHA
2015-04-07 04:36:50 +03:00
SYS_FUNC ( osf_settimeofday )
1999-11-18 20:09:47 +03:00
{
2015-09-18 18:16:11 +03:00
print_timeval32 ( tcp , tcp - > u_arg [ 0 ] ) ;
2015-07-17 00:07:06 +03:00
tprints ( " , " ) ;
2015-09-18 19:15:49 +03:00
print_timezone ( tcp , tcp - > u_arg [ 1 ] ) ;
2015-07-17 00:07:06 +03:00
return RVAL_DECODED ;
1999-11-18 20:09:47 +03:00
}
# endif
2015-04-07 04:36:50 +03:00
SYS_FUNC ( nanosleep )
2008-09-03 05:02:46 +04:00
{
if ( entering ( tcp ) ) {
print_timespec ( tcp , tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2008-09-03 05:02:46 +04:00
} else {
2015-09-18 04:54:59 +03:00
/*
* Second ( returned ) timespec is only significant if syscall
* was interrupted . On success and in case of other errors we
* print only its address , since kernel doesn ' t modify it ,
2013-07-01 01:53:49 +04:00
* and printing the value may show uninitialized data .
2012-01-28 05:29:36 +04:00
*/
2015-09-18 04:54:59 +03:00
if ( is_erestart ( tcp ) ) {
temporarily_clear_syserror ( tcp ) ;
2008-09-03 05:02:46 +04:00
print_timespec ( tcp , tcp - > u_arg [ 1 ] ) ;
2015-09-18 04:54:59 +03:00
restore_cleared_syserror ( tcp ) ;
} else {
printaddr ( tcp - > u_arg [ 1 ] ) ;
2013-07-01 01:53:49 +04:00
}
2008-09-03 05:02:46 +04:00
}
return 0 ;
}
2014-04-26 03:30:54 +04:00
# include "xlat/itimer_which.h"
1999-02-19 03:21:36 +03:00
2015-04-07 04:36:50 +03:00
SYS_FUNC ( getitimer )
1999-02-19 03:21:36 +03:00
{
if ( entering ( tcp ) ) {
2014-04-26 03:39:20 +04:00
printxval ( itimer_which , tcp - > u_arg [ 0 ] , " ITIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
1999-02-19 03:21:36 +03:00
} else {
2015-09-17 23:23:31 +03:00
print_itimerval ( tcp , tcp - > u_arg [ 1 ] ) ;
1999-02-19 03:21:36 +03:00
}
return 0 ;
}
1999-11-18 20:09:47 +03:00
# ifdef ALPHA
2015-04-07 04:36:50 +03:00
SYS_FUNC ( osf_getitimer )
1999-11-18 20:09:47 +03:00
{
2009-04-14 16:51:00 +04:00
if ( entering ( tcp ) ) {
2014-04-26 03:39:20 +04:00
printxval ( itimer_which , tcp - > u_arg [ 0 ] , " ITIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2009-04-14 16:51:00 +04:00
} else {
2015-09-17 23:23:31 +03:00
print_itimerval32 ( tcp , tcp - > u_arg [ 1 ] ) ;
2009-04-14 16:51:00 +04:00
}
return 0 ;
1999-11-18 20:09:47 +03:00
}
# endif
2015-04-07 04:36:50 +03:00
SYS_FUNC ( setitimer )
1999-02-19 03:21:36 +03:00
{
if ( entering ( tcp ) ) {
2014-04-26 03:39:20 +04:00
printxval ( itimer_which , tcp - > u_arg [ 0 ] , " ITIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-17 23:23:31 +03:00
print_itimerval ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
1999-02-19 03:21:36 +03:00
} else {
2015-09-17 23:23:31 +03:00
print_itimerval ( tcp , tcp - > u_arg [ 2 ] ) ;
1999-02-19 03:21:36 +03:00
}
return 0 ;
}
1999-11-18 20:09:47 +03:00
# ifdef ALPHA
2015-04-07 04:36:50 +03:00
SYS_FUNC ( osf_setitimer )
1999-11-18 20:09:47 +03:00
{
2009-04-14 16:51:00 +04:00
if ( entering ( tcp ) ) {
2014-04-26 03:39:20 +04:00
printxval ( itimer_which , tcp - > u_arg [ 0 ] , " ITIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-17 23:23:31 +03:00
print_itimerval32 ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2009-04-14 16:51:00 +04:00
} else {
2015-09-17 23:23:31 +03:00
print_itimerval32 ( tcp , tcp - > u_arg [ 2 ] ) ;
2009-04-14 16:51:00 +04:00
}
return 0 ;
1999-11-18 20:09:47 +03:00
}
# endif
2014-04-26 03:30:54 +04:00
# include "xlat/adjtimex_state.h"
2006-12-13 20:42:32 +03:00
2012-03-12 01:25:51 +04:00
static int
do_adjtimex ( struct tcb * tcp , long addr )
{
2015-09-17 00:58:36 +03:00
if ( print_timex ( tcp , addr ) )
2012-03-12 01:25:51 +04:00
return 0 ;
2016-05-15 00:46:05 +03:00
tcp - > auxstr = xlookup ( adjtimex_state , ( unsigned long ) tcp - > u_rval ) ;
2012-03-12 01:25:51 +04:00
if ( tcp - > auxstr )
return RVAL_STR ;
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( adjtimex )
2006-12-13 20:43:45 +03:00
{
2012-03-12 01:25:51 +04:00
if ( exiting ( tcp ) )
return do_adjtimex ( tcp , tcp - > u_arg [ 0 ] ) ;
1999-02-19 03:21:36 +03:00
return 0 ;
}
2003-03-31 03:52:28 +04:00
2014-04-26 03:30:54 +04:00
# include "xlat/clockflags.h"
# include "xlat/clocknames.h"
2004-08-31 10:52:45 +04:00
2014-02-03 13:01:27 +04:00
static void
printclockname ( int clockid )
{
# ifdef CLOCKID_TO_FD
2014-04-26 22:10:19 +04:00
# include "xlat / cpuclocknames.h"
2014-02-03 13:01:27 +04:00
if ( clockid < 0 ) {
if ( ( clockid & CLOCKFD_MASK ) = = CLOCKFD )
tprintf ( " FD_TO_CLOCKID(%d) " , CLOCKID_TO_FD ( clockid ) ) ;
else {
if ( CPUCLOCK_PERTHREAD ( clockid ) )
tprintf ( " MAKE_THREAD_CPUCLOCK(%d, " , CPUCLOCK_PID ( clockid ) ) ;
else
tprintf ( " MAKE_PROCESS_CPUCLOCK(%d, " , CPUCLOCK_PID ( clockid ) ) ;
printxval ( cpuclocknames , clockid & CLOCKFD_MASK , " CPUCLOCK_??? " ) ;
tprints ( " ) " ) ;
}
}
else
# endif
printxval ( clocknames , clockid , " CLOCK_??? " ) ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( clock_settime )
2003-03-31 03:52:28 +04:00
{
2015-07-17 00:07:06 +03:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
tprints ( " , " ) ;
2015-09-18 18:16:11 +03:00
print_timespec ( tcp , tcp - > u_arg [ 1 ] ) ;
2015-07-17 00:07:06 +03:00
return RVAL_DECODED ;
2003-03-31 03:52:28 +04:00
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( clock_gettime )
2003-03-31 03:52:28 +04:00
{
if ( entering ( tcp ) ) {
2014-02-03 13:01:27 +04:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2003-03-31 03:52:28 +04:00
} else {
2015-09-18 18:16:11 +03:00
print_timespec ( tcp , tcp - > u_arg [ 1 ] ) ;
2003-03-31 03:52:28 +04:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( clock_nanosleep )
2003-03-31 03:52:28 +04:00
{
if ( entering ( tcp ) ) {
2014-02-03 13:01:27 +04:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04: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 23:02:36 +04:00
printflags ( clockflags , tcp - > u_arg [ 1 ] , " TIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-18 18:16:11 +03:00
print_timespec ( tcp , tcp - > u_arg [ 2 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2003-03-31 03:52:28 +04:00
} else {
2015-09-18 17:24:51 +03:00
/*
* Second ( returned ) timespec is only significant
* if syscall was interrupted and flags is not TIMER_ABSTIME .
*/
if ( ! tcp - > u_arg [ 1 ] & & is_erestart ( tcp ) ) {
temporarily_clear_syserror ( tcp ) ;
2015-09-18 18:16:11 +03:00
print_timespec ( tcp , tcp - > u_arg [ 3 ] ) ;
2015-09-18 17:24:51 +03:00
restore_cleared_syserror ( tcp ) ;
} else {
printaddr ( tcp - > u_arg [ 3 ] ) ;
}
2003-03-31 03:52:28 +04:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( clock_adjtime )
2012-03-12 01:25:51 +04:00
{
if ( exiting ( tcp ) )
return do_adjtimex ( tcp , tcp - > u_arg [ 1 ] ) ;
2014-02-03 13:01:27 +04:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
2012-03-12 01:25:51 +04:00
tprints ( " , " ) ;
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timer_create )
2003-03-31 03:52:28 +04:00
{
if ( entering ( tcp ) ) {
2014-02-03 13:01:27 +04:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-16 19:31:43 +03:00
print_sigevent ( tcp , tcp - > u_arg [ 1 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2003-03-31 03:52:28 +04:00
} else {
time.c: use printaddr, printnum_int, and umoven_or_printaddr
* time.c (sys_nanosleep): Use printaddr.
(printitv_bitness, tprint_timex32, tprint_timex, printsigevent32,
printsigevent): Use umoven_or_printaddr.
(sys_timer_create): Use printnum_int.
(sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer,
do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove
redundant checks for syserror.
2015-07-16 21:18:09 +03:00
printnum_int ( tcp , tcp - > u_arg [ 2 ] , " %d " ) ;
2003-03-31 03:52:28 +04:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timer_settime )
2003-03-31 03:52:28 +04:00
{
if ( entering ( tcp ) ) {
time.c: use printaddr, printnum_int, and umoven_or_printaddr
* time.c (sys_nanosleep): Use printaddr.
(printitv_bitness, tprint_timex32, tprint_timex, printsigevent32,
printsigevent): Use umoven_or_printaddr.
(sys_timer_create): Use printnum_int.
(sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer,
do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove
redundant checks for syserror.
2015-07-16 21:18:09 +03:00
tprintf ( " %d, " , ( int ) 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 23:02:36 +04:00
printflags ( clockflags , tcp - > u_arg [ 1 ] , " TIMER_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 2 ] ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2003-03-31 03:52:28 +04:00
} else {
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 3 ] ) ;
2003-03-31 03:52:28 +04:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timer_gettime )
2003-03-31 03:52:28 +04:00
{
if ( entering ( tcp ) ) {
time.c: use printaddr, printnum_int, and umoven_or_printaddr
* time.c (sys_nanosleep): Use printaddr.
(printitv_bitness, tprint_timex32, tprint_timex, printsigevent32,
printsigevent): Use umoven_or_printaddr.
(sys_timer_create): Use printnum_int.
(sys_getitimer, sys_osf_getitimer, sys_setitimer, sys_osf_setitimer,
do_adjtimex, sys_timer_settime, sys_timer_gettime): Remove
redundant checks for syserror.
2015-07-16 21:18:09 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
2003-03-31 03:52:28 +04:00
} else {
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 1 ] ) ;
2003-03-31 03:52:28 +04:00
}
return 0 ;
}
2004-10-07 02:27:43 +04:00
2014-04-26 03:30:54 +04:00
# include "xlat/timerfdflags.h"
2007-08-02 05:25:34 +04:00
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timerfd_create )
2008-05-20 08:56:13 +04:00
{
2015-07-17 00:07:06 +03:00
printclockname ( tcp - > u_arg [ 0 ] ) ;
tprints ( " , " ) ;
printflags ( timerfdflags , tcp - > u_arg [ 1 ] , " TFD_??? " ) ;
2015-08-02 04:37:19 +03:00
return RVAL_DECODED | RVAL_FD ;
2008-05-20 08:56:13 +04:00
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timerfd_settime )
2008-05-20 08:56:13 +04:00
{
2015-07-17 00:07:06 +03:00
printfd ( tcp , tcp - > u_arg [ 0 ] ) ;
tprints ( " , " ) ;
printflags ( timerfdflags , tcp - > u_arg [ 1 ] , " TFD_??? " ) ;
tprints ( " , " ) ;
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 2 ] ) ;
2015-07-17 00:07:06 +03:00
tprints ( " , " ) ;
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 3 ] ) ;
2015-07-17 00:07:06 +03:00
return RVAL_DECODED ;
2008-05-20 08:56:13 +04:00
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( timerfd_gettime )
2008-05-20 08:56:13 +04: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 12:00:28 +04:00
tprints ( " , " ) ;
2015-07-17 00:07:06 +03:00
} else {
2015-09-17 19:47:03 +03:00
print_itimerspec ( tcp , tcp - > u_arg [ 1 ] ) ;
2008-05-20 08:56:13 +04:00
}
return 0 ;
}