Page MenuHomeFreeBSD

D49856.diff
No OneTemporary

D49856.diff

diff --git a/stand/kboot/include/util.h b/stand/kboot/include/util.h
--- a/stand/kboot/include/util.h
+++ b/stand/kboot/include/util.h
@@ -7,4 +7,5 @@
#pragma once
bool file2str(const char *fn, char *buffer, size_t buflen);
+bool file2u32(const char *fn, uint32_t *val);
bool file2u64(const char *fn, uint64_t *val);
diff --git a/stand/kboot/libkboot/util.c b/stand/kboot/libkboot/util.c
--- a/stand/kboot/libkboot/util.c
+++ b/stand/kboot/libkboot/util.c
@@ -44,3 +44,16 @@
*val = v;
return true;
}
+
+bool
+file2u32(const char *fn, uint32_t *val)
+{
+ unsigned long v;
+ char buffer[80];
+
+ if (!file2str(fn, buffer, sizeof(buffer)))
+ return false;
+ v = strtoul(buffer, NULL, 0); /* XXX check return values? */
+ *val = v;
+ return true;
+}

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 22, 10:30 PM (16 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17683336
Default Alt Text
D49856.diff (758 B)

Event Timeline