2 * Copyright (C) 2006-2008 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file fd.h exported symbols from fd.c */
9 int osl_open(const char *path, int flags, mode_t mode);
10 int para_opendir(const char *dirname, DIR **dir, int *cwd);
11 int para_fchdir(int fd);
12 int mmap_full_file(const char *filename, int open_mode, void **map,
13 size_t *size, int *fd_ptr);
14 int osl_munmap(void *start, size_t length);
17 * A wrapper for mkdir(2).
19 * \param path Name of the directory to create.
20 * \param mode The permissions to use.
24 static inline int osl_mkdir(const char *path, mode_t mode)
26 if (!mkdir(path, mode))
28 return -ERRNO_TO_ERROR(errno);
32 * A wrapper for rename(2).
34 * \param old_path The source path.
35 * \param new_path The destination path.
41 _static_inline_ int osl_rename(const char *old_path, const char *new_path)
43 if (rename(old_path, new_path) < 0)
44 return -ERRNO_TO_ERROR(errno);