OpenZFS restructuring - zpool

Factor Linux specific functions out of the zpool command.
    
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Sean Eric Fagan <sef@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9333
This commit is contained in:
Matthew Macy
2019-09-30 12:16:06 -07:00
committed by Brian Behlendorf
parent 7bb0c29468
commit 3283f137d7
8 changed files with 445 additions and 352 deletions
+15
View File
@@ -23,10 +23,25 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <libzutil.h>
/*
* Return B_TRUE if "str" is a number string, B_FALSE otherwise.
* Works for integer and floating point numbers.
*/
boolean_t
zfs_isnumber(const char *str)
{
for (; *str; str++)
if (!(isdigit(*str) || (*str == '.')))
return (B_FALSE);
return (B_TRUE);
}
/*
* Convert a number to an appropriately human-readable output.
*/