예제 #1
0
static int
do_pipe(struct tcb *tcp, int flags_arg)
{
	if (exiting(tcp)) {
		if (syserror(tcp)) {
			tprintf("%#lx", tcp->u_arg[0]);
		} else {
#if !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
			int fds[2];

			if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
				tprints("[...]");
			else
				tprintf("[%u, %u]", fds[0], fds[1]);
#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(IA64)
			tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
#else
			tprintf("%#lx", tcp->u_arg[0]);
#endif
		}
		if (flags_arg >= 0) {
			tprints(", ");
			printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
		}
	}
	return 0;
}
예제 #2
0
파일: net.c 프로젝트: bigzz/strace_android
static int
do_pipe(struct tcb *tcp, int flags_arg)
{
    if (exiting(tcp)) {
        if (syserror(tcp)) {
            tprintf("%#lx", tcp->u_arg[0]);
        } else {
#ifdef HAVE_GETRVAL2
            if (flags_arg < 0) {
                tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
            } else
#endif
            {
                int fds[2];

                if (umove(tcp, tcp->u_arg[0], &fds) < 0)
                    tprintf("%#lx", tcp->u_arg[0]);
                else
                    tprintf("[%u, %u]", fds[0], fds[1]);
            }
        }
        if (flags_arg >= 0) {
            tprints(", ");
            printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
        }
    }
    return 0;
}
예제 #3
0
파일: alpha.c 프로젝트: Saruta/strace
static int
decode_getxxid(struct tcb *tcp, const char *what)
{
	if (entering(tcp))
		return 0;

	long rval = getrval2(tcp);
	if (rval == -1)
		return 0;
	static const char const fmt[] = "%s %ld";
	static char outstr[sizeof(fmt) + 3 * sizeof(rval)];
	snprintf(outstr, sizeof(outstr), fmt, what, rval);
	tcp->auxstr = outstr;
	return RVAL_STR;
}
예제 #4
0
static int
do_pipe(struct tcb *tcp, int flags_arg)
{
	if (exiting(tcp)) {
		if (syserror(tcp)) {
			printaddr(tcp->u_arg[0]);
		} else {
#ifdef HAVE_GETRVAL2
			if (flags_arg < 0) {
				printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
			} else
#endif
				decode_pair_fd(tcp, tcp->u_arg[0]);
		}
		if (flags_arg >= 0) {
			tprints(", ");
			printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
		}
	}
	return 0;
}
예제 #5
0
static int
do_pipe(struct tcb *tcp, int flags_arg)
{
	if (exiting(tcp)) {
		if (syserror(tcp)) {
			tprintf("%#lx", tcp->u_arg[0]);
		} else {
#ifdef HAVE_GETRVAL2
			if (flags_arg < 0)
				tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
			else
#endif
				printpair_int(tcp, tcp->u_arg[0], "%u");
		}
		if (flags_arg >= 0) {
			tprints(", ");
			printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
		}
	}
	return 0;
}