Print this page
4142 truss should expand connect() arguments


 472 
 473                 name = sysname(pri, what, raw? -1 : subcode);
 474                 grow(pri, strlen(name) + 1);
 475                 pri->sys_leng = snprintf(pri->sys_string, pri->sys_ssize,
 476                     "%s(", name);
 477                 for (i = 0; i < nargs; i++) {
 478                         arg = pri->sys_args[i];
 479                         x = stp->arg[i];
 480 
 481                         if (!raw && pri->sys_valid &&
 482                             ((i == 0 && x == STG) ||
 483                             (i == 1 && (what == SYS_openat ||
 484                             what == SYS_openat64)))) {  /* already fetched */
 485                                 if (argprinted)
 486                                         outstring(pri, ", ");
 487                                 escape_string(pri, pri->sys_path);
 488                                 argprinted = TRUE;
 489                         } else if (x != NOV && (x != HID || raw)) {
 490                                 if (argprinted)
 491                                         outstring(pri, ", ");
 492                                 if (x == LLO)
 493                                         (*Print[x])(pri, raw, arg,
 494                                             pri->sys_args[++i]);
 495                                 else
 496                                         (*Print[x])(pri, raw, arg);
 497                                 argprinted = TRUE;
 498                         }
 499                 }
 500                 outstring(pri, ")");
 501         }
 502 
 503         return (istraced);
 504 }
 505 #undef  ISREAD
 506 #undef  ISWRITE
 507 
 508 /*
 509  * sysexit() returns non-zero if anything was printed.
 510  */
 511 int
 512 sysexit(private_t *pri, int dotrace)




 472 
 473                 name = sysname(pri, what, raw? -1 : subcode);
 474                 grow(pri, strlen(name) + 1);
 475                 pri->sys_leng = snprintf(pri->sys_string, pri->sys_ssize,
 476                     "%s(", name);
 477                 for (i = 0; i < nargs; i++) {
 478                         arg = pri->sys_args[i];
 479                         x = stp->arg[i];
 480 
 481                         if (!raw && pri->sys_valid &&
 482                             ((i == 0 && x == STG) ||
 483                             (i == 1 && (what == SYS_openat ||
 484                             what == SYS_openat64)))) {  /* already fetched */
 485                                 if (argprinted)
 486                                         outstring(pri, ", ");
 487                                 escape_string(pri, pri->sys_path);
 488                                 argprinted = TRUE;
 489                         } else if (x != NOV && (x != HID || raw)) {
 490                                 if (argprinted)
 491                                         outstring(pri, ", ");
 492                                 if (x == LLO || x == SAD)
 493                                         (*Print[x])(pri, raw, arg,
 494                                             pri->sys_args[++i]);
 495                                 else
 496                                         (*Print[x])(pri, raw, arg);
 497                                 argprinted = TRUE;
 498                         }
 499                 }
 500                 outstring(pri, ")");
 501         }
 502 
 503         return (istraced);
 504 }
 505 #undef  ISREAD
 506 #undef  ISWRITE
 507 
 508 /*
 509  * sysexit() returns non-zero if anything was printed.
 510  */
 511 int
 512 sysexit(private_t *pri, int dotrace)