Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115255501
D49856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
758 B
Referenced Files
None
Subscribers
None
D49856.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D49856: kboot: Add option to parse 32-bit quantity
Attached
Detach File
Event Timeline
Log In to Comment