nir: add callback to nir_remove_dead_variables()
[mesa.git] / src / util / os_file.c
index 228f1e823c5e388db01d0deb335e25d3c44d1af2..5771b27e5d0730d33a0a3a95235c2432320eb9a8 100644 (file)
@@ -67,7 +67,7 @@ readN(int fd, char *buf, size_t len)
 }
 
 char *
-os_read_file(const char *filename)
+os_read_file(const char *filename, size_t *size)
 {
    /* Note that this also serves as a slight margin to avoid a 2x grow when
     * the file is just a few bytes larger when we read it than when we
@@ -130,6 +130,9 @@ os_read_file(const char *filename)
 
    buf[offset] = '\0';
 
+   if (size)
+      *size = offset;
+
    return buf;
 }
 
@@ -150,7 +153,7 @@ os_same_file_description(int fd1, int fd2)
 #include "u_debug.h"
 
 char *
-os_read_file(const char *filename)
+os_read_file(const char *filename, size_t *size)
 {
    errno = -ENOSYS;
    return NULL;