Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero


 435 /*
 436  * We define and export this version of assfail() just because libaio
 437  * used to define and export it, needlessly.  Now that libaio is folded
 438  * into libc, we need to continue this for ABI/version reasons.
 439  * We don't use "#pragma weak assfail __assfail" in order to avoid
 440  * warnings from the check_fnames utility at build time for libraries
 441  * that define their own version of assfail().
 442  */
 443 void
 444 assfail(const char *assertion, const char *filename, int line_num)
 445 {
 446         __assfail(assertion, filename, line_num);
 447 }
 448 
 449 void
 450 assfail3(const char *assertion, uintmax_t lv, const char *op, uintmax_t rv,
 451     const char *filename, int line_num)
 452 {
 453         char buf[1000];
 454         (void) strcpy(buf, assertion);
 455         (void) strcat(buf, " (0x");
 456         ultos((uint64_t)lv, 16, buf + strlen(buf));
 457         (void) strcat(buf, " ");
 458         (void) strcat(buf, op);
 459         (void) strcat(buf, " 0x");
 460         ultos((uint64_t)rv, 16, buf + strlen(buf));
 461         (void) strcat(buf, ")");
 462         __assfail(buf, filename, line_num);
 463 }


 435 /*
 436  * We define and export this version of assfail() just because libaio
 437  * used to define and export it, needlessly.  Now that libaio is folded
 438  * into libc, we need to continue this for ABI/version reasons.
 439  * We don't use "#pragma weak assfail __assfail" in order to avoid
 440  * warnings from the check_fnames utility at build time for libraries
 441  * that define their own version of assfail().
 442  */
 443 void
 444 assfail(const char *assertion, const char *filename, int line_num)
 445 {
 446         __assfail(assertion, filename, line_num);
 447 }
 448 
 449 void
 450 assfail3(const char *assertion, uintmax_t lv, const char *op, uintmax_t rv,
 451     const char *filename, int line_num)
 452 {
 453         char buf[1000];
 454         (void) strcpy(buf, assertion);
 455         (void) strcat(buf, " (");
 456         ultos((uint64_t)lv, 16, buf + strlen(buf));
 457         (void) strcat(buf, " ");
 458         (void) strcat(buf, op);
 459         (void) strcat(buf, " ");
 460         ultos((uint64_t)rv, 16, buf + strlen(buf));
 461         (void) strcat(buf, ")");
 462         __assfail(buf, filename, line_num);
 463 }