Define Genode::size_t as unsigned long

Fixes #2105
This commit is contained in:
Norman Feske
2016-09-15 14:40:37 +02:00
committed by Christian Helmuth
parent 7bed3967ae
commit e370e08e01
128 changed files with 280 additions and 257 deletions

View File

@ -16,8 +16,11 @@
/* basic Linux syscall bindings */
#include <linux_syscalls.h>
#define size_t __SIZE_TYPE__ /* see comment in 'linux_syscalls.h' */
#include <sys/stat.h>
#include <fcntl.h>
#undef size_t
/*******************************************************

View File

@ -90,9 +90,9 @@ class Stack_area_ram_session : public Genode::Ram_session
int transfer_quota(Genode::Ram_session_capability, Genode::size_t) { return 0; }
size_t quota() { return 0; }
Genode::size_t quota() { return 0; }
size_t used() { return 0; }
Genode::size_t used() { return 0; }
};

View File

@ -18,10 +18,8 @@
#include <base/thread.h>
#include <rm_session/rm_session.h>
#include <linux_syscalls.h>
/* Linux includes */
#include <sys/mman.h>
#include <linux_syscalls.h>
extern Genode::addr_t _stack_area_start;
@ -47,8 +45,8 @@ static inline void flush_stack_area()
{
using namespace Genode;
void * const base = (void *)stack_area_virtual_base();
size_t const size = stack_area_virtual_size();
void * const base = (void *)stack_area_virtual_base();
Genode::size_t const size = stack_area_virtual_size();
int ret;
if ((ret = lx_munmap(base, size)) < 0) {
@ -61,6 +59,7 @@ static inline void flush_stack_area()
static inline Genode::addr_t reserve_stack_area()
{
using namespace Genode;
using Genode::size_t;
int const flags = MAP_ANONYMOUS | MAP_PRIVATE;
int const prot = PROT_NONE;

View File

@ -28,8 +28,6 @@
/* Linux includes */
#include <linux_syscalls.h>
#include <sys/un.h>
#include <sys/socket.h>
using namespace Genode;
@ -69,7 +67,7 @@ struct Protocol_header
/* badge of invoked object (on call) / exception code (on reply) */
unsigned long protocol_word;
size_t num_caps;
Genode::size_t num_caps;
/* badges of the transferred capability arguments */
unsigned long badges[Msgbuf_base::MAX_CAPS_PER_MSG];

View File

@ -43,7 +43,7 @@ extern "C" int stdout_write(char const *);
extern "C" __attribute__((weak)) int stdout_write(char const *s)
{
raw(s);
return strlen(s);
return Genode::strlen(s);
}
/**

View File

@ -145,10 +145,12 @@ int main()
#include <base/thread.h>
#include <base/env.h>
/* libc includes */
/* host libc includes */
#define size_t __SIZE_TYPE__ /* see comment in 'linux_syscalls.h' */
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#undef size_t
using namespace Genode;

View File

@ -32,18 +32,28 @@
#define _GNU_SOURCE 1 /* needed to enable the definition of 'stat64' */
#endif
/* Genode includes */
#include <util/string.h>
#include <base/printf.h>
#include <base/snprintf.h>
#include <base/log.h>
/*
* Resolve ambiguity between 'Genode::size_t' and the host's header's 'size_t'.
*/
#define size_t __SIZE_TYPE__
/* Linux includes */
#include <linux/futex.h>
#include <unistd.h>
#include <signal.h>
#include <sched.h>
#include <sys/syscall.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <sys/mman.h>
/* Genode includes */
#include <util/string.h>
#include <base/printf.h>
#include <base/snprintf.h>
#include <base/log.h>
#undef size_t
/***********************************
@ -197,7 +207,7 @@ inline void *lx_mmap(void *start, Genode::size_t length, int prot, int flags,
}
inline int lx_munmap(void *addr, size_t length)
inline int lx_munmap(void *addr, Genode::size_t length)
{
return lx_syscall(SYS_munmap, addr, length);
}