Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / util / os_file.h
index d691302d12dd095e0dcf8aac2cf1385f1648511e..cf0dc2075952c23a942b33b8b00895947755c060 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef _OS_FILE_H_
 #define _OS_FILE_H_
 
+#include <stdbool.h>
 #include <stdio.h>
 
 #ifdef  __cplusplus
@@ -23,12 +24,31 @@ extern "C" {
 FILE *
 os_file_create_unique(const char *filename, int filemode);
 
+/*
+ * Duplicate a file descriptor, making sure not to keep it open after an exec*()
+ */
+int
+os_dupfd_cloexec(int fd);
+
 /*
  * Read a file.
  * Returns a char* that the caller must free(), or NULL and sets errno.
+ * If size is not null and no error occured it's set to the size of the
+ * file.
  */
 char *
-os_read_file(const char *filename);
+os_read_file(const char *filename, size_t *size);
+
+/*
+ * Try to determine if two file descriptors reference the same file description
+ *
+ * Return values:
+ * - 0:   They reference the same file description
+ * - > 0: They do not reference the same file description
+ * - < 0: Unable to determine whether they reference the same file description
+ */
+int
+os_same_file_description(int fd1, int fd2);
 
 #ifdef __cplusplus
 }