diff options
author | Don Brady <don.brady@delphix.com> | 2020-02-05 14:01:39 -0700 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-02-07 07:51:26 -0700 |
commit | d8ab6e129d75d7c3f21a7909bf811a3de65faea8 (patch) | |
tree | e9eef2432a5a3e513cd5d156d0aee1b241dbb529 /usr/src/lib/libzfs/common/libzfs_util.c | |
parent | fdefee4c75361dc5ea202f7e1f7c49f8a27ea043 (diff) | |
download | illumos-gate-d8ab6e129d75d7c3f21a7909bf811a3de65faea8.tar.gz |
12235 Add libzutil for libzfs or libzpool consumers
Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_util.c')
-rw-r--r-- | usr/src/lib/libzfs/common/libzfs_util.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c index 75eb9722b3..3285cf7ce0 100644 --- a/usr/src/lib/libzfs/common/libzfs_util.c +++ b/usr/src/lib/libzfs/common/libzfs_util.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com> * Copyright (c) 2017 Datto Inc. @@ -31,6 +31,7 @@ * Internal utility routines for the ZFS library. */ +#include <ctype.h> #include <errno.h> #include <fcntl.h> #include <libintl.h> @@ -38,8 +39,6 @@ #include <stdio.h> #include <stdlib.h> #include <strings.h> -#include <unistd.h> -#include <ctype.h> #include <math.h> #include <sys/filio.h> #include <sys/mnttab.h> @@ -54,6 +53,7 @@ #include "zfs_prop.h" #include "zfs_comutil.h" #include "zfeature_common.h" +#include <libzutil.h> int libzfs_errno(libzfs_handle_t *hdl) @@ -630,15 +630,6 @@ zfs_strdup(libzfs_handle_t *hdl, const char *str) return (ret); } -/* - * Convert a number to an appropriately human-readable output. - */ -void -zfs_nicenum(uint64_t num, char *buf, size_t buflen) -{ - nicenum(num, buf, buflen); -} - void libzfs_print_on_error(libzfs_handle_t *hdl, boolean_t printerr) { @@ -1622,20 +1613,3 @@ zfs_get_hole_count(const char *path, uint64_t *count, uint64_t *bs) } return (0); } - -ulong_t -get_system_hostid(void) -{ - char *env; - - /* - * Allow the hostid to be subverted for testing. - */ - env = getenv("ZFS_HOSTID"); - if (env) { - ulong_t hostid = strtoull(env, NULL, 16); - return (hostid & 0xFFFFFFFF); - } - - return (gethostid()); -} |