genode/base-linux/src/core/include/resource_path.h
Norman Feske de69ee2e66 Linux: cleanup system-call bindings
This patch simplifies the system call bindings. The common syscall
bindings in 'src/platform/' have been reduced to the syscalls needed by
non-core programs. The additional syscalls that are needed solely by
core have been moved to 'src/core/include/core_linux_syscalls.h'.
Furthermore, the resource path is not used outside of core anymore.
Hence, we could get rid of the rpath library. The resource-path code has
been moved to 'src/core/include/resource_path.h'. The IPC-related parts
of 'src/platform' have been moved to the IPC library. So there is now a
clean separation between low-level syscall bindings (in 'src/platform')
and higher-level code.

The code for the socket-descriptor registry is now located in the
'src/base/ipc/socket_descriptor_registry.h' header. The interface is
separated from 'ipc.cc' because core needs to access the registry from
outside the ipc library.
2012-11-05 17:31:04 +01:00

45 lines
855 B
C

/*
* \brief Genode resource path
* \author Norman Feske
* \date 2012-08-10
*/
/*
* Copyright (C) 2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__RPATH_H_
#define _CORE__INCLUDE__RPATH_H_
/* Linux syscall bindings */
#include <linux_syscalls.h>
/* Genode includes */
#include <base/snprintf.h>
/**
* Return resource path for Genode
*
* Genode creates files for dataspaces and endpoints under in this directory.
*/
static inline char const *resource_path()
{
struct Resource_path
{
char string[32];
Resource_path()
{
Genode::snprintf(string, sizeof(string), "/tmp/genode-%d", lx_getuid());
}
};
static Resource_path path;
return path.string;
}
#endif /* _CORE__INCLUDE__RPATH_H_ */