int mmap_full_file(const char *filename, int open_mode, void **map,
size_t *size, int *fd_ptr);
int osl_munmap(void *start, size_t length);
+int write_all(int fd, const char *buf, size_t *len);
+int write_file(const char *filename, const void *buf, size_t size);
+int truncate_file(const char *filename, off_t size);
/**
* A wrapper for mkdir(2).
return -ERRNO_TO_ERROR(errno);
return 1;
}
+
+_static_inline_ int osl_stat(const char *path, struct stat *buf)
+{
+ if (stat(path, buf) >= 0)
+ return 1;
+ return -ERRNO_TO_ERROR(errno);
+}