Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c (revision 257859) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c (working copy) @@ -2134,7 +2134,7 @@ localtime_r(&time, &t) == NULL || strftime(propbuf, proplen, "%a %b %e %k:%M %Y", &t) == 0) - (void) snprintf(propbuf, proplen, "%llu", val); + (void) snprintf(propbuf, proplen, "%ju", (intmax_t)val); } break; @@ -2648,7 +2648,7 @@ return (err); if (literal) { - (void) snprintf(propbuf, proplen, "%llu", propvalue); + (void) snprintf(propbuf, proplen, "%ju", (intmax_t)propvalue); } else if (propvalue == 0 && (type == ZFS_PROP_USERQUOTA || type == ZFS_PROP_GROUPQUOTA)) { (void) strlcpy(propbuf, "none", proplen); @@ -2705,7 +2705,7 @@ return (err); if (literal) { - (void) snprintf(propbuf, proplen, "%llu", propvalue); + (void) snprintf(propbuf, proplen, "%ju", (intmax_t)propvalue); } else { zfs_nicenum(propvalue, propbuf, proplen); } Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c (revision 257859) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c (working copy) @@ -116,7 +116,7 @@ (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Unable to determine path or stats for " - "object %lld in %s"), obj, dsname); + "object %jd in %s"), (intmax_t)obj, dsname); return (-1); } } @@ -409,8 +409,8 @@ } else { (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, - "next allocated object (> %lld) find failure"), - zc.zc_obj); + "next allocated object (> %jd) find failure"), + (intmax_t)(zc.zc_obj)); di->zerr = errno; break; } Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c (revision 257859) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c (working copy) @@ -261,7 +261,7 @@ case ZPOOL_PROP_GUID: intval = zpool_get_prop_int(zhp, prop, &src); - (void) snprintf(buf, len, "%llu", intval); + (void) snprintf(buf, len, "%ju", (uintmax_t)intval); break; case ZPOOL_PROP_ALTROOT: @@ -337,7 +337,7 @@ } /* FALLTHROUGH */ default: - (void) snprintf(buf, len, "%llu", intval); + (void) snprintf(buf, len, "%ju", (uintmax_t)intval); } break; @@ -1472,15 +1472,15 @@ } if (loss > 120) { (void) printf(dgettext(TEXT_DOMAIN, - "%s approximately %lld "), + "%s approximately %jd "), dryrun ? "Would discard" : "Discarded", - (loss + 30) / 60); + (intmax_t)(loss + 30) / 60); (void) printf(dgettext(TEXT_DOMAIN, "minutes of transactions.\n")); } else if (loss > 0) { (void) printf(dgettext(TEXT_DOMAIN, - "%s approximately %lld "), - dryrun ? "Would discard" : "Discarded", loss); + "%s approximately %jd "), + dryrun ? "Would discard" : "Discarded", (intmax_t)loss); (void) printf(dgettext(TEXT_DOMAIN, "seconds of transactions.\n")); } @@ -1533,12 +1533,13 @@ if (loss > 120) { (void) printf(dgettext(TEXT_DOMAIN, - "Approximately %lld minutes of data\n" - "\tmust be discarded, irreversibly. "), (loss + 30) / 60); + "Approximately %jd minutes of data\n" + "\tmust be discarded, irreversibly. "), + (intmax_t)(loss + 30) / 60); } else if (loss > 0) { (void) printf(dgettext(TEXT_DOMAIN, - "Approximately %lld seconds of data\n" - "\tmust be discarded, irreversibly. "), loss); + "Approximately %jd seconds of data\n" + "\tmust be discarded, irreversibly. "), (intmax_t)loss); } if (edata != 0 && edata != UINT64_MAX) { if (edata == 1) { @@ -2524,7 +2525,7 @@ libzfs_handle_t *hdl = zhp->zpool_hdl; (void) snprintf(msg, sizeof (msg), - dgettext(TEXT_DOMAIN, "cannot fault %llu"), guid); + dgettext(TEXT_DOMAIN, "cannot fault %ju"), (uintmax_t)guid); (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); zc.zc_guid = guid; @@ -2559,7 +2560,7 @@ libzfs_handle_t *hdl = zhp->zpool_hdl; (void) snprintf(msg, sizeof (msg), - dgettext(TEXT_DOMAIN, "cannot degrade %llu"), guid); + dgettext(TEXT_DOMAIN, "cannot degrade %ju"), (uintmax_t)guid); (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); zc.zc_guid = guid; @@ -3227,8 +3228,8 @@ libzfs_handle_t *hdl = zhp->zpool_hdl; (void) snprintf(msg, sizeof (msg), - dgettext(TEXT_DOMAIN, "cannot clear errors for %llx"), - guid); + dgettext(TEXT_DOMAIN, "cannot clear errors for %jx"), + (intmax_t)guid); (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); zc.zc_guid = guid; @@ -3793,7 +3794,8 @@ if (dsobj == 0) { /* special case for the MOS */ - (void) snprintf(pathname, len, ":<0x%llx>", obj); + (void) snprintf(pathname, len, ":<0x%jx>", + (intmax_t)obj); return; } @@ -3803,8 +3805,8 @@ if (ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) { /* just write out a path of two object numbers */ - (void) snprintf(pathname, len, "<0x%llx>:<0x%llx>", - dsobj, obj); + (void) snprintf(pathname, len, "<0x%jx>:<0x%jx>", + (intmax_t)dsobj, (intmax_t)obj); return; } (void) strlcpy(dsname, zc.zc_value, sizeof (dsname)); @@ -3825,7 +3827,7 @@ dsname, zc.zc_value); } } else { - (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, obj); + (void) snprintf(pathname, len, "%s:<0x%jx>", dsname, (intmax_t)obj); } free(mntpnt); } Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c (revision 257859) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c (working copy) @@ -2083,7 +2083,7 @@ needagain = B_TRUE; else progress = B_TRUE; - sprintf(guidname, "%lu", thisguid); + sprintf(guidname, "%ju", (uintmax_t)thisguid); nvlist_add_boolean(deleted, guidname); continue; } @@ -2140,7 +2140,7 @@ needagain = B_TRUE; else progress = B_TRUE; - sprintf(guidname, "%lu", parent_fromsnap_guid); + sprintf(guidname, "%ju", (uintmax_t)parent_fromsnap_guid); nvlist_add_boolean(deleted, guidname); continue; } @@ -2173,7 +2173,7 @@ if (stream_parent_fromsnap_guid != 0 && parent_fromsnap_guid != 0 && stream_parent_fromsnap_guid != parent_fromsnap_guid) { - sprintf(guidname, "%lu", parent_fromsnap_guid); + sprintf(guidname, "%ju", (uintmax_t)parent_fromsnap_guid); if (nvlist_exists(deleted, guidname)) { progress = B_TRUE; needagain = B_TRUE; @@ -3081,8 +3081,8 @@ zfs_nicenum(bytes, buf1, sizeof (buf1)); zfs_nicenum(bytes/delta, buf2, sizeof (buf1)); - (void) printf("received %sB stream in %lu seconds (%sB/sec)\n", - buf1, delta, buf2); + (void) printf("received %sB stream in %ld seconds (%sB/sec)\n", + buf1, (unsigned long)delta, buf2); } return (0); Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c (revision 257859) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c (working copy) @@ -586,13 +586,13 @@ u = " KMGTPE"[index]; if (index == 0) { - (void) snprintf(buf, buflen, "%llu", n); + (void) snprintf(buf, buflen, "%ju", (uintmax_t)n); } else if ((num & ((1ULL << 10 * index) - 1)) == 0) { /* * If this is an even multiple of the base, always display * without any decimal precision. */ - (void) snprintf(buf, buflen, "%llu%c", n, u); + (void) snprintf(buf, buflen, "%ju%c", (uintmax_t)n, u); } else { /* * We want to choose a precision that reflects the best choice