summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-04-10 14:29:07 -0400
committerJon Loeliger <jdl@jdl.com>2013-04-21 14:23:32 -0500
commitcc2c178727cdeca4eb9756637c2e09e50e0856e7 (patch)
treee5d048e177cd803b9416307fc4ab1993f2c06d12 /util.h
parentf8cb5dd94903a5cfa1609695328b8f1d5557367f (diff)
downloaddtc-cc2c178727cdeca4eb9756637c2e09e50e0856e7.tar.gz
utilfdt_read: pass back up the length of data read
For a follow up commit, we want to be able to scan the buffer that was returned to us. In order to do that safely, we need to know how big the buffer actually is, so pass that back if requested. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'util.h')
-rw-r--r--util.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.h b/util.h
index 543a173..3c20b15 100644
--- a/util.h
+++ b/util.h
@@ -80,9 +80,10 @@ char get_escape_char(const char *s, int *i);
* stderr.
*
* @param filename The filename to read, or - for stdin
+ * @param len If non-NULL, the amount of data we managed to read
* @return Pointer to allocated buffer containing fdt, or NULL on error
*/
-char *utilfdt_read(const char *filename);
+char *utilfdt_read(const char *filename, off_t *len);
/**
* Read a device tree file into a buffer. Does not report errors, but only
@@ -91,9 +92,10 @@ char *utilfdt_read(const char *filename);
*
* @param filename The filename to read, or - for stdin
* @param buffp Returns pointer to buffer containing fdt
+ * @param len If non-NULL, the amount of data we managed to read
* @return 0 if ok, else an errno value representing the error
*/
-int utilfdt_read_err(const char *filename, char **buffp);
+int utilfdt_read_err(const char *filename, char **buffp, off_t *len);
/**