static int
decode_open(struct tcb *tcp, int offset)
{
- if (entering(tcp)) {
- printpath(tcp, tcp->u_arg[offset]);
- tprints(", ");
- /* flags */
- tprint_open_modes(tcp->u_arg[offset + 1]);
- if (tcp->u_arg[offset + 1] & O_CREAT) {
- /* mode */
- tprintf(", %#lo", tcp->u_arg[offset + 2]);
- }
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ /* flags */
+ tprint_open_modes(tcp->u_arg[offset + 1]);
+ if (tcp->u_arg[offset + 1] & O_CREAT) {
+ /* mode */
+ tprintf(", %#lo", tcp->u_arg[offset + 2]);
}
- return RVAL_FD;
+
+ return RVAL_DECODED | RVAL_FD;
}
-int
-sys_open(struct tcb *tcp)
+SYS_FUNC(open)
{
return decode_open(tcp, 0);
}
-int
-sys_openat(struct tcb *tcp)
+SYS_FUNC(openat)
{
- if (entering(tcp))
- print_dirfd(tcp, tcp->u_arg[0]);
+ print_dirfd(tcp, tcp->u_arg[0]);
return decode_open(tcp, 1);
}
-int
-sys_creat(struct tcb *tcp)
+SYS_FUNC(creat)
{
- if (entering(tcp)) {
- printpath(tcp, tcp->u_arg[0]);
- tprintf(", %#lo", tcp->u_arg[1]);
- }
- return RVAL_FD;
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %#lo", tcp->u_arg[1]);
+
+ return RVAL_DECODED | RVAL_FD;
}