1999-02-19 03:21:36 +03:00
/*
* Copyright ( c ) 1993 , 1994 , 1995 , 1996 Rick Sladkey < jrs @ world . std . com >
1999-12-23 17:20:14 +03:00
* Copyright ( c ) 1996 - 1999 Wichert Akkerman < wichert @ cistron . nl >
1999-02-19 03:21:36 +03: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 .
*/
# include "defs.h"
2001-04-10 14:32:26 +04:00
# ifdef HAVE_POLL_H
2012-03-16 15:02:22 +04:00
# include <poll.h>
2001-04-10 14:32:26 +04:00
# endif
2000-02-01 19:12:33 +03:00
# ifdef HAVE_SYS_POLL_H
2012-03-16 15:02:22 +04:00
# include <sys / poll.h>
2000-02-01 19:12:33 +03:00
# endif
2001-04-10 14:32:26 +04:00
# ifdef HAVE_STROPTS_H
2012-03-16 15:02:22 +04:00
# include <stropts.h>
2001-04-10 14:32:26 +04:00
# endif
# ifdef HAVE_SYS_CONF_H
2012-03-16 15:02:22 +04:00
# include <sys / conf.h>
2001-04-10 14:32:26 +04:00
# endif
# ifndef HAVE_STROPTS_H
1999-02-19 03:21:36 +03:00
# define RS_HIPRI 1
struct strbuf {
2008-12-30 21:47:55 +03:00
int maxlen ; /* no. of bytes in buffer */
int len ; /* no. of bytes returned */
2010-09-07 02:08:24 +04:00
const char * buf ; /* pointer to data */
1999-02-19 03:21:36 +03:00
} ;
# define MORECTL 1
# define MOREDATA 2
2001-04-10 14:32:26 +04:00
# endif /* !HAVE_STROPTS_H */
1999-02-19 03:21:36 +03:00
2004-09-04 07:39:20 +04:00
static const struct xlat msgflags [ ] = {
1999-02-19 03:21:36 +03:00
{ RS_HIPRI , " RS_HIPRI " } ,
{ 0 , NULL } ,
} ;
static void
2011-05-30 16:00:14 +04:00
printstrbuf ( struct tcb * tcp , struct strbuf * sbp , int getting )
1999-02-19 03:21:36 +03:00
{
if ( sbp - > maxlen = = - 1 & & getting )
2011-09-01 12:00:28 +04:00
tprints ( " {maxlen=-1} " ) ;
1999-02-19 03:21:36 +03:00
else {
2011-09-01 12:00:28 +04:00
tprints ( " { " ) ;
1999-02-19 03:21:36 +03:00
if ( getting )
tprintf ( " maxlen=%d, " , sbp - > maxlen ) ;
tprintf ( " len=%d, buf= " , sbp - > len ) ;
1999-05-09 04:29:58 +04:00
printstr ( tcp , ( unsigned long ) sbp - > buf , sbp - > len ) ;
2011-09-01 12:00:28 +04:00
tprints ( " } " ) ;
1999-02-19 03:21:36 +03:00
}
}
static void
2011-05-30 16:00:14 +04:00
printstrbufarg ( struct tcb * tcp , int arg , int getting )
1999-02-19 03:21:36 +03:00
{
struct strbuf buf ;
if ( arg = = 0 )
2011-09-01 12:00:28 +04:00
tprints ( " NULL " ) ;
1999-02-19 03:21:36 +03:00
else if ( umove ( tcp , arg , & buf ) < 0 )
2011-09-01 12:00:28 +04:00
tprints ( " {...} " ) ;
1999-02-19 03:21:36 +03:00
else
printstrbuf ( tcp , & buf , getting ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
1999-02-19 03:21:36 +03:00
}
int
2011-05-30 16:00:14 +04:00
sys_putmsg ( struct tcb * tcp )
1999-02-19 03:21:36 +03:00
{
int i ;
if ( entering ( tcp ) ) {
/* fd */
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
/* control and data */
for ( i = 1 ; i < 3 ; i + + )
printstrbufarg ( tcp , tcp - > u_arg [ i ] , 0 ) ;
/* 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 23:02:36 +04:00
printflags ( msgflags , tcp - > u_arg [ 3 ] , " RS_??? " ) ;
1999-02-19 03:21:36 +03:00
}
return 0 ;
}
2012-02-25 05:38:52 +04:00
# if defined(SPARC) || defined(SPARC64)
1999-02-19 03:21:36 +03:00
int
2011-05-30 16:00:14 +04:00
sys_getmsg ( struct tcb * tcp )
1999-02-19 03:21:36 +03:00
{
int i , flags ;
if ( entering ( tcp ) ) {
/* fd */
tprintf ( " %lu, " , tcp - > u_arg [ 0 ] ) ;
} else {
if ( syserror ( tcp ) ) {
tprintf ( " %#lx, %#lx, %#lx " ,
tcp - > u_arg [ 1 ] , tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] ) ;
return 0 ;
}
/* control and data */
for ( i = 1 ; i < 3 ; i + + )
printstrbufarg ( tcp , tcp - > u_arg [ i ] , 1 ) ;
/* pointer to flags */
if ( tcp - > u_arg [ 3 ] = = 0 )
2011-09-01 12:00:28 +04:00
tprints ( " NULL " ) ;
1999-02-19 03:21:36 +03:00
else if ( umove ( tcp , tcp - > u_arg [ 3 ] , & flags ) < 0 )
2011-09-01 12:00:28 +04:00
tprints ( " [?] " ) ;
1999-02-19 03:21:36 +03:00
else {
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 ( msgflags , flags , " RS_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " ] " ) ;
1999-02-19 03:21:36 +03:00
}
/* decode return value */
switch ( tcp - > u_rval ) {
case MORECTL :
tcp - > auxstr = " MORECTL " ;
break ;
case MORECTL | MOREDATA :
tcp - > auxstr = " MORECTL|MOREDATA " ;
break ;
case MOREDATA :
tcp - > auxstr = " MORECTL " ;
break ;
default :
tcp - > auxstr = NULL ;
break ;
}
}
return RVAL_HEX | RVAL_STR ;
}
2012-02-25 05:38:52 +04:00
# endif
1999-02-19 03:21:36 +03:00
2002-12-16 23:40:59 +03:00
# if defined SYS_putpmsg || defined SYS_getpmsg
2004-09-04 07:39:20 +04:00
static const struct xlat pmsgflags [ ] = {
2000-10-13 16:47:12 +04:00
# ifdef MSG_HIPRI
1999-02-19 03:21:36 +03:00
{ MSG_HIPRI , " MSG_HIPRI " } ,
2000-10-13 16:47:12 +04:00
# endif
# ifdef MSG_AND
1999-02-19 03:21:36 +03:00
{ MSG_ANY , " MSG_ANY " } ,
2000-10-13 16:47:12 +04:00
# endif
# ifdef MSG_BAND
1999-02-19 03:21:36 +03:00
{ MSG_BAND , " MSG_BAND " } ,
2000-10-13 16:47:12 +04:00
# endif
1999-02-19 03:21:36 +03:00
{ 0 , NULL } ,
} ;
2002-12-16 23:40:59 +03:00
# endif
1999-02-19 03:21:36 +03:00
2002-12-16 23:40:59 +03:00
# ifdef SYS_putpmsg
1999-02-19 03:21:36 +03:00
int
2011-05-30 16:00:14 +04:00
sys_putpmsg ( struct tcb * tcp )
1999-02-19 03:21:36 +03:00
{
int i ;
if ( entering ( tcp ) ) {
/* fd */
tprintf ( " %ld, " , tcp - > u_arg [ 0 ] ) ;
/* control and data */
for ( i = 1 ; i < 3 ; i + + )
printstrbufarg ( tcp , tcp - > u_arg [ i ] , 0 ) ;
/* band */
tprintf ( " %ld, " , tcp - > u_arg [ 3 ] ) ;
/* 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 23:02:36 +04:00
printflags ( pmsgflags , tcp - > u_arg [ 4 ] , " MSG_??? " ) ;
1999-02-19 03:21:36 +03:00
}
return 0 ;
}
2002-12-16 23:40:59 +03:00
# endif /* SYS_putpmsg */
1999-02-19 03:21:36 +03:00
2002-12-16 23:40:59 +03:00
# ifdef SYS_getpmsg
1999-02-19 03:21:36 +03:00
int
2011-05-30 16:00:14 +04:00
sys_getpmsg ( struct tcb * tcp )
1999-02-19 03:21:36 +03:00
{
int i , flags ;
if ( entering ( tcp ) ) {
/* fd */
tprintf ( " %lu, " , tcp - > u_arg [ 0 ] ) ;
} else {
if ( syserror ( tcp ) ) {
tprintf ( " %#lx, %#lx, %#lx, %#lx " , tcp - > u_arg [ 1 ] ,
tcp - > u_arg [ 2 ] , tcp - > u_arg [ 3 ] , tcp - > u_arg [ 4 ] ) ;
return 0 ;
}
/* control and data */
for ( i = 1 ; i < 3 ; i + + )
printstrbufarg ( tcp , tcp - > u_arg [ i ] , 1 ) ;
/* pointer to band */
printnum ( tcp , tcp - > u_arg [ 3 ] , " %d " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
1999-02-19 03:21:36 +03:00
/* pointer to flags */
if ( tcp - > u_arg [ 4 ] = = 0 )
2011-09-01 12:00:28 +04:00
tprints ( " NULL " ) ;
1999-02-19 03:21:36 +03:00
else if ( umove ( tcp , tcp - > u_arg [ 4 ] , & flags ) < 0 )
2011-09-01 12:00:28 +04:00
tprints ( " [?] " ) ;
1999-02-19 03:21:36 +03:00
else {
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 ( pmsgflags , flags , " MSG_??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " ] " ) ;
1999-02-19 03:21:36 +03:00
}
/* decode return value */
switch ( tcp - > u_rval ) {
case MORECTL :
tcp - > auxstr = " MORECTL " ;
break ;
case MORECTL | MOREDATA :
tcp - > auxstr = " MORECTL|MOREDATA " ;
break ;
case MOREDATA :
tcp - > auxstr = " MORECTL " ;
break ;
default :
tcp - > auxstr = NULL ;
break ;
}
}
return RVAL_HEX | RVAL_STR ;
}
2002-12-16 23:40:59 +03:00
# endif /* SYS_getpmsg */
1999-02-19 03:21:36 +03:00
2000-02-20 02:59:03 +03:00
# ifdef HAVE_SYS_POLL_H
2004-09-04 07:39:20 +04:00
static const struct xlat pollflags [ ] = {
2000-02-01 19:12:33 +03:00
# ifdef POLLIN
1999-02-19 03:21:36 +03:00
{ POLLIN , " POLLIN " } ,
{ POLLPRI , " POLLPRI " } ,
{ POLLOUT , " POLLOUT " } ,
# ifdef POLLRDNORM
{ POLLRDNORM , " POLLRDNORM " } ,
# endif
# ifdef POLLWRNORM
{ POLLWRNORM , " POLLWRNORM " } ,
# endif
# ifdef POLLRDBAND
{ POLLRDBAND , " POLLRDBAND " } ,
# endif
# ifdef POLLWRBAND
{ POLLWRBAND , " POLLWRBAND " } ,
# endif
{ POLLERR , " POLLERR " } ,
{ POLLHUP , " POLLHUP " } ,
{ POLLNVAL , " POLLNVAL " } ,
2000-02-01 19:12:33 +03:00
# endif
1999-02-19 03:21:36 +03:00
{ 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-14 00:25:12 +04:00
static int
2007-11-02 00:49:49 +03:00
decode_poll ( struct tcb * tcp , long pts )
1999-02-19 03:21:36 +03:00
{
2005-06-01 23:22:06 +04:00
struct pollfd fds ;
unsigned nfds ;
unsigned long size , start , cur , end , abbrev_end ;
int failed = 0 ;
1999-02-19 03:21:36 +03:00
2007-11-02 00:49:49 +03:00
if ( entering ( tcp ) ) {
nfds = tcp - > u_arg [ 1 ] ;
size = sizeof ( fds ) * nfds ;
start = tcp - > u_arg [ 0 ] ;
end = start + size ;
if ( nfds = = 0 | | size / sizeof ( fds ) ! = nfds | | end < start ) {
tprintf ( " %#lx, %d, " ,
tcp - > u_arg [ 0 ] , nfds ) ;
return 0 ;
}
if ( abbrev ( tcp ) ) {
abbrev_end = start + max_strlen * sizeof ( fds ) ;
if ( abbrev_end < start )
abbrev_end = end ;
} else {
2005-06-01 23:22:06 +04:00
abbrev_end = end ;
2007-11-02 00:49:49 +03:00
}
2011-09-01 12:00:28 +04:00
tprints ( " [ " ) ;
2007-11-02 00:49:49 +03:00
for ( cur = start ; cur < end ; cur + = sizeof ( fds ) ) {
if ( cur > start )
2011-09-01 12:00:28 +04:00
tprints ( " , " ) ;
2007-11-02 00:49:49 +03:00
if ( cur > = abbrev_end ) {
2011-09-01 12:00:28 +04:00
tprints ( " ... " ) ;
2007-11-02 00:49:49 +03:00
break ;
}
if ( umoven ( tcp , cur , sizeof fds , ( char * ) & fds ) < 0 ) {
2011-09-01 12:00:28 +04:00
tprints ( " ? " ) ;
2007-11-02 00:49:49 +03:00
failed = 1 ;
break ;
}
if ( fds . fd < 0 ) {
tprintf ( " {fd=%d} " , fds . fd ) ;
continue ;
}
2011-09-01 12:00:28 +04:00
tprints ( " {fd= " ) ;
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 , fds . fd ) ;
2011-09-01 12:00:28 +04:00
tprints ( " , events= " ) ;
2007-11-02 00:49:49 +03:00
printflags ( pollflags , fds . events , " POLL??? " ) ;
2011-09-01 12:00:28 +04:00
tprints ( " } " ) ;
2007-11-02 00:49:49 +03:00
}
2011-09-01 12:00:28 +04:00
tprints ( " ] " ) ;
2007-11-02 00:49:49 +03:00
if ( failed )
tprintf ( " %#lx " , start ) ;
tprintf ( " , %d, " , nfds ) ;
return 0 ;
2005-06-01 23:22:06 +04:00
} else {
2007-11-02 00:49:49 +03:00
static char outstr [ 1024 ] ;
2011-08-31 14:26:03 +04:00
char * outptr ;
# define end_outstr (outstr + sizeof(outstr))
2008-12-30 21:47:55 +03:00
const char * flagstr ;
2007-11-02 00:49:49 +03:00
if ( syserror ( tcp ) )
return 0 ;
if ( tcp - > u_rval = = 0 ) {
tcp - > auxstr = " Timeout " ;
return RVAL_STR ;
1999-02-19 03:21:36 +03:00
}
2007-11-02 00:49:49 +03:00
nfds = tcp - > u_arg [ 1 ] ;
size = sizeof ( fds ) * nfds ;
start = tcp - > u_arg [ 0 ] ;
end = start + size ;
if ( nfds = = 0 | | size / sizeof ( fds ) ! = nfds | | end < start )
return 0 ;
if ( abbrev ( tcp ) ) {
abbrev_end = start + max_strlen * sizeof ( fds ) ;
if ( abbrev_end < start )
abbrev_end = end ;
} else {
abbrev_end = end ;
1999-02-19 03:21:36 +03:00
}
2007-11-02 00:49:49 +03:00
2011-08-31 14:26:03 +04:00
outptr = outstr ;
2007-11-02 00:49:49 +03:00
for ( cur = start ; cur < end ; cur + = sizeof ( fds ) ) {
if ( umoven ( tcp , cur , sizeof fds , ( char * ) & fds ) < 0 ) {
2011-08-31 14:26:03 +04:00
if ( outptr < end_outstr - 2 )
* outptr + + = ' ? ' ;
2007-11-02 00:49:49 +03:00
failed = 1 ;
break ;
}
if ( ! fds . revents )
continue ;
2011-08-31 14:26:03 +04:00
if ( outptr = = outstr ) {
* outptr + + = ' [ ' ;
2007-11-02 00:49:49 +03:00
} else {
2011-08-31 14:26:03 +04:00
if ( outptr < end_outstr - 3 )
outptr = stpcpy ( outptr , " , " ) ;
2007-11-02 00:49:49 +03:00
}
if ( cur > = abbrev_end ) {
2011-08-31 14:26:03 +04:00
if ( outptr < end_outstr - 4 )
outptr = stpcpy ( outptr , " ... " ) ;
2007-11-02 00:49:49 +03:00
break ;
}
2011-08-31 14:26:03 +04:00
if ( outptr < end_outstr - ( sizeof ( " {fd=%d, revents= " ) + sizeof ( int ) * 3 ) + 1 )
outptr + = sprintf ( outptr , " {fd=%d, revents= " , fds . fd ) ;
2011-06-07 14:13:24 +04:00
flagstr = sprintflags ( " " , pollflags , fds . revents ) ;
2011-08-31 14:26:03 +04:00
if ( outptr < end_outstr - ( strlen ( flagstr ) + 2 ) ) {
outptr = stpcpy ( outptr , flagstr ) ;
* outptr + + = ' } ' ;
2007-11-02 00:49:49 +03:00
}
1999-02-19 03:21:36 +03:00
}
2007-11-02 00:49:49 +03:00
if ( failed )
return 0 ;
2011-08-31 14:26:03 +04:00
if ( outptr ! = outstr /* && outptr < end_outstr - 1 (always true)*/ )
* outptr + + = ' ] ' ;
2007-11-02 00:49:49 +03:00
2011-08-31 14:26:03 +04:00
* outptr = ' \0 ' ;
2007-11-02 00:49:49 +03:00
if ( pts ) {
2012-01-20 14:04:04 +04:00
if ( outptr < end_outstr - ( 10 + TIMESPEC_TEXT_BUFSIZE ) ) {
2011-08-31 14:26:03 +04:00
outptr = stpcpy ( outptr , outptr = = outstr ? " left " : " , left " ) ;
sprint_timespec ( outptr , tcp , pts ) ;
}
1999-02-19 03:21:36 +03:00
}
2007-11-02 00:49:49 +03:00
2011-08-31 14:26:03 +04:00
if ( outptr = = outstr )
2007-11-02 00:49:49 +03:00
return 0 ;
tcp - > auxstr = outstr ;
return RVAL_STR ;
2011-08-31 14:26:03 +04:00
# undef end_outstr
2005-06-01 23:22:06 +04: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-14 00:25:12 +04:00
}
int
sys_poll ( struct tcb * tcp )
{
2007-11-02 00:49:49 +03:00
int rc = decode_poll ( tcp , 0 ) ;
if ( entering ( tcp ) ) {
1999-02-19 03:21:36 +03:00
# ifdef INFTIM
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-14 00:25:12 +04:00
if ( tcp - > u_arg [ 2 ] = = INFTIM )
2011-09-01 12:00:28 +04:00
tprints ( " INFTIM " ) ;
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-14 00:25:12 +04:00
else
1999-02-19 03:21:36 +03: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-14 00:25:12 +04:00
tprintf ( " %ld " , tcp - > u_arg [ 2 ] ) ;
}
return rc ;
1999-02-19 03:21:36 +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-14 00:25:12 +04:00
int
sys_ppoll ( struct tcb * tcp )
{
2007-11-02 00:49:49 +03:00
int rc = decode_poll ( tcp , tcp - > u_arg [ 2 ] ) ;
if ( entering ( tcp ) ) {
2007-11-02 00:50:54 +03:00
print_timespec ( tcp , tcp - > u_arg [ 2 ] ) ;
2011-09-01 12:00:28 +04: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-14 00:25:12 +04:00
print_sigset ( tcp , tcp - > u_arg [ 3 ] , 0 ) ;
tprintf ( " , %lu " , tcp - > u_arg [ 4 ] ) ;
}
return rc ;
}
2005-06-01 23:22:06 +04:00
2000-02-20 02:59:03 +03:00
# else /* !HAVE_SYS_POLL_H */
int
2011-05-30 16:00:14 +04:00
sys_poll ( struct tcb * tcp )
2000-02-20 02:59:03 +03:00
{
2009-02-27 23:32:52 +03:00
return 0 ;
2000-02-20 02:59:03 +03:00
}
# endif