示例#1
0
/* TODO - backport changes from src/common/kevent.c kevent_dump() */
const char *
kevent_to_str(struct kevent *kev)
{
    char buf[512];

    snprintf(&buf[0], sizeof(buf), 
            "[ident=%d, filter=%d, %s, %s, data=%d, udata=%p]",
            (u_int) kev->ident,
            kev->filter,
            kevent_flags_dump(kev),
            kevent_fflags_dump(kev),
            (int) kev->data,
            kev->udata);

    return (strdup(buf));
}
示例#2
0
/* Copied from ../kevent.c kevent_dump() and improved */
const char *
kevent_to_str(struct kevent *kev)
{
    char buf[512];

    snprintf(&buf[0], sizeof(buf), 
            "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, "
	    "ext=[%jx %jx %jx %jx]",
            (uintmax_t) kev->ident,
            kev->filter,
            kevent_flags_dump(kev),
            kevent_fflags_dump(kev),
            (uintmax_t)kev->data,
            kev->udata,
	    (uintmax_t)kev->ext[0],
	    (uintmax_t)kev->ext[1],
	    (uintmax_t)kev->ext[2],
	    (uintmax_t)kev->ext[3]);

    return (strdup(buf));
}