summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/os/fakebop.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc/os/fakebop.c')
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index d22f55b58e..60982a49fc 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -2916,10 +2916,8 @@ boot_compinfo(int fd, struct compinfo *cbp)
return (0);
}
-#define BP_MAX_STRLEN 32
-
/*
- * Get value for given boot property
+ * Get an integer value for given boot property
*/
int
bootprop_getval(const char *prop_name, u_longlong_t *prop_value)
@@ -2929,7 +2927,7 @@ bootprop_getval(const char *prop_name, u_longlong_t *prop_value)
u_longlong_t value;
boot_prop_len = BOP_GETPROPLEN(bootops, prop_name);
- if (boot_prop_len < 0 || boot_prop_len > sizeof (str) ||
+ if (boot_prop_len < 0 || boot_prop_len >= sizeof (str) ||
BOP_GETPROP(bootops, prop_name, str) < 0 ||
kobj_getvalue(str, &value) == -1)
return (-1);
@@ -2939,3 +2937,15 @@ bootprop_getval(const char *prop_name, u_longlong_t *prop_value)
return (0);
}
+
+int
+bootprop_getstr(const char *prop_name, char *buf, size_t buflen)
+{
+ int boot_prop_len = BOP_GETPROPLEN(bootops, prop_name);
+
+ if (boot_prop_len < 0 || boot_prop_len >= buflen ||
+ BOP_GETPROP(bootops, prop_name, buf) < 0)
+ return (-1);
+
+ return (0);
+}