7 #include <sys/select.h>
21 void (*call
)(const struct syscallname
*,
22 abi_long
, abi_long
, abi_long
,
23 abi_long
, abi_long
, abi_long
);
24 void (*result
)(const struct syscallname
*, abi_long
);
29 * It is possible that target doesn't have syscall that uses
30 * following flags but we don't want the compiler to warn
31 * us about them being unused. Same applies to utility print
32 * functions. It is ok to keep them while not used.
34 #define UNUSED __attribute__ ((unused))
40 * Structure used to translate flag values into strings. This is
41 * similar that is in the actual strace tool.
44 abi_long f_value
; /* flag */
45 const char *f_string
; /* stringified flag */
48 /* common flags for all architectures */
49 #define FLAG_GENERIC(name) { name, #name }
50 /* target specific flags (syscall_defs.h has TARGET_<flag>) */
51 #define FLAG_TARGET(name) { TARGET_ ## name, #name }
52 /* end of flags array */
53 #define FLAG_END { 0, NULL }
55 UNUSED
static const char *get_comma(int);
56 UNUSED
static void print_pointer(abi_long
, int);
57 UNUSED
static void print_flags(const struct flags
*, abi_long
, int);
58 UNUSED
static void print_at_dirfd(abi_long
, int);
59 UNUSED
static void print_file_mode(abi_long
, int);
60 UNUSED
static void print_open_flags(abi_long
, int);
61 UNUSED
static void print_syscall_prologue(const struct syscallname
*);
62 UNUSED
static void print_syscall_epilogue(const struct syscallname
*);
63 UNUSED
static void print_string(abi_long
, int);
64 UNUSED
static void print_raw_param(const char *, abi_long
, int);
65 UNUSED
static void print_timeval(abi_ulong
, int);
66 UNUSED
static void print_number(abi_long
, int);
67 UNUSED
static void print_signal(abi_ulong
, int);
73 print_ipc_cmd(int cmd
)
75 #define output_cmd(val) \
83 /* General IPC commands */
84 output_cmd( IPC_RMID
);
85 output_cmd( IPC_SET
);
86 output_cmd( IPC_STAT
);
87 output_cmd( IPC_INFO
);
88 /* msgctl() commands */
90 output_cmd( MSG_STAT
);
91 output_cmd( MSG_INFO
);
93 /* shmctl() commands */
94 output_cmd( SHM_LOCK
);
95 output_cmd( SHM_UNLOCK
);
96 output_cmd( SHM_STAT
);
97 output_cmd( SHM_INFO
);
98 /* semctl() commands */
100 output_cmd( GETVAL
);
101 output_cmd( GETALL
);
102 output_cmd( GETNCNT
);
103 output_cmd( GETZCNT
);
104 output_cmd( SETVAL
);
105 output_cmd( SETALL
);
106 output_cmd( SEM_STAT
);
107 output_cmd( SEM_INFO
);
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
);
116 output_cmd( IPC_RMID
);
118 /* Some value we don't recognize */
123 print_signal(abi_ulong arg
, int last
)
125 const char *signal_name
= NULL
;
127 case TARGET_SIGHUP
: signal_name
= "SIGHUP"; break;
128 case TARGET_SIGINT
: signal_name
= "SIGINT"; break;
129 case TARGET_SIGQUIT
: signal_name
= "SIGQUIT"; break;
130 case TARGET_SIGILL
: signal_name
= "SIGILL"; break;
131 case TARGET_SIGABRT
: signal_name
= "SIGABRT"; break;
132 case TARGET_SIGFPE
: signal_name
= "SIGFPE"; break;
133 case TARGET_SIGKILL
: signal_name
= "SIGKILL"; break;
134 case TARGET_SIGSEGV
: signal_name
= "SIGSEGV"; break;
135 case TARGET_SIGPIPE
: signal_name
= "SIGPIPE"; break;
136 case TARGET_SIGALRM
: signal_name
= "SIGALRM"; break;
137 case TARGET_SIGTERM
: signal_name
= "SIGTERM"; break;
138 case TARGET_SIGUSR1
: signal_name
= "SIGUSR1"; break;
139 case TARGET_SIGUSR2
: signal_name
= "SIGUSR2"; break;
140 case TARGET_SIGCHLD
: signal_name
= "SIGCHLD"; break;
141 case TARGET_SIGCONT
: signal_name
= "SIGCONT"; break;
142 case TARGET_SIGSTOP
: signal_name
= "SIGSTOP"; break;
143 case TARGET_SIGTTIN
: signal_name
= "SIGTTIN"; break;
144 case TARGET_SIGTTOU
: signal_name
= "SIGTTOU"; break;
146 if (signal_name
== NULL
) {
147 print_raw_param("%ld", arg
, 1);
150 gemu_log("%s%s", signal_name
, get_comma(last
));
153 #ifdef TARGET_NR__newselect
155 print_fdset(int n
, abi_ulong target_fds_addr
)
160 if( target_fds_addr
) {
161 abi_long
*target_fds
;
163 target_fds
= lock_user(VERIFY_READ
,
165 sizeof(*target_fds
)*(n
/ TARGET_ABI_BITS
+ 1),
171 for (i
=n
; i
>=0; i
--) {
172 if ((tswapal(target_fds
[i
/ TARGET_ABI_BITS
]) >> (i
& (TARGET_ABI_BITS
- 1))) & 1)
175 unlock_user(target_fds
, target_fds_addr
, 0);
182 * Sysycall specific output functions
186 #ifdef TARGET_NR__newselect
187 static long newselect_arg1
= 0;
188 static long newselect_arg2
= 0;
189 static long newselect_arg3
= 0;
190 static long newselect_arg4
= 0;
191 static long newselect_arg5
= 0;
194 print_newselect(const struct syscallname
*name
,
195 abi_long arg1
, abi_long arg2
, abi_long arg3
,
196 abi_long arg4
, abi_long arg5
, abi_long arg6
)
198 gemu_log("%s(" TARGET_ABI_FMT_ld
",", name
->name
, arg1
);
199 print_fdset(arg1
, arg2
);
201 print_fdset(arg1
, arg3
);
203 print_fdset(arg1
, arg4
);
205 print_timeval(arg5
, 1);
208 /* save for use in the return output function below */
217 #ifdef TARGET_NR_semctl
219 print_semctl(const struct syscallname
*name
,
220 abi_long arg1
, abi_long arg2
, abi_long arg3
,
221 abi_long arg4
, abi_long arg5
, abi_long arg6
)
223 gemu_log("%s(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
",", name
->name
, arg1
, arg2
);
225 gemu_log(",0x" TARGET_ABI_FMT_lx
")", arg4
);
230 print_execve(const struct syscallname
*name
,
231 abi_long arg1
, abi_long arg2
, abi_long arg3
,
232 abi_long arg4
, abi_long arg5
, abi_long arg6
)
234 abi_ulong arg_ptr_addr
;
237 if (!(s
= lock_user_string(arg1
)))
239 gemu_log("%s(\"%s\",{", name
->name
, s
);
240 unlock_user(s
, arg1
, 0);
242 for (arg_ptr_addr
= arg2
; ; arg_ptr_addr
+= sizeof(abi_ulong
)) {
243 abi_ulong
*arg_ptr
, arg_addr
;
245 arg_ptr
= lock_user(VERIFY_READ
, arg_ptr_addr
, sizeof(abi_ulong
), 1);
248 arg_addr
= tswapal(*arg_ptr
);
249 unlock_user(arg_ptr
, arg_ptr_addr
, 0);
252 if ((s
= lock_user_string(arg_addr
))) {
253 gemu_log("\"%s\",", s
);
254 unlock_user(s
, arg_addr
, 0);
263 print_ipc(const struct syscallname
*name
,
264 abi_long arg1
, abi_long arg2
, abi_long arg3
,
265 abi_long arg4
, abi_long arg5
, abi_long arg6
)
269 gemu_log("semctl(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
",", arg1
, arg2
);
271 gemu_log(",0x" TARGET_ABI_FMT_lx
")", arg4
);
274 gemu_log("%s(" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
")",
275 name
->name
, arg1
, arg2
, arg3
, arg4
);
281 * Variants for the return value output function
285 print_syscall_ret_addr(const struct syscallname
*name
, abi_long ret
)
290 errstr
= target_strerror(errno
);
292 if ((ret
== -1) && errstr
) {
293 gemu_log(" = -1 errno=%d (%s)\n", errno
, errstr
);
295 gemu_log(" = 0x" TARGET_ABI_FMT_lx
"\n", ret
);
299 #if 0 /* currently unused */
301 print_syscall_ret_raw(struct syscallname
*name
, abi_long ret
)
303 gemu_log(" = 0x" TARGET_ABI_FMT_lx
"\n", ret
);
307 #ifdef TARGET_NR__newselect
309 print_syscall_ret_newselect(const struct syscallname
*name
, abi_long ret
)
311 gemu_log(" = 0x" TARGET_ABI_FMT_lx
" (", ret
);
312 print_fdset(newselect_arg1
,newselect_arg2
);
314 print_fdset(newselect_arg1
,newselect_arg3
);
316 print_fdset(newselect_arg1
,newselect_arg4
);
318 print_timeval(newselect_arg5
, 1);
323 UNUSED
static struct flags access_flags
[] = {
331 UNUSED
static struct flags at_file_flags
[] = {
333 FLAG_GENERIC(AT_EACCESS
),
335 #ifdef AT_SYMLINK_NOFOLLOW
336 FLAG_GENERIC(AT_SYMLINK_NOFOLLOW
),
341 UNUSED
static struct flags unlinkat_flags
[] = {
343 FLAG_GENERIC(AT_REMOVEDIR
),
348 UNUSED
static struct flags mode_flags
[] = {
349 FLAG_GENERIC(S_IFSOCK
),
350 FLAG_GENERIC(S_IFLNK
),
351 FLAG_GENERIC(S_IFREG
),
352 FLAG_GENERIC(S_IFBLK
),
353 FLAG_GENERIC(S_IFDIR
),
354 FLAG_GENERIC(S_IFCHR
),
355 FLAG_GENERIC(S_IFIFO
),
359 UNUSED
static struct flags open_access_flags
[] = {
360 FLAG_TARGET(O_RDONLY
),
361 FLAG_TARGET(O_WRONLY
),
366 UNUSED
static struct flags open_flags
[] = {
367 FLAG_TARGET(O_APPEND
),
368 FLAG_TARGET(O_CREAT
),
369 FLAG_TARGET(O_DIRECTORY
),
371 FLAG_TARGET(O_LARGEFILE
),
372 FLAG_TARGET(O_NOCTTY
),
373 FLAG_TARGET(O_NOFOLLOW
),
374 FLAG_TARGET(O_NONBLOCK
), /* also O_NDELAY */
376 FLAG_TARGET(O_TRUNC
),
378 FLAG_TARGET(O_DIRECT
),
383 UNUSED
static struct flags mount_flags
[] = {
385 FLAG_GENERIC(MS_BIND
),
388 FLAG_GENERIC(MS_DIRSYNC
),
390 FLAG_GENERIC(MS_MANDLOCK
),
392 FLAG_GENERIC(MS_MOVE
),
394 FLAG_GENERIC(MS_NOATIME
),
395 FLAG_GENERIC(MS_NODEV
),
396 FLAG_GENERIC(MS_NODIRATIME
),
397 FLAG_GENERIC(MS_NOEXEC
),
398 FLAG_GENERIC(MS_NOSUID
),
399 FLAG_GENERIC(MS_RDONLY
),
401 FLAG_GENERIC(MS_RELATIME
),
403 FLAG_GENERIC(MS_REMOUNT
),
404 FLAG_GENERIC(MS_SYNCHRONOUS
),
408 UNUSED
static struct flags umount2_flags
[] = {
410 FLAG_GENERIC(MNT_FORCE
),
413 FLAG_GENERIC(MNT_DETACH
),
416 FLAG_GENERIC(MNT_EXPIRE
),
421 UNUSED
static struct flags mmap_prot_flags
[] = {
422 FLAG_GENERIC(PROT_NONE
),
423 FLAG_GENERIC(PROT_EXEC
),
424 FLAG_GENERIC(PROT_READ
),
425 FLAG_GENERIC(PROT_WRITE
),
426 FLAG_TARGET(PROT_SEM
),
427 FLAG_GENERIC(PROT_GROWSDOWN
),
428 FLAG_GENERIC(PROT_GROWSUP
),
432 UNUSED
static struct flags mmap_flags
[] = {
433 FLAG_TARGET(MAP_SHARED
),
434 FLAG_TARGET(MAP_PRIVATE
),
435 FLAG_TARGET(MAP_ANONYMOUS
),
436 FLAG_TARGET(MAP_DENYWRITE
),
437 FLAG_TARGET(MAP_FIXED
),
438 FLAG_TARGET(MAP_GROWSDOWN
),
439 FLAG_TARGET(MAP_EXECUTABLE
),
441 FLAG_TARGET(MAP_LOCKED
),
444 FLAG_TARGET(MAP_NONBLOCK
),
446 FLAG_TARGET(MAP_NORESERVE
),
448 FLAG_TARGET(MAP_POPULATE
),
450 #ifdef TARGET_MAP_UNINITIALIZED
451 FLAG_TARGET(MAP_UNINITIALIZED
),
456 UNUSED
static struct flags fcntl_flags
[] = {
457 FLAG_TARGET(F_DUPFD
),
458 FLAG_TARGET(F_GETFD
),
459 FLAG_TARGET(F_SETFD
),
460 FLAG_TARGET(F_GETFL
),
461 FLAG_TARGET(F_SETFL
),
462 FLAG_TARGET(F_GETLK
),
463 FLAG_TARGET(F_SETLK
),
464 FLAG_TARGET(F_SETLKW
),
468 UNUSED
static struct flags clone_flags
[] = {
469 FLAG_GENERIC(CLONE_VM
),
470 FLAG_GENERIC(CLONE_FS
),
471 FLAG_GENERIC(CLONE_FILES
),
472 FLAG_GENERIC(CLONE_SIGHAND
),
473 FLAG_GENERIC(CLONE_PTRACE
),
474 FLAG_GENERIC(CLONE_VFORK
),
475 FLAG_GENERIC(CLONE_PARENT
),
476 FLAG_GENERIC(CLONE_THREAD
),
477 FLAG_GENERIC(CLONE_NEWNS
),
478 FLAG_GENERIC(CLONE_SYSVSEM
),
479 FLAG_GENERIC(CLONE_SETTLS
),
480 FLAG_GENERIC(CLONE_PARENT_SETTID
),
481 FLAG_GENERIC(CLONE_CHILD_CLEARTID
),
482 FLAG_GENERIC(CLONE_DETACHED
),
483 FLAG_GENERIC(CLONE_UNTRACED
),
484 FLAG_GENERIC(CLONE_CHILD_SETTID
),
485 #if defined(CLONE_NEWUTS)
486 FLAG_GENERIC(CLONE_NEWUTS
),
488 #if defined(CLONE_NEWIPC)
489 FLAG_GENERIC(CLONE_NEWIPC
),
491 #if defined(CLONE_NEWUSER)
492 FLAG_GENERIC(CLONE_NEWUSER
),
494 #if defined(CLONE_NEWPID)
495 FLAG_GENERIC(CLONE_NEWPID
),
497 #if defined(CLONE_NEWNET)
498 FLAG_GENERIC(CLONE_NEWNET
),
500 #if defined(CLONE_IO)
501 FLAG_GENERIC(CLONE_IO
),
507 * print_xxx utility functions. These are used to print syscall
508 * parameters in certain format. All of these have parameter
509 * named 'last'. This parameter is used to add comma to output
516 return ((last
) ? "" : ",");
520 print_flags(const struct flags
*f
, abi_long flags
, int last
)
522 const char *sep
= "";
525 if ((flags
== 0) && (f
->f_value
== 0)) {
526 gemu_log("%s%s", f
->f_string
, get_comma(last
));
529 for (n
= 0; f
->f_string
!= NULL
; f
++) {
530 if ((f
->f_value
!= 0) && ((flags
& f
->f_value
) == f
->f_value
)) {
531 gemu_log("%s%s", sep
, f
->f_string
);
532 flags
&= ~f
->f_value
;
539 /* print rest of the flags as numeric */
541 gemu_log("%s%#x%s", sep
, (unsigned int)flags
, get_comma(last
));
543 gemu_log("%s", get_comma(last
));
546 /* no string version of flags found, print them in hex then */
547 gemu_log("%#x%s", (unsigned int)flags
, get_comma(last
));
552 print_at_dirfd(abi_long dirfd
, int last
)
555 if (dirfd
== AT_FDCWD
) {
556 gemu_log("AT_FDCWD%s", get_comma(last
));
560 gemu_log("%d%s", (int)dirfd
, get_comma(last
));
564 print_file_mode(abi_long mode
, int last
)
566 const char *sep
= "";
567 const struct flags
*m
;
569 for (m
= &mode_flags
[0]; m
->f_string
!= NULL
; m
++) {
570 if ((m
->f_value
& mode
) == m
->f_value
) {
571 gemu_log("%s%s", m
->f_string
, sep
);
579 /* print rest of the mode as octal */
581 gemu_log("%s%#o", sep
, (unsigned int)mode
);
583 gemu_log("%s", get_comma(last
));
587 print_open_flags(abi_long flags
, int last
)
589 print_flags(open_access_flags
, flags
& TARGET_O_ACCMODE
, 1);
590 flags
&= ~TARGET_O_ACCMODE
;
592 gemu_log("%s", get_comma(last
));
596 print_flags(open_flags
, flags
, last
);
600 print_syscall_prologue(const struct syscallname
*sc
)
602 gemu_log("%s(", sc
->name
);
607 print_syscall_epilogue(const struct syscallname
*sc
)
614 print_string(abi_long addr
, int last
)
618 if ((s
= lock_user_string(addr
)) != NULL
) {
619 gemu_log("\"%s\"%s", s
, get_comma(last
));
620 unlock_user(s
, addr
, 0);
622 /* can't get string out of it, so print it as pointer */
623 print_pointer(addr
, last
);
628 * Prints out raw parameter using given format. Caller needs
629 * to do byte swapping if needed.
632 print_raw_param(const char *fmt
, abi_long param
, int last
)
636 (void) snprintf(format
, sizeof (format
), "%s%s", fmt
, get_comma(last
));
637 gemu_log(format
, param
);
641 print_pointer(abi_long p
, int last
)
644 gemu_log("NULL%s", get_comma(last
));
646 gemu_log("0x" TARGET_ABI_FMT_lx
"%s", p
, get_comma(last
));
650 * Reads 32-bit (int) number from guest address space from
651 * address 'addr' and prints it.
654 print_number(abi_long addr
, int last
)
657 gemu_log("NULL%s", get_comma(last
));
661 get_user_s32(num
, addr
);
662 gemu_log("[%d]%s", num
, get_comma(last
));
667 print_timeval(abi_ulong tv_addr
, int last
)
670 struct target_timeval
*tv
;
672 tv
= lock_user(VERIFY_READ
, tv_addr
, sizeof(*tv
), 1);
675 gemu_log("{" TARGET_ABI_FMT_ld
"," TARGET_ABI_FMT_ld
"}%s",
676 tv
->tv_sec
, tv
->tv_usec
, get_comma(last
));
677 unlock_user(tv
, tv_addr
, 0);
679 gemu_log("NULL%s", get_comma(last
));
684 #ifdef TARGET_NR_accept
686 print_accept(const struct syscallname
*name
,
687 abi_long arg0
, abi_long arg1
, abi_long arg2
,
688 abi_long arg3
, abi_long arg4
, abi_long arg5
)
690 print_syscall_prologue(name
);
691 print_raw_param("%d", arg0
, 0);
692 print_pointer(arg1
, 0);
693 print_number(arg2
, 1);
694 print_syscall_epilogue(name
);
698 #ifdef TARGET_NR_access
700 print_access(const struct syscallname
*name
,
701 abi_long arg0
, abi_long arg1
, abi_long arg2
,
702 abi_long arg3
, abi_long arg4
, abi_long arg5
)
704 print_syscall_prologue(name
);
705 print_string(arg0
, 0);
706 print_flags(access_flags
, arg1
, 1);
707 print_syscall_epilogue(name
);
713 print_brk(const struct syscallname
*name
,
714 abi_long arg0
, abi_long arg1
, abi_long arg2
,
715 abi_long arg3
, abi_long arg4
, abi_long arg5
)
717 print_syscall_prologue(name
);
718 print_pointer(arg0
, 1);
719 print_syscall_epilogue(name
);
723 #ifdef TARGET_NR_chdir
725 print_chdir(const struct syscallname
*name
,
726 abi_long arg0
, abi_long arg1
, abi_long arg2
,
727 abi_long arg3
, abi_long arg4
, abi_long arg5
)
729 print_syscall_prologue(name
);
730 print_string(arg0
, 1);
731 print_syscall_epilogue(name
);
735 #ifdef TARGET_NR_chmod
737 print_chmod(const struct syscallname
*name
,
738 abi_long arg0
, abi_long arg1
, abi_long arg2
,
739 abi_long arg3
, abi_long arg4
, abi_long arg5
)
741 print_syscall_prologue(name
);
742 print_string(arg0
, 0);
743 print_file_mode(arg1
, 1);
744 print_syscall_epilogue(name
);
748 #ifdef TARGET_NR_clone
750 print_clone(const struct syscallname
*name
,
751 abi_long arg0
, abi_long arg1
, abi_long arg2
,
752 abi_long arg3
, abi_long arg4
, abi_long arg5
)
754 print_syscall_prologue(name
);
755 #if defined(TARGET_M68K)
756 print_flags(clone_flags
, arg0
, 0);
757 print_raw_param("newsp=0x" TARGET_ABI_FMT_lx
, arg1
, 1);
758 #elif defined(TARGET_SH4) || defined(TARGET_ALPHA)
759 print_flags(clone_flags
, arg0
, 0);
760 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg1
, 0);
761 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
762 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
763 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
764 #elif defined(TARGET_CRIS)
765 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg0
, 0);
766 print_flags(clone_flags
, arg1
, 0);
767 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
768 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
769 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
771 print_flags(clone_flags
, arg0
, 0);
772 print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx
, arg1
, 0);
773 print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx
, arg2
, 0);
774 print_raw_param("tls=0x" TARGET_ABI_FMT_lx
, arg3
, 0);
775 print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx
, arg4
, 1);
777 print_syscall_epilogue(name
);
781 #ifdef TARGET_NR_creat
783 print_creat(const struct syscallname
*name
,
784 abi_long arg0
, abi_long arg1
, abi_long arg2
,
785 abi_long arg3
, abi_long arg4
, abi_long arg5
)
787 print_syscall_prologue(name
);
788 print_string(arg0
, 0);
789 print_file_mode(arg1
, 1);
790 print_syscall_epilogue(name
);
794 #ifdef TARGET_NR_execv
796 print_execv(const struct syscallname
*name
,
797 abi_long arg0
, abi_long arg1
, abi_long arg2
,
798 abi_long arg3
, abi_long arg4
, abi_long arg5
)
800 print_syscall_prologue(name
);
801 print_string(arg0
, 0);
802 print_raw_param("0x" TARGET_ABI_FMT_lx
, arg1
, 1);
803 print_syscall_epilogue(name
);
807 #ifdef TARGET_NR_faccessat
809 print_faccessat(const struct syscallname
*name
,
810 abi_long arg0
, abi_long arg1
, abi_long arg2
,
811 abi_long arg3
, abi_long arg4
, abi_long arg5
)
813 print_syscall_prologue(name
);
814 print_at_dirfd(arg0
, 0);
815 print_string(arg1
, 0);
816 print_flags(access_flags
, arg2
, 0);
817 print_flags(at_file_flags
, arg3
, 1);
818 print_syscall_epilogue(name
);
822 #ifdef TARGET_NR_fchmodat
824 print_fchmodat(const struct syscallname
*name
,
825 abi_long arg0
, abi_long arg1
, abi_long arg2
,
826 abi_long arg3
, abi_long arg4
, abi_long arg5
)
828 print_syscall_prologue(name
);
829 print_at_dirfd(arg0
, 0);
830 print_string(arg1
, 0);
831 print_file_mode(arg2
, 0);
832 print_flags(at_file_flags
, arg3
, 1);
833 print_syscall_epilogue(name
);
837 #ifdef TARGET_NR_fchownat
839 print_fchownat(const struct syscallname
*name
,
840 abi_long arg0
, abi_long arg1
, abi_long arg2
,
841 abi_long arg3
, abi_long arg4
, abi_long arg5
)
843 print_syscall_prologue(name
);
844 print_at_dirfd(arg0
, 0);
845 print_string(arg1
, 0);
846 print_raw_param("%d", arg2
, 0);
847 print_raw_param("%d", arg3
, 0);
848 print_flags(at_file_flags
, arg4
, 1);
849 print_syscall_epilogue(name
);
853 #if defined(TARGET_NR_fcntl) || defined(TARGET_NR_fcntl64)
855 print_fcntl(const struct syscallname
*name
,
856 abi_long arg0
, abi_long arg1
, abi_long arg2
,
857 abi_long arg3
, abi_long arg4
, abi_long arg5
)
859 print_syscall_prologue(name
);
860 print_raw_param("%d", arg0
, 0);
861 print_flags(fcntl_flags
, arg1
, 0);
863 * TODO: check flags and print following argument only
866 print_pointer(arg2
, 1);
867 print_syscall_epilogue(name
);
869 #define print_fcntl64 print_fcntl
873 #ifdef TARGET_NR_futimesat
875 print_futimesat(const struct syscallname
*name
,
876 abi_long arg0
, abi_long arg1
, abi_long arg2
,
877 abi_long arg3
, abi_long arg4
, abi_long arg5
)
879 print_syscall_prologue(name
);
880 print_at_dirfd(arg0
, 0);
881 print_string(arg1
, 0);
882 print_timeval(arg2
, 0);
883 print_timeval(arg2
+ sizeof (struct target_timeval
), 1);
884 print_syscall_epilogue(name
);
888 #ifdef TARGET_NR_link
890 print_link(const struct syscallname
*name
,
891 abi_long arg0
, abi_long arg1
, abi_long arg2
,
892 abi_long arg3
, abi_long arg4
, abi_long arg5
)
894 print_syscall_prologue(name
);
895 print_string(arg0
, 0);
896 print_string(arg1
, 1);
897 print_syscall_epilogue(name
);
901 #ifdef TARGET_NR_linkat
903 print_linkat(const struct syscallname
*name
,
904 abi_long arg0
, abi_long arg1
, abi_long arg2
,
905 abi_long arg3
, abi_long arg4
, abi_long arg5
)
907 print_syscall_prologue(name
);
908 print_at_dirfd(arg0
, 0);
909 print_string(arg1
, 0);
910 print_at_dirfd(arg2
, 0);
911 print_string(arg3
, 0);
912 print_flags(at_file_flags
, arg4
, 1);
913 print_syscall_epilogue(name
);
917 #ifdef TARGET_NR__llseek
919 print__llseek(const struct syscallname
*name
,
920 abi_long arg0
, abi_long arg1
, abi_long arg2
,
921 abi_long arg3
, abi_long arg4
, abi_long arg5
)
923 const char *whence
= "UNKNOWN";
924 print_syscall_prologue(name
);
925 print_raw_param("%d", arg0
, 0);
926 print_raw_param("%ld", arg1
, 0);
927 print_raw_param("%ld", arg2
, 0);
928 print_pointer(arg3
, 0);
930 case SEEK_SET
: whence
= "SEEK_SET"; break;
931 case SEEK_CUR
: whence
= "SEEK_CUR"; break;
932 case SEEK_END
: whence
= "SEEK_END"; break;
934 gemu_log("%s",whence
);
935 print_syscall_epilogue(name
);
939 #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \
940 defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64)
942 print_stat(const struct syscallname
*name
,
943 abi_long arg0
, abi_long arg1
, abi_long arg2
,
944 abi_long arg3
, abi_long arg4
, abi_long arg5
)
946 print_syscall_prologue(name
);
947 print_string(arg0
, 0);
948 print_pointer(arg1
, 1);
949 print_syscall_epilogue(name
);
951 #define print_lstat print_stat
952 #define print_stat64 print_stat
953 #define print_lstat64 print_stat
956 #if defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64)
958 print_fstat(const struct syscallname
*name
,
959 abi_long arg0
, abi_long arg1
, abi_long arg2
,
960 abi_long arg3
, abi_long arg4
, abi_long arg5
)
962 print_syscall_prologue(name
);
963 print_raw_param("%d", arg0
, 0);
964 print_pointer(arg1
, 1);
965 print_syscall_epilogue(name
);
967 #define print_fstat64 print_fstat
970 #ifdef TARGET_NR_mkdir
972 print_mkdir(const struct syscallname
*name
,
973 abi_long arg0
, abi_long arg1
, abi_long arg2
,
974 abi_long arg3
, abi_long arg4
, abi_long arg5
)
976 print_syscall_prologue(name
);
977 print_string(arg0
, 0);
978 print_file_mode(arg1
, 1);
979 print_syscall_epilogue(name
);
983 #ifdef TARGET_NR_mkdirat
985 print_mkdirat(const struct syscallname
*name
,
986 abi_long arg0
, abi_long arg1
, abi_long arg2
,
987 abi_long arg3
, abi_long arg4
, abi_long arg5
)
989 print_syscall_prologue(name
);
990 print_at_dirfd(arg0
, 0);
991 print_string(arg1
, 0);
992 print_file_mode(arg2
, 1);
993 print_syscall_epilogue(name
);
997 #ifdef TARGET_NR_rmdir
999 print_rmdir(const struct syscallname
*name
,
1000 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1001 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1003 print_syscall_prologue(name
);
1004 print_string(arg0
, 0);
1005 print_syscall_epilogue(name
);
1009 #ifdef TARGET_NR_rt_sigaction
1011 print_rt_sigaction(const struct syscallname
*name
,
1012 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1013 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1015 print_syscall_prologue(name
);
1016 print_signal(arg0
, 0);
1017 print_pointer(arg1
, 0);
1018 print_pointer(arg2
, 1);
1019 print_syscall_epilogue(name
);
1023 #ifdef TARGET_NR_rt_sigprocmask
1025 print_rt_sigprocmask(const struct syscallname
*name
,
1026 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1027 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1029 const char *how
= "UNKNOWN";
1030 print_syscall_prologue(name
);
1032 case TARGET_SIG_BLOCK
: how
= "SIG_BLOCK"; break;
1033 case TARGET_SIG_UNBLOCK
: how
= "SIG_UNBLOCK"; break;
1034 case TARGET_SIG_SETMASK
: how
= "SIG_SETMASK"; break;
1036 gemu_log("%s,",how
);
1037 print_pointer(arg1
, 0);
1038 print_pointer(arg2
, 1);
1039 print_syscall_epilogue(name
);
1043 #ifdef TARGET_NR_mknod
1045 print_mknod(const struct syscallname
*name
,
1046 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1047 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1049 int hasdev
= (arg1
& (S_IFCHR
|S_IFBLK
));
1051 print_syscall_prologue(name
);
1052 print_string(arg0
, 0);
1053 print_file_mode(arg1
, (hasdev
== 0));
1055 print_raw_param("makedev(%d", major(arg2
), 0);
1056 print_raw_param("%d)", minor(arg2
), 1);
1058 print_syscall_epilogue(name
);
1062 #ifdef TARGET_NR_mknodat
1064 print_mknodat(const struct syscallname
*name
,
1065 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1066 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1068 int hasdev
= (arg2
& (S_IFCHR
|S_IFBLK
));
1070 print_syscall_prologue(name
);
1071 print_at_dirfd(arg0
, 0);
1072 print_string(arg1
, 0);
1073 print_file_mode(arg2
, (hasdev
== 0));
1075 print_raw_param("makedev(%d", major(arg3
), 0);
1076 print_raw_param("%d)", minor(arg3
), 1);
1078 print_syscall_epilogue(name
);
1082 #ifdef TARGET_NR_mq_open
1084 print_mq_open(const struct syscallname
*name
,
1085 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1086 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1088 int is_creat
= (arg1
& TARGET_O_CREAT
);
1090 print_syscall_prologue(name
);
1091 print_string(arg0
, 0);
1092 print_open_flags(arg1
, (is_creat
== 0));
1094 print_file_mode(arg2
, 0);
1095 print_pointer(arg3
, 1);
1097 print_syscall_epilogue(name
);
1101 #ifdef TARGET_NR_open
1103 print_open(const struct syscallname
*name
,
1104 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1105 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1107 int is_creat
= (arg1
& TARGET_O_CREAT
);
1109 print_syscall_prologue(name
);
1110 print_string(arg0
, 0);
1111 print_open_flags(arg1
, (is_creat
== 0));
1113 print_file_mode(arg2
, 1);
1114 print_syscall_epilogue(name
);
1118 #ifdef TARGET_NR_openat
1120 print_openat(const struct syscallname
*name
,
1121 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1122 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1124 int is_creat
= (arg2
& TARGET_O_CREAT
);
1126 print_syscall_prologue(name
);
1127 print_at_dirfd(arg0
, 0);
1128 print_string(arg1
, 0);
1129 print_open_flags(arg2
, (is_creat
== 0));
1131 print_file_mode(arg3
, 1);
1132 print_syscall_epilogue(name
);
1136 #ifdef TARGET_NR_mq_unlink
1138 print_mq_unlink(const struct syscallname
*name
,
1139 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1140 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1142 print_syscall_prologue(name
);
1143 print_string(arg0
, 1);
1144 print_syscall_epilogue(name
);
1148 #if defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat)
1150 print_fstatat64(const struct syscallname
*name
,
1151 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1152 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1154 print_syscall_prologue(name
);
1155 print_at_dirfd(arg0
, 0);
1156 print_string(arg1
, 0);
1157 print_pointer(arg2
, 0);
1158 print_flags(at_file_flags
, arg3
, 1);
1159 print_syscall_epilogue(name
);
1161 #define print_newfstatat print_fstatat64
1164 #ifdef TARGET_NR_readlink
1166 print_readlink(const struct syscallname
*name
,
1167 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1168 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1170 print_syscall_prologue(name
);
1171 print_string(arg0
, 0);
1172 print_pointer(arg1
, 0);
1173 print_raw_param("%u", arg2
, 1);
1174 print_syscall_epilogue(name
);
1178 #ifdef TARGET_NR_readlinkat
1180 print_readlinkat(const struct syscallname
*name
,
1181 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1182 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1184 print_syscall_prologue(name
);
1185 print_at_dirfd(arg0
, 0);
1186 print_string(arg1
, 0);
1187 print_pointer(arg2
, 0);
1188 print_raw_param("%u", arg3
, 1);
1189 print_syscall_epilogue(name
);
1193 #ifdef TARGET_NR_rename
1195 print_rename(const struct syscallname
*name
,
1196 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1197 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1199 print_syscall_prologue(name
);
1200 print_string(arg0
, 0);
1201 print_string(arg1
, 1);
1202 print_syscall_epilogue(name
);
1206 #ifdef TARGET_NR_renameat
1208 print_renameat(const struct syscallname
*name
,
1209 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1210 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1212 print_syscall_prologue(name
);
1213 print_at_dirfd(arg0
, 0);
1214 print_string(arg1
, 0);
1215 print_at_dirfd(arg2
, 0);
1216 print_string(arg3
, 1);
1217 print_syscall_epilogue(name
);
1221 #ifdef TARGET_NR_statfs
1223 print_statfs(const struct syscallname
*name
,
1224 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1225 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1227 print_syscall_prologue(name
);
1228 print_string(arg0
, 0);
1229 print_pointer(arg1
, 1);
1230 print_syscall_epilogue(name
);
1232 #define print_statfs64 print_statfs
1235 #ifdef TARGET_NR_symlink
1237 print_symlink(const struct syscallname
*name
,
1238 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1239 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1241 print_syscall_prologue(name
);
1242 print_string(arg0
, 0);
1243 print_string(arg1
, 1);
1244 print_syscall_epilogue(name
);
1248 #ifdef TARGET_NR_symlinkat
1250 print_symlinkat(const struct syscallname
*name
,
1251 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1252 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1254 print_syscall_prologue(name
);
1255 print_string(arg0
, 0);
1256 print_at_dirfd(arg1
, 0);
1257 print_string(arg2
, 1);
1258 print_syscall_epilogue(name
);
1262 #ifdef TARGET_NR_mount
1264 print_mount(const struct syscallname
*name
,
1265 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1266 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1268 print_syscall_prologue(name
);
1269 print_string(arg0
, 0);
1270 print_string(arg1
, 0);
1271 print_string(arg2
, 0);
1272 print_flags(mount_flags
, arg3
, 0);
1273 print_pointer(arg4
, 1);
1274 print_syscall_epilogue(name
);
1278 #ifdef TARGET_NR_umount
1280 print_umount(const struct syscallname
*name
,
1281 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1282 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1284 print_syscall_prologue(name
);
1285 print_string(arg0
, 1);
1286 print_syscall_epilogue(name
);
1290 #ifdef TARGET_NR_umount2
1292 print_umount2(const struct syscallname
*name
,
1293 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1294 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1296 print_syscall_prologue(name
);
1297 print_string(arg0
, 0);
1298 print_flags(umount2_flags
, arg1
, 1);
1299 print_syscall_epilogue(name
);
1303 #ifdef TARGET_NR_unlink
1305 print_unlink(const struct syscallname
*name
,
1306 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1307 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1309 print_syscall_prologue(name
);
1310 print_string(arg0
, 1);
1311 print_syscall_epilogue(name
);
1315 #ifdef TARGET_NR_unlinkat
1317 print_unlinkat(const struct syscallname
*name
,
1318 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1319 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1321 print_syscall_prologue(name
);
1322 print_at_dirfd(arg0
, 0);
1323 print_string(arg1
, 0);
1324 print_flags(unlinkat_flags
, arg2
, 1);
1325 print_syscall_epilogue(name
);
1329 #ifdef TARGET_NR_utime
1331 print_utime(const struct syscallname
*name
,
1332 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1333 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1335 print_syscall_prologue(name
);
1336 print_string(arg0
, 0);
1337 print_pointer(arg1
, 1);
1338 print_syscall_epilogue(name
);
1342 #ifdef TARGET_NR_utimes
1344 print_utimes(const struct syscallname
*name
,
1345 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1346 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1348 print_syscall_prologue(name
);
1349 print_string(arg0
, 0);
1350 print_pointer(arg1
, 1);
1351 print_syscall_epilogue(name
);
1355 #ifdef TARGET_NR_utimensat
1357 print_utimensat(const struct syscallname
*name
,
1358 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1359 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1361 print_syscall_prologue(name
);
1362 print_at_dirfd(arg0
, 0);
1363 print_string(arg1
, 0);
1364 print_pointer(arg2
, 0);
1365 print_flags(at_file_flags
, arg3
, 1);
1366 print_syscall_epilogue(name
);
1370 #if defined(TARGET_NR_mmap) || defined(TARGET_NR_mmap2)
1372 print_mmap(const struct syscallname
*name
,
1373 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1374 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1376 print_syscall_prologue(name
);
1377 print_pointer(arg0
, 0);
1378 print_raw_param("%d", arg1
, 0);
1379 print_flags(mmap_prot_flags
, arg2
, 0);
1380 print_flags(mmap_flags
, arg3
, 0);
1381 print_raw_param("%d", arg4
, 0);
1382 print_raw_param("%#x", arg5
, 1);
1383 print_syscall_epilogue(name
);
1385 #define print_mmap2 print_mmap
1388 #ifdef TARGET_NR_mprotect
1390 print_mprotect(const struct syscallname
*name
,
1391 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1392 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1394 print_syscall_prologue(name
);
1395 print_pointer(arg0
, 0);
1396 print_raw_param("%d", arg1
, 0);
1397 print_flags(mmap_prot_flags
, arg2
, 1);
1398 print_syscall_epilogue(name
);
1402 #ifdef TARGET_NR_munmap
1404 print_munmap(const struct syscallname
*name
,
1405 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1406 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1408 print_syscall_prologue(name
);
1409 print_pointer(arg0
, 0);
1410 print_raw_param("%d", arg1
, 1);
1411 print_syscall_epilogue(name
);
1415 #ifdef TARGET_NR_futex
1416 static void print_futex_op(abi_long tflag
, int last
)
1418 #define print_op(val) \
1419 if( cmd == val ) { \
1424 int cmd
= (int)tflag
;
1425 #ifdef FUTEX_PRIVATE_FLAG
1426 if (cmd
& FUTEX_PRIVATE_FLAG
) {
1427 gemu_log("FUTEX_PRIVATE_FLAG|");
1428 cmd
&= ~FUTEX_PRIVATE_FLAG
;
1431 print_op(FUTEX_WAIT
)
1432 print_op(FUTEX_WAKE
)
1434 print_op(FUTEX_REQUEUE
)
1435 print_op(FUTEX_CMP_REQUEUE
)
1436 print_op(FUTEX_WAKE_OP
)
1437 print_op(FUTEX_LOCK_PI
)
1438 print_op(FUTEX_UNLOCK_PI
)
1439 print_op(FUTEX_TRYLOCK_PI
)
1440 #ifdef FUTEX_WAIT_BITSET
1441 print_op(FUTEX_WAIT_BITSET
)
1443 #ifdef FUTEX_WAKE_BITSET
1444 print_op(FUTEX_WAKE_BITSET
)
1446 /* unknown values */
1451 print_futex(const struct syscallname
*name
,
1452 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1453 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1455 print_syscall_prologue(name
);
1456 print_pointer(arg0
, 0);
1457 print_futex_op(arg1
, 0);
1458 print_raw_param(",%d", arg2
, 0);
1459 print_pointer(arg3
, 0); /* struct timespec */
1460 print_pointer(arg4
, 0);
1461 print_raw_param("%d", arg4
, 1);
1462 print_syscall_epilogue(name
);
1466 #ifdef TARGET_NR_kill
1468 print_kill(const struct syscallname
*name
,
1469 abi_long arg0
, abi_long arg1
, abi_long arg2
,
1470 abi_long arg3
, abi_long arg4
, abi_long arg5
)
1472 print_syscall_prologue(name
);
1473 print_raw_param("%d", arg0
, 0);
1474 print_signal(arg1
, 1);
1475 print_syscall_epilogue(name
);
1480 * An array of all of the syscalls we know about
1483 static const struct syscallname scnames
[] = {
1484 #include "strace.list"
1487 static int nsyscalls
= ARRAY_SIZE(scnames
);
1490 * The public interface to this module.
1493 print_syscall(int num
,
1494 abi_long arg1
, abi_long arg2
, abi_long arg3
,
1495 abi_long arg4
, abi_long arg5
, abi_long arg6
)
1498 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
")";
1500 gemu_log("%d ", getpid() );
1502 for(i
=0;i
<nsyscalls
;i
++)
1503 if( scnames
[i
].nr
== num
) {
1504 if( scnames
[i
].call
!= NULL
) {
1505 scnames
[i
].call(&scnames
[i
],arg1
,arg2
,arg3
,arg4
,arg5
,arg6
);
1507 /* XXX: this format system is broken because it uses
1508 host types and host pointers for strings */
1509 if( scnames
[i
].format
!= NULL
)
1510 format
= scnames
[i
].format
;
1511 gemu_log(format
,scnames
[i
].name
, arg1
,arg2
,arg3
,arg4
,arg5
,arg6
);
1515 gemu_log("Unknown syscall %d\n", num
);
1520 print_syscall_ret(int num
, abi_long ret
)
1523 char *errstr
= NULL
;
1525 for(i
=0;i
<nsyscalls
;i
++)
1526 if( scnames
[i
].nr
== num
) {
1527 if( scnames
[i
].result
!= NULL
) {
1528 scnames
[i
].result(&scnames
[i
],ret
);
1531 errstr
= target_strerror(-ret
);
1534 gemu_log(" = -1 errno=" TARGET_ABI_FMT_ld
" (%s)\n",
1537 gemu_log(" = " TARGET_ABI_FMT_ld
"\n", ret
);