]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fd.h
Rename para_chdir() and make it an inline function.
[osl.git] / fd.h
diff --git a/fd.h b/fd.h
index 4b802062d7207344ef3441542a3fe090ba18bd67..7fdff916cec60425719772e55bc44027f1d54f86 100644 (file)
--- a/fd.h
+++ b/fd.h
@@ -14,6 +14,7 @@ int mmap_full_file(const char *filename, int open_mode, void **map,
 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).
@@ -46,3 +47,10 @@ _static_inline_ int osl_rename(const char *old_path, const char *new_path)
                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);
+}