6 #include <sys/select.h>
20 void (*call
)(const struct syscallname
*,
21 abi_long
, abi_long
, abi_long
,
22 abi_long
, abi_long
, abi_long
);
23 void (*result
)(const struct syscallname
*, abi_long
);
28 * It is possible that target doesn't have syscall that uses
29 * following flags but we don't want the compiler to warn
30 * us about them being unused. Same applies to utility print
31 * functions. It is ok to keep them while not used.
33 #define UNUSED __attribute__ ((unused))
39 * Structure used to translate flag values into strings. This is
40 * similar that is in the actual strace tool.
43 abi_long f_value
; /* flag */
44 const char *f_string
; /* stringified flag */
47 /* common flags for all architectures */
48 #define FLAG_GENERIC(name) { name, #name }
49 /* target specific flags (syscall_defs.h has TARGET_<flag>) */
50 #define FLAG_TARGET(name) { TARGET_ ## name, #name }
51 /* end of flags array */
52 #define FLAG_END { 0, NULL }
54 UNUSED
static const char *get_comma(int);
55 UNUSED
static void print_pointer(abi_long
, int);
56 UNUSED
static void print_flags(const struct flags
*, abi_long
, int);
57 UNUSED
static void print_at_dirfd(abi_long
, int);
58 UNUSED
static void print_file_mode(abi_long
, int);
59 UNUSED
static void print_open_flags(abi_long
, int);
60 UNUSED
static void print_syscall_prologue(const struct syscallname
*);
61 UNUSED
static void print_syscall_epilogue(const struct syscallname
*);
62 UNUSED
static void print_string(abi_long
, int);
63 UNUSED
static void print_raw_param(const char *, abi_long
, int);
64 UNUSED
static void print_timeval(abi_ulong
, int);
65 UNUSED
static void print_number(abi_long
, int);
66 UNUSED
static void print_signal(abi_ulong
, int);
72 print_ipc_cmd(int cmd
)
74 #define output_cmd(val) \
82 /* General IPC commands */
83 output_cmd( IPC_RMID
);
84 output_cmd( IPC_SET
);
85 output_cmd( IPC_STAT
);
86 output_cmd( IPC_INFO
);
87 /* msgctl() commands */
89 output_cmd( MSG_STAT
);
90 output_cmd( MSG_INFO
);
92 /* shmctl() commands */
93 output_cmd( SHM_LOCK
);
94 output_cmd( SHM_UNLOCK
);
95 output_cmd( SHM_STAT
);
96 output_cmd( SHM_INFO
);
97 /* semctl() commands */
100 output_cmd( GETALL
);
101 output_cmd( GETNCNT
);
102 output_cmd( GETZCNT
);
103 output_cmd( SETVAL
);
104 output_cmd( SETALL
);
105 output_cmd( SEM_STAT
);
106 output_cmd( SEM_INFO
);
107 output_cmd( IPC_RMID
);
108 output_cmd( IPC_RMID
);
109 output_cmd( IPC_RMID
);
110 output_cmd( IPC_RMID
);
111 output_cmd( IPC_RMID
);
112 output_cmd( IPC_RMID
);
113 output_cmd( IPC_RMID
);
114 output_cmd( IPC_RMID
);
115 output_cmd( IPC_RMID
);
117 /* Some value we don't recognize */
122 print_signal(abi_ulong arg
, int last
)
124 const char *signal_name
= NULL
;
126 case TARGET_SIGHUP
: signal_name
= "SIGHUP"; break;
127 case TARGET_SIGINT
: signal_name
= "SIGINT"; break;
128 case TARGET_SIGQUIT
: signal_name
= "SIGQUIT"; break;
129 case TARGET_SIGILL
: signal_name
= "SIGILL"; break;
130 case TARGET_SIGABRT
: signal_name
= "SIGABRT"; break;
131 case TARGET_SIGFPE
: signal_name
= "SIGFPE"; break;
132 case TARGET_SIGKILL
: signal_name
= "SIGKILL"; break;
133 case TARGET_SIGSEGV
: signal_name
= "SIGSEGV"; break;
134 case TARGET_SIGPIPE
: signal_name
= "SIGPIPE"; break;
135 case TARGET_SIGALRM
: signal_name
= "SIGALRM"; break;
136 case TARGET_SIGTERM
: signal_name
= "SIGTERM"; break;
137 case TARGET_SIGUSR1
: signal_name
= "SIGUSR1"; break;
138 case TARGET_SIGUSR2
: signal_name
= "SIGUSR2"; break;
139 case TARGET_SIGCHLD
: signal_name
= "SIGCHLD"; break;
140 case TARGET_SIGCONT
: signal_name
= "SIGCONT"; break;
141 case TARGET_SIGSTOP
: signal_name
= "SIGSTOP"; break;
142 case TARGET_SIGTTIN
: signal_name
= "SIGTTIN"; break;
143 case TARGET_SIGTTOU
: signal_name
= "SIGTTOU"; break;
145 if (signal_name
== NULL
) {
146 print_raw_param("%ld", arg
, 1);
149 gemu_log("%s%s", signal_name
, get_comma(last
));
152 #ifdef TARGET_NR__newselect
154 print_fdset(int n
, abi_ulong target_fds_addr
)
159 if( target_fds_addr
) {
160 abi_long
*target_fds
;
162 target_fds
= lock_user(VERIFY_READ
,
164 sizeof(*target_fds
)*(n
/ TARGET_ABI_BITS
+ 1),
170 for (i
=n
; i
>=0; i
--) {
171 if ((tswapal(target_fds
[i
/ TARGET_ABI_BITS
]) >> (i
& (TARGET_ABI_BITS
- 1))) & 1)
174 unlock_user(target_fds
, target_fds_addr
, 0);
181 * Sysycall specific output functions
185 #ifdef TARGET_NR__newselect
186 static long newselect_arg1
= 0;
187 static long newselect_arg2
= 0;
188 static long newselect_arg3
= 0;
189 static long newselect_arg4
= 0;
190 static long newselect_arg5
= 0;
193 print_newselect(const struct syscallname
*name
,
194 abi_long arg1
, abi_long arg2
, abi_long arg3
,
195 abi_long arg4
, abi_long arg5
, abi_long arg6
)
197 gemu_log("%s(" TARGET_ABI_FMT_ld
",", name
->name
, arg1
);
198 print_fdset(arg1
, arg2
);
200 print_fdset(arg1
, arg3
);
202 print_fdset(arg1
, arg4
);
204 print_timeval(arg5
, 1);
207 /* save for use in the return output function below */
216 #ifdef TARGET_NR_semctl
218 print_semctl(const struct syscallname
*name
,
219 abi_long arg1
, abi_long arg2
, abi_long arg3
,
220 abi_long arg4
, abi_long arg5
, abi_long arg6
)
222 gemu_log("%s(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
",", name
->name
, arg1
, arg2
);
224 gemu_log(",0x" TARGET_ABI_FMT_lx
")", arg4
);
229 print_execve(const struct syscallname
*name
,
230 abi_long arg1
, abi_long arg2
, abi_long arg3
,
231 abi_long arg4
, abi_long arg5
, abi_long arg6
)
233 abi_ulong arg_ptr_addr
;
236 if (!(s
= lock_user_string(arg1
)))
238 gemu_log("%s(\"%s\",{", name
->name
, s
);
239 unlock_user(s
, arg1
, 0);
241 for (arg_ptr_addr
= arg2
; ; arg_ptr_addr
+= sizeof(abi_ulong
)) {
242 abi_ulong
*arg_ptr
, arg_addr
;
244 arg_ptr
= lock_user(VERIFY_READ
, arg_ptr_addr
, sizeof(abi_ulong
), 1);
247 arg_addr
= tswapal(*arg_ptr
);
248 unlock_user(arg_ptr
, arg_ptr_addr
, 0);
251 if ((s
= lock_user_string(arg_addr
))) {
252 gemu_log("\"%s\",", s
);
253 unlock_user(s
, arg_addr
, 0);
262 print_ipc(const struct syscallname
*name
,
263 abi_long arg1
, abi_long arg2
, abi_long arg3
,
264 abi_long arg4
, abi_long arg5
, abi_long arg6
)
268 gemu_log("semctl(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
",", arg1
, arg2
);
270 gemu_log(",0x" TARGET_ABI_FMT_lx
")", arg4
);
273 gemu_log("%s(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
")",
274 name
->name
, arg1
, arg2
, arg3
, arg4
);
280 * Variants for the return value output function
284 print_syscall_ret_addr(const struct syscallname
*name
, abi_long ret
)
289 errstr
= target_strerror(-ret
);
292 gemu_log(" = -1 errno=%d (%s)\n", (int)-ret
, errstr
);
294 gemu_log(" = 0x" TARGET_ABI_FMT_lx
"\n", ret
);
298 #if 0 /* currently unused */
300 print_syscall_ret_raw(struct syscallname
*name
, abi_long ret
)
302 gemu_log(" = 0x" TARGET_ABI_FMT_lx
"\n", ret
);
306 #ifdef TARGET_NR__newselect
308 print_syscall_ret_newselect(const struct syscallname
*name
, abi_long ret
)
310 gemu_log(" = 0x" TARGET_ABI_FMT_lx
" (", ret
);
311 print_fdset(newselect_arg1
,newselect_arg2
);
313 print_fdset(newselect_arg1
,newselect_arg3
);
315 print_fdset(newselect_arg1
,newselect_arg4
);
317 print_timeval(newselect_arg5
, 1);
322 UNUSED
static struct flags access_flags
[] = {
330 UNUSED
static struct flags at_file_flags
[] = {
332 FLAG_GENERIC(AT_EACCESS
),
334 #ifdef AT_SYMLINK_NOFOLLOW
335 FLAG_GENERIC(AT_SYMLINK_NOFOLLOW
),
340 UNUSED
static struct flags unlinkat_flags
[] = {
342 FLAG_GENERIC(AT_REMOVEDIR
),
347 UNUSED
static struct flags mode_flags
[] = {
348 FLAG_GENERIC(S_IFSOCK
),
349 FLAG_GENERIC(S_IFLNK
),
350 FLAG_GENERIC(S_IFREG
),
351 FLAG_GENERIC(S_IFBLK
),
352 FLAG_GENERIC(S_IFDIR
),
353 FLAG_GENERIC(S_IFCHR
),
354 FLAG_GENERIC(S_IFIFO
),
358 UNUSED
static struct flags open_access_flags
[] = {
359 FLAG_TARGET(O_RDONLY
),
360 FLAG_TARGET(O_WRONLY
),
365 UNUSED
static struct flags open_flags
[] = {
366 FLAG_TARGET(O_APPEND
),
367 FLAG_TARGET(O_CREAT
),
368 FLAG_TARGET(O_DIRECTORY
),
370 FLAG_TARGET(O_LARGEFILE
),
371 FLAG_TARGET(O_NOCTTY
),
372 FLAG_TARGET(O_NOFOLLOW
),
373 FLAG_TARGET(O_NONBLOCK
), /* also O_NDELAY */
375 FLAG_TARGET(O_TRUNC
),
377 FLAG_TARGET(O_DIRECT
),
382 UNUSED
static struct flags mount_flags
[] = {
384 FLAG_GENERIC(MS_BIND
),
387 FLAG_GENERIC(MS_DIRSYNC
),
389 FLAG_GENERIC(MS_MANDLOCK
),
391 FLAG_GENERIC(MS_MOVE
),
393 FLAG_GENERIC(MS_NOATIME
),
394 FLAG_GENERIC(MS_NODEV
),
395 FLAG_GENERIC(MS_NODIRATIME
),
396 FLAG_GENERIC(MS_NOEXEC
),
397 FLAG_GENERIC(MS_NOSUID
),
398 FLAG_GENERIC(MS_RDONLY
),
400 FLAG_GENERIC(MS_RELATIME
),
402 FLAG_GENERIC(MS_REMOUNT
),
403 FLAG_GENERIC(MS_SYNCHRONOUS
),
407 UNUSED
static struct flags umount2_flags
[] = {
409 FLAG_GENERIC(MNT_FORCE
),
412 FLAG_GENERIC(MNT_DETACH
),
415 FLAG_GENERIC(MNT_EXPIRE
),
420 UNUSED
static struct flags mmap_prot_flags
[] = {
421 FLAG_GENERIC(PROT_NONE
),
422 FLAG_GENERIC(PROT_EXEC
),
423 FLAG_GENERIC(PROT_READ
),
424 FLAG_GENERIC(PROT_WRITE
),
425 FLAG_TARGET(PROT_SEM
),
426 FLAG_GENERIC(PROT_GROWSDOWN
),
427 FLAG_GENERIC(PROT_GROWSUP
),
431 UNUSED
static struct flags mmap_flags
[] = {
432 FLAG_TARGET(MAP_SHARED
),
433 FLAG_TARGET(MAP_PRIVATE
),
434 FLAG_TARGET(MAP_ANONYMOUS
),
435 FLAG_TARGET(MAP_DENYWRITE
),
436 FLAG_TARGET(MAP_FIXED
),
437 FLAG_TARGET(MAP_GROWSDOWN
),
438 FLAG_TARGET(MAP_EXECUTABLE
),
440 FLAG_TARGET(MAP_LOCKED
),
443 FLAG_TARGET(MAP_NONBLOCK
),
445 FLAG_TARGET(MAP_NORESERVE
),
447 FLAG_TARGET(MAP_POPULATE
),
449 #ifdef TARGET_MAP_UNINITIALIZED
450 FLAG_TARGET(MAP_UNINITIALIZED
),
455 UNUSED
static struct flags fcntl_flags
[] = {
456 FLAG_TARGET(F_DUPFD
),
457 FLAG_TARGET(F_GETFD
),
458 FLAG_TARGET(F_SETFD
),
459 FLAG_TARGET(F_GETFL
),
460 FLAG_TARGET(F_SETFL
),
461 FLAG_TARGET(F_GETLK
),
462 FLAG_TARGET(F_SETLK
),
463 FLAG_TARGET(F_SETLKW
),
467 UNUSED
static struct flags clone_flags
[] = {
468 FLAG_GENERIC(CLONE_VM
),
469 FLAG_GENERIC(CLONE_FS
),
470 FLAG_GENERIC(CLONE_FILES
),
471 FLAG_GENERIC(CLONE_SIGHAND
),
472 FLAG_GENERIC(CLONE_PTRACE
),
473 FLAG_GENERIC(CLONE_VFORK
),
474 FLAG_GENERIC(CLONE_PARENT
),
475 FLAG_GENERIC(CLONE_THREAD
),
476 FLAG_GENERIC(CLONE_NEWNS
),
477 FLAG_GENERIC(CLONE_SYSVSEM
),
478 FLAG_GENERIC(CLONE_SETTLS
),
479 FLAG_GENERIC(CLONE_PARENT_SETTID
),
480 FLAG_GENERIC(CLONE_CHILD_CLEARTID
),
481 FLAG_GENERIC(CLONE_DETACHED
),
482 FLAG_GENERIC(CLONE_UNTRACED
),
483 FLAG_GENERIC(CLONE_CHILD_SETTID
),
484 #if defined(CLONE_NEWUTS)
485 FLAG_GENERIC(CLONE_NEWUTS
),
487 #if defined(CLONE_NEWIPC)
488 FLAG_GENERIC(CLONE_NEWIPC
),
490 #if defined(CLONE_NEWUSER)
491 FLAG_GENERIC(CLONE_NEWUSER
),
493 #if defined(CLONE_NEWPID)
494 FLAG_GENERIC(CLONE_NEWPID
),
496 #if defined(CLONE_NEWNET)
497 FLAG_GENERIC(CLONE_NEWNET
),
499 #if defined(CLONE_IO)
500 FLAG_GENERIC(CLONE_IO
),
506 * print_xxx utility functions. These are used to print syscall
507 * parameters in certain format. All of these have parameter
508 * named 'last'. This parameter is used to add comma to output
515 return ((last
) ? "" : ",");
519 print_flags(const struct flags
*f
, abi_long flags
, int last
)
521 const char *sep
= "";
524 if ((flags
== 0) && (f
->f_value
== 0)) {
525 gemu_log("%s%s", f
->f_string
, get_comma(last
));
528 for (n
= 0; f
->f_string
!= NULL
; f
++) {
529 if ((f
->f_value
!= 0) && ((flags
& f
->f_value
) == f
->f_value
)) {
530 gemu_log("%s%s", sep
, f
->f_string
);
531 flags
&= ~f
->f_value
;
538 /* print rest of the flags as numeric */
540 gemu_log("%s%#x%s", sep
, (unsigned int)flags
, get_comma(last
));
542 gemu_log("%s", get_comma(last
));
545 /* no string version of flags found, print them in hex then */
546 gemu_log("%#x%s", (unsigned int)flags
, get_comma(last
));
551 print_at_dirfd(abi_long dirfd
, int last
)
554 if (dirfd
== AT_FDCWD
) {
555 gemu_log("AT_FDCWD%s", get_comma(last
));
559 gemu_log("%d%s", (int)dirfd
, get_comma(last
));
563 print_file_mode(abi_long mode
, int last
)
565 const char *sep
= "";
566 const struct flags
*m
;
568 for (m
= &mode_flags
[0]; m
->f_string
!= NULL
; m
++) {
569 if ((m
->f_value
& mode
) == m
->f_value
) {
570 gemu_log("%s%s", m
->f_string
, sep
);
578 /* print rest of the mode as octal */
580 gemu_log("%s%#o", sep
, (unsigned int)mode
);
582 gemu_log("%s", get_comma(last
));
586 print_open_flags(abi_long flags
, int last
)
588 print_flags(open_access_flags
, flags
& TARGET_O_ACCMODE
, 1);
589 flags
&= ~TARGET_O_ACCMODE
;
591 gemu_log("%s", get_comma(last
));
595 print_flags(open_flags
, flags
, last
);
599 print_syscall_prologue(const struct syscallname
*sc
)
601 gemu_log("%s(", sc
->name
);
606 print_syscall_epilogue(const struct syscallname
*sc
)
613 print_string(abi_long addr
, int last
)
617 if ((s
= lock_user_string(addr
)) != NULL
) {
618 gemu_log("\"%s\"%s", s
, get_comma(last
));
619 unlock_user(s
, addr
, 0);
621 /* can't get string out of it, so print it as pointer */
622 print_pointer(addr
, last
);
627 * Prints out raw parameter using given format. Caller needs
628 * to do byte swapping if needed.
631 print_raw_param(const char *fmt
, abi_long param
, int last
)
635 (void) snprintf(format
, sizeof (format
), "%s%s", fmt
, get_comma(last
));
636 gemu_log(format
, param
);
640 print_pointer(abi_long p
, int last
)
643 gemu_log("NULL%s", get_comma(last
));
645 gemu_log("0x" TARGET_ABI_FMT_lx
"%s", p
, get_comma(last
));
649 * Reads 32-bit (int) number from guest address space from
650 * address 'addr' and prints it.
653 print_number(abi_long addr
, int last
)
656 gemu_log("NULL%s", get_comma(last
));
660 get_user_s32(num
, addr
);
661 gemu_log("[%d]%s", num
, get_comma(last
));
666 print_timeval(abi_ulong tv_addr
, int last
)
669 struct target_timeval
*tv
;
671 tv
= lock_user(VERIFY_READ
, tv_addr
, sizeof(*tv
), 1);
674 gemu_log("{" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"}%s",
675 tv
->tv_sec
, tv
->tv_usec
, get_comma(last
));
676 unlock_user(tv
, tv_addr
, 0);
678 gemu_log("NULL%s", get_comma(last
));
683 #ifdef TARGET_NR_accept
685 print_accept(const struct syscallname
*name
,
686 abi_long arg0
, abi_long arg1
, abi_long arg2
,
687 abi_long arg3
, abi_long arg4
, abi_long arg5
)
689 print_syscall_prologue(name
);
690 print_raw_param("%d", arg0
, 0);
691 print_pointer(arg1
, 0);
692 print_number(arg2
, 1);
693 print_syscall_epilogue(name
);
697 #ifdef TARGET_NR_access
699 print_access(const struct syscallname
*name
,
700 abi_long arg0
, abi_long arg1
, abi_long arg2
,
701 abi_long arg3
, abi_long arg4
, abi_long arg5
)
703 print_syscall_prologue(name
);
704 print_string(arg0
, 0);
705 print_flags(access_flags
, arg1
, 1);
706 print_syscall_epilogue(name
);
712 print_brk(const struct syscallname
*name
,
713 abi_long arg0
, abi_long arg1
, abi_long arg2
,
714 abi_long arg3
, abi_long arg4
, abi_long arg5
)
716 print_syscall_prologue(name
);
717 print_pointer(arg0
, 1);
718 print_syscall_epilogue(name
);
722 #ifdef TARGET_NR_chdir
724 print_chdir(const struct syscallname
*name
,
725 abi_long arg0
, abi_long arg1
, abi_long arg2
,
726 abi_long arg3
, abi_long arg4
, abi_long arg5
)
728 print_syscall_prologue(name
);
729 print_string(arg0
, 1);
730 print_syscall_epilogue(name
);
734 #ifdef TARGET_NR_chmod
736 print_chmod(const struct syscallname
*name
,
737 abi_long arg0
, abi_long arg1
, abi_long arg2
,
738 abi_long arg3
, abi_long arg4
, abi_long arg5
)
740 print_syscall_prologue(name
);
741 print_string(arg0
, 0);
742 print_file_mode(arg1
, 1);
743 print_syscall_epilogue(name
);
747 #ifdef TARGET_NR_clone
749 print_clone(const struct syscallname
*name
,
750 abi_long arg0
, abi_long arg1
, abi_long arg2
,
751 abi_long arg3
, abi_long arg4
, abi_long arg5
)
753 print_syscall_prologue(name
);
754 #if defined(TARGET_M68K)
755 print_flags(clone_flags
, arg0
, 0);
756 print_raw_param("newsp=0x" TARGET_ABI_FMT_lx
, arg1
, 1);
757 #elif defined(TARGET_SH4) || defined(TARGET_ALPHA)
758 print_flags(clone_flags
, arg0
, 0);
759 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg1
, 0);
760 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
761 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
762 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
763 #elif defined(TARGET_CRIS)
764 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg0
, 0);
765 print_flags(clone_flags
, arg1
, 0);
766 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
767 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
768 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
770 print_flags(clone_flags
, arg0
, 0);
771 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg1
, 0);
772 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
773 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
774 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
776 print_syscall_epilogue(name
);
780 #ifdef TARGET_NR_creat
782 print_creat(const struct syscallname
*name
,
783 abi_long arg0
, abi_long arg1
, abi_long arg2
,
784 abi_long arg3
, abi_long arg4
, abi_long arg5
)
786 print_syscall_prologue(name
);
787 print_string(arg0
, 0);
788 print_file_mode(arg1
, 1);
789 print_syscall_epilogue(name
);
793 #ifdef TARGET_NR_execv
795 print_execv(const struct syscallname
*name
,
796 abi_long arg0
, abi_long arg1
, abi_long arg2
,
797 abi_long arg3
, abi_long arg4
, abi_long arg5
)
799 print_syscall_prologue(name
);
800 print_string(arg0
, 0);
801 print_raw_param("0x" TARGET_ABI_FMT_lx
, arg1
, 1);
802 print_syscall_epilogue(name
);
806 #ifdef TARGET_NR_faccessat
808 print_faccessat(const struct syscallname
*name
,
809 abi_long arg0
, abi_long arg1
, abi_long arg2
,
810 abi_long arg3
, abi_long arg4
, abi_long arg5
)
812 print_syscall_prologue(name
);
813 print_at_dirfd(arg0
, 0);
814 print_string(arg1
, 0);
815 print_flags(access_flags
, arg2
, 0);
816 print_flags(at_file_flags
, arg3
, 1);
817 print_syscall_epilogue(name
);
821 #ifdef TARGET_NR_fchmodat
823 print_fchmodat(const struct syscallname
*name
,
824 abi_long arg0
, abi_long arg1
, abi_long arg2
,
825 abi_long arg3
, abi_long arg4
, abi_long arg5
)
827 print_syscall_prologue(name
);
828 print_at_dirfd(arg0
, 0);
829 print_string(arg1
, 0);
830 print_file_mode(arg2
, 0);
831 print_flags(at_file_flags
, arg3
, 1);
832 print_syscall_epilogue(name
);
836 #ifdef TARGET_NR_fchownat
838 print_fchownat(const struct syscallname
*name
,
839 abi_long arg0
, abi_long arg1
, abi_long arg2
,
840 abi_long arg3
, abi_long arg4
, abi_long arg5
)
842 print_syscall_prologue(name
);
843 print_at_dirfd(arg0
, 0);
844 print_string(arg1
, 0);
845 print_raw_param("%d", arg2
, 0);
846 print_raw_param("%d", arg3
, 0);
847 print_flags(at_file_flags
, arg4
, 1);
848 print_syscall_epilogue(name
);
852 #if defined(TARGET_NR_fcntl) || defined(TARGET_NR_fcntl64)
854 print_fcntl(const struct syscallname
*name
,
855 abi_long arg0
, abi_long arg1
, abi_long arg2
,
856 abi_long arg3
, abi_long arg4
, abi_long arg5
)
858 print_syscall_prologue(name
);
859 print_raw_param("%d", arg0
, 0);
860 print_flags(fcntl_flags
, arg1
, 0);
862 * TODO: check flags and print following argument only
865 print_pointer(arg2
, 1);
866 print_syscall_epilogue(name
);
868 #define print_fcntl64 print_fcntl
872 #ifdef TARGET_NR_futimesat
874 print_futimesat(const struct syscallname
*name
,
875 abi_long arg0
, abi_long arg1
, abi_long arg2
,
876 abi_long arg3
, abi_long arg4
, abi_long arg5
)
878 print_syscall_prologue(name
);
879 print_at_dirfd(arg0
, 0);
880 print_string(arg1
, 0);
881 print_timeval(arg2
, 0);
882 print_timeval(arg2
+ sizeof (struct target_timeval
), 1);
883 print_syscall_epilogue(name
);
887 #ifdef TARGET_NR_link
889 print_link(const struct syscallname
*name
,
890 abi_long arg0
, abi_long arg1
, abi_long arg2
,
891 abi_long arg3
, abi_long arg4
, abi_long arg5
)
893 print_syscall_prologue(name
);
894 print_string(arg0
, 0);
895 print_string(arg1
, 1);
896 print_syscall_epilogue(name
);
900 #ifdef TARGET_NR_linkat
902 print_linkat(const struct syscallname
*name
,
903 abi_long arg0
, abi_long arg1
, abi_long arg2
,
904 abi_long arg3
, abi_long arg4
, abi_long arg5
)
906 print_syscall_prologue(name
);
907 print_at_dirfd(arg0
, 0);
908 print_string(arg1
, 0);
909 print_at_dirfd(arg2
, 0);
910 print_string(arg3
, 0);
911 print_flags(at_file_flags
, arg4
, 1);
912 print_syscall_epilogue(name
);
916 #ifdef TARGET_NR__llseek
918 print__llseek(const struct syscallname
*name
,
919 abi_long arg0
, abi_long arg1
, abi_long arg2
,
920 abi_long arg3
, abi_long arg4
, abi_long arg5
)
922 const char *whence
= "UNKNOWN";
923 print_syscall_prologue(name
);
924 print_raw_param("%d", arg0
, 0);
925 print_raw_param("%ld", arg1
, 0);
926 print_raw_param("%ld", arg2
, 0);
927 print_pointer(arg3
, 0);
929 case SEEK_SET
: whence
= "SEEK_SET"; break;
930 case SEEK_CUR
: whence
= "SEEK_CUR"; break;
931 case SEEK_END
: whence
= "SEEK_END"; break;
933 gemu_log("%s",whence
);
934 print_syscall_epilogue(name
);
938 #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \
939 defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64)
941 print_stat(const struct syscallname
*name
,
942 abi_long arg0
, abi_long arg1
, abi_long arg2
,
943 abi_long arg3
, abi_long arg4
, abi_long arg5
)
945 print_syscall_prologue(name
);
946 print_string(arg0
, 0);
947 print_pointer(arg1
, 1);
948 print_syscall_epilogue(name
);
950 #define print_lstat print_stat
951 #define print_stat64 print_stat
952 #define print_lstat64 print_stat
955 #if defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64)
957 print_fstat(const struct syscallname
*name
,
958 abi_long arg0
, abi_long arg1
, abi_long arg2
,
959 abi_long arg3
, abi_long arg4
, abi_long arg5
)
961 print_syscall_prologue(name
);
962 print_raw_param("%d", arg0
, 0);
963 print_pointer(arg1
, 1);
964 print_syscall_epilogue(name
);
966 #define print_fstat64 print_fstat
969 #ifdef TARGET_NR_mkdir
971 print_mkdir(const struct syscallname
*name
,
972 abi_long arg0
, abi_long arg1
, abi_long arg2
,
973 abi_long arg3
, abi_long arg4
, abi_long arg5
)
975 print_syscall_prologue(name
);
976 print_string(arg0
, 0);
977 print_file_mode(arg1
, 1);
978 print_syscall_epilogue(name
);
982 #ifdef TARGET_NR_mkdirat
984 print_mkdirat(const struct syscallname
*name
,
985 abi_long arg0
, abi_long arg1
, abi_long arg2
,
986 abi_long arg3
, abi_long arg4
, abi_long arg5
)
988 print_syscall_prologue(name
);
989 print_at_dirfd(arg0
, 0);
990 print_string(arg1
, 0);
991 print_file_mode(arg2
, 1);
992 print_syscall_epilogue(name
);
996 #ifdef TARGET_NR_rmdir
998 print_rmdir(const struct syscallname
*name
,
999 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1000 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1002 print_syscall_prologue(name
);
1003 print_string(arg0
, 0);
1004 print_syscall_epilogue(name
);
1008 #ifdef TARGET_NR_rt_sigaction
1010 print_rt_sigaction(const struct syscallname
*name
,
1011 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1012 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1014 print_syscall_prologue(name
);
1015 print_signal(arg0
, 0);
1016 print_pointer(arg1
, 0);
1017 print_pointer(arg2
, 1);
1018 print_syscall_epilogue(name
);
1022 #ifdef TARGET_NR_rt_sigprocmask
1024 print_rt_sigprocmask(const struct syscallname
*name
,
1025 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1026 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1028 const char *how
= "UNKNOWN";
1029 print_syscall_prologue(name
);
1031 case TARGET_SIG_BLOCK
: how
= "SIG_BLOCK"; break;
1032 case TARGET_SIG_UNBLOCK
: how
= "SIG_UNBLOCK"; break;
1033 case TARGET_SIG_SETMASK
: how
= "SIG_SETMASK"; break;
1035 gemu_log("%s,",how
);
1036 print_pointer(arg1
, 0);
1037 print_pointer(arg2
, 1);
1038 print_syscall_epilogue(name
);
1042 #ifdef TARGET_NR_mknod
1044 print_mknod(const struct syscallname
*name
,
1045 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1046 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1048 int hasdev
= (arg1
& (S_IFCHR
|S_IFBLK
));
1050 print_syscall_prologue(name
);
1051 print_string(arg0
, 0);
1052 print_file_mode(arg1
, (hasdev
== 0));
1054 print_raw_param("makedev(%d", major(arg2
), 0);
1055 print_raw_param("%d)", minor(arg2
), 1);
1057 print_syscall_epilogue(name
);
1061 #ifdef TARGET_NR_mknodat
1063 print_mknodat(const struct syscallname
*name
,
1064 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1065 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1067 int hasdev
= (arg2
& (S_IFCHR
|S_IFBLK
));
1069 print_syscall_prologue(name
);
1070 print_at_dirfd(arg0
, 0);
1071 print_string(arg1
, 0);
1072 print_file_mode(arg2
, (hasdev
== 0));
1074 print_raw_param("makedev(%d", major(arg3
), 0);
1075 print_raw_param("%d)", minor(arg3
), 1);
1077 print_syscall_epilogue(name
);
1081 #ifdef TARGET_NR_mq_open
1083 print_mq_open(const struct syscallname
*name
,
1084 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1085 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1087 int is_creat
= (arg1
& TARGET_O_CREAT
);
1089 print_syscall_prologue(name
);
1090 print_string(arg0
, 0);
1091 print_open_flags(arg1
, (is_creat
== 0));
1093 print_file_mode(arg2
, 0);
1094 print_pointer(arg3
, 1);
1096 print_syscall_epilogue(name
);
1100 #ifdef TARGET_NR_open
1102 print_open(const struct syscallname
*name
,
1103 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1104 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1106 int is_creat
= (arg1
& TARGET_O_CREAT
);
1108 print_syscall_prologue(name
);
1109 print_string(arg0
, 0);
1110 print_open_flags(arg1
, (is_creat
== 0));
1112 print_file_mode(arg2
, 1);
1113 print_syscall_epilogue(name
);
1117 #ifdef TARGET_NR_openat
1119 print_openat(const struct syscallname
*name
,
1120 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1121 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1123 int is_creat
= (arg2
& TARGET_O_CREAT
);
1125 print_syscall_prologue(name
);
1126 print_at_dirfd(arg0
, 0);
1127 print_string(arg1
, 0);
1128 print_open_flags(arg2
, (is_creat
== 0));
1130 print_file_mode(arg3
, 1);
1131 print_syscall_epilogue(name
);
1135 #ifdef TARGET_NR_mq_unlink
1137 print_mq_unlink(const struct syscallname
*name
,
1138 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1139 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1141 print_syscall_prologue(name
);
1142 print_string(arg0
, 1);
1143 print_syscall_epilogue(name
);
1147 #if defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat)
1149 print_fstatat64(const struct syscallname
*name
,
1150 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1151 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1153 print_syscall_prologue(name
);
1154 print_at_dirfd(arg0
, 0);
1155 print_string(arg1
, 0);
1156 print_pointer(arg2
, 0);
1157 print_flags(at_file_flags
, arg3
, 1);
1158 print_syscall_epilogue(name
);
1160 #define print_newfstatat print_fstatat64
1163 #ifdef TARGET_NR_readlink
1165 print_readlink(const struct syscallname
*name
,
1166 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1167 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1169 print_syscall_prologue(name
);
1170 print_string(arg0
, 0);
1171 print_pointer(arg1
, 0);
1172 print_raw_param("%u", arg2
, 1);
1173 print_syscall_epilogue(name
);
1177 #ifdef TARGET_NR_readlinkat
1179 print_readlinkat(const struct syscallname
*name
,
1180 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1181 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1183 print_syscall_prologue(name
);
1184 print_at_dirfd(arg0
, 0);
1185 print_string(arg1
, 0);
1186 print_pointer(arg2
, 0);
1187 print_raw_param("%u", arg3
, 1);
1188 print_syscall_epilogue(name
);
1192 #ifdef TARGET_NR_rename
1194 print_rename(const struct syscallname
*name
,
1195 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1196 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1198 print_syscall_prologue(name
);
1199 print_string(arg0
, 0);
1200 print_string(arg1
, 1);
1201 print_syscall_epilogue(name
);
1205 #ifdef TARGET_NR_renameat
1207 print_renameat(const struct syscallname
*name
,
1208 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1209 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1211 print_syscall_prologue(name
);
1212 print_at_dirfd(arg0
, 0);
1213 print_string(arg1
, 0);
1214 print_at_dirfd(arg2
, 0);
1215 print_string(arg3
, 1);
1216 print_syscall_epilogue(name
);
1220 #ifdef TARGET_NR_statfs
1222 print_statfs(const struct syscallname
*name
,
1223 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1224 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1226 print_syscall_prologue(name
);
1227 print_string(arg0
, 0);
1228 print_pointer(arg1
, 1);
1229 print_syscall_epilogue(name
);
1231 #define print_statfs64 print_statfs
1234 #ifdef TARGET_NR_symlink
1236 print_symlink(const struct syscallname
*name
,
1237 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1238 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1240 print_syscall_prologue(name
);
1241 print_string(arg0
, 0);
1242 print_string(arg1
, 1);
1243 print_syscall_epilogue(name
);
1247 #ifdef TARGET_NR_symlinkat
1249 print_symlinkat(const struct syscallname
*name
,
1250 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1251 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1253 print_syscall_prologue(name
);
1254 print_string(arg0
, 0);
1255 print_at_dirfd(arg1
, 0);
1256 print_string(arg2
, 1);
1257 print_syscall_epilogue(name
);
1261 #ifdef TARGET_NR_mount
1263 print_mount(const struct syscallname
*name
,
1264 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1265 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1267 print_syscall_prologue(name
);
1268 print_string(arg0
, 0);
1269 print_string(arg1
, 0);
1270 print_string(arg2
, 0);
1271 print_flags(mount_flags
, arg3
, 0);
1272 print_pointer(arg4
, 1);
1273 print_syscall_epilogue(name
);
1277 #ifdef TARGET_NR_umount
1279 print_umount(const struct syscallname
*name
,
1280 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1281 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1283 print_syscall_prologue(name
);
1284 print_string(arg0
, 1);
1285 print_syscall_epilogue(name
);
1289 #ifdef TARGET_NR_umount2
1291 print_umount2(const struct syscallname
*name
,
1292 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1293 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1295 print_syscall_prologue(name
);
1296 print_string(arg0
, 0);
1297 print_flags(umount2_flags
, arg1
, 1);
1298 print_syscall_epilogue(name
);
1302 #ifdef TARGET_NR_unlink
1304 print_unlink(const struct syscallname
*name
,
1305 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1306 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1308 print_syscall_prologue(name
);
1309 print_string(arg0
, 1);
1310 print_syscall_epilogue(name
);
1314 #ifdef TARGET_NR_unlinkat
1316 print_unlinkat(const struct syscallname
*name
,
1317 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1318 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1320 print_syscall_prologue(name
);
1321 print_at_dirfd(arg0
, 0);
1322 print_string(arg1
, 0);
1323 print_flags(unlinkat_flags
, arg2
, 1);
1324 print_syscall_epilogue(name
);
1328 #ifdef TARGET_NR_utime
1330 print_utime(const struct syscallname
*name
,
1331 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1332 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1334 print_syscall_prologue(name
);
1335 print_string(arg0
, 0);
1336 print_pointer(arg1
, 1);
1337 print_syscall_epilogue(name
);
1341 #ifdef TARGET_NR_utimes
1343 print_utimes(const struct syscallname
*name
,
1344 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1345 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1347 print_syscall_prologue(name
);
1348 print_string(arg0
, 0);
1349 print_pointer(arg1
, 1);
1350 print_syscall_epilogue(name
);
1354 #ifdef TARGET_NR_utimensat
1356 print_utimensat(const struct syscallname
*name
,
1357 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1358 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1360 print_syscall_prologue(name
);
1361 print_at_dirfd(arg0
, 0);
1362 print_string(arg1
, 0);
1363 print_pointer(arg2
, 0);
1364 print_flags(at_file_flags
, arg3
, 1);
1365 print_syscall_epilogue(name
);
1369 #if defined(TARGET_NR_mmap) || defined(TARGET_NR_mmap2)
1371 print_mmap(const struct syscallname
*name
,
1372 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1373 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1375 print_syscall_prologue(name
);
1376 print_pointer(arg0
, 0);
1377 print_raw_param("%d", arg1
, 0);
1378 print_flags(mmap_prot_flags
, arg2
, 0);
1379 print_flags(mmap_flags
, arg3
, 0);
1380 print_raw_param("%d", arg4
, 0);
1381 print_raw_param("%#x", arg5
, 1);
1382 print_syscall_epilogue(name
);
1384 #define print_mmap2 print_mmap
1387 #ifdef TARGET_NR_mprotect
1389 print_mprotect(const struct syscallname
*name
,
1390 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1391 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1393 print_syscall_prologue(name
);
1394 print_pointer(arg0
, 0);
1395 print_raw_param("%d", arg1
, 0);
1396 print_flags(mmap_prot_flags
, arg2
, 1);
1397 print_syscall_epilogue(name
);
1401 #ifdef TARGET_NR_munmap
1403 print_munmap(const struct syscallname
*name
,
1404 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1405 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1407 print_syscall_prologue(name
);
1408 print_pointer(arg0
, 0);
1409 print_raw_param("%d", arg1
, 1);
1410 print_syscall_epilogue(name
);
1414 #ifdef TARGET_NR_futex
1415 static void print_futex_op(abi_long tflag
, int last
)
1417 #define print_op(val) \
1418 if( cmd == val ) { \
1423 int cmd
= (int)tflag
;
1424 #ifdef FUTEX_PRIVATE_FLAG
1425 if (cmd
& FUTEX_PRIVATE_FLAG
) {
1426 gemu_log("FUTEX_PRIVATE_FLAG|");
1427 cmd
&= ~FUTEX_PRIVATE_FLAG
;
1430 print_op(FUTEX_WAIT
)
1431 print_op(FUTEX_WAKE
)
1433 print_op(FUTEX_REQUEUE
)
1434 print_op(FUTEX_CMP_REQUEUE
)
1435 print_op(FUTEX_WAKE_OP
)
1436 print_op(FUTEX_LOCK_PI
)
1437 print_op(FUTEX_UNLOCK_PI
)
1438 print_op(FUTEX_TRYLOCK_PI
)
1439 #ifdef FUTEX_WAIT_BITSET
1440 print_op(FUTEX_WAIT_BITSET
)
1442 #ifdef FUTEX_WAKE_BITSET
1443 print_op(FUTEX_WAKE_BITSET
)
1445 /* unknown values */
1450 print_futex(const struct syscallname
*name
,
1451 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1452 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1454 print_syscall_prologue(name
);
1455 print_pointer(arg0
, 0);
1456 print_futex_op(arg1
, 0);
1457 print_raw_param(",%d", arg2
, 0);
1458 print_pointer(arg3
, 0); /* struct timespec */
1459 print_pointer(arg4
, 0);
1460 print_raw_param("%d", arg4
, 1);
1461 print_syscall_epilogue(name
);
1465 #ifdef TARGET_NR_kill
1467 print_kill(const struct syscallname
*name
,
1468 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1469 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1471 print_syscall_prologue(name
);
1472 print_raw_param("%d", arg0
, 0);
1473 print_signal(arg1
, 1);
1474 print_syscall_epilogue(name
);
1479 * An array of all of the syscalls we know about
1482 static const struct syscallname scnames
[] = {
1483 #include "strace.list"
1486 static int nsyscalls
= ARRAY_SIZE(scnames
);
1489 * The public interface to this module.
1492 print_syscall(int num
,
1493 abi_long arg1
, abi_long arg2
, abi_long arg3
,
1494 abi_long arg4
, abi_long arg5
, abi_long arg6
)
1497 const char *format
="%s(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
")";
1499 gemu_log("%d ", getpid() );
1501 for(i
=0;i
<nsyscalls
;i
++)
1502 if( scnames
[i
].nr
== num
) {
1503 if( scnames
[i
].call
!= NULL
) {
1504 scnames
[i
].call(&scnames
[i
],arg1
,arg2
,arg3
,arg4
,arg5
,arg6
);
1506 /* XXX: this format system is broken because it uses
1507 host types and host pointers for strings */
1508 if( scnames
[i
].format
!= NULL
)
1509 format
= scnames
[i
].format
;
1510 gemu_log(format
,scnames
[i
].name
, arg1
,arg2
,arg3
,arg4
,arg5
,arg6
);
1514 gemu_log("Unknown syscall %d\n", num
);
1519 print_syscall_ret(int num
, abi_long ret
)
1522 char *errstr
= NULL
;
1524 for(i
=0;i
<nsyscalls
;i
++)
1525 if( scnames
[i
].nr
== num
) {
1526 if( scnames
[i
].result
!= NULL
) {
1527 scnames
[i
].result(&scnames
[i
],ret
);
1530 errstr
= target_strerror(-ret
);
1533 gemu_log(" = -1 errno=" TARGET_ABI_FMT_ld
" (%s)\n",
1536 gemu_log(" = " TARGET_ABI_FMT_ld
"\n", ret
);