mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-06 05:54:15 +00:00
ca971bbfd8
This patch changes the top-level directory layout as a preparatory step for improving the tools for managing 3rd-party source codes. The rationale is described in the issue referenced below. Issue #1082
40 lines
663 B
C++
40 lines
663 B
C++
/*
|
|
* \brief Linux utilities
|
|
* \author Christian Helmuth
|
|
* \date 2013-11-11
|
|
*/
|
|
|
|
#ifndef _LX_UTIL_H_
|
|
#define _LX_UTIL_H_
|
|
|
|
/* Genode includes */
|
|
#include <file_system_session/file_system_session.h>
|
|
|
|
/* Linux includes */
|
|
#define _FILE_OFFSET_BITS 64
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
#include <dirent.h>
|
|
#include <sys/stat.h>
|
|
|
|
|
|
namespace File_system {
|
|
int access_mode(File_system::Mode const &mode);
|
|
}
|
|
|
|
|
|
int File_system::access_mode(File_system::Mode const &mode)
|
|
{
|
|
switch (mode) {
|
|
case STAT_ONLY:
|
|
case READ_ONLY: return O_RDONLY;
|
|
case WRITE_ONLY: return O_WRONLY;
|
|
case READ_WRITE: return O_RDWR;
|
|
}
|
|
|
|
return O_RDONLY;
|
|
}
|
|
|
|
#endif
|