genode/repos/libports/src/lib/libc/rlimit.cc
Norman Feske 2030ae678e Supplement base/log.h with raw output function
This patch introduces the Genode::raw function that prints output
directly via a low-level kernel mechanism, if available.

On base-linux, it replaces the former 'raw_write_str' function.
On base-hw, it replaces the former kernel/log.h interface.

Fixes #2012
2016-06-22 12:21:42 +02:00

39 lines
766 B
C++

/*
* \brief C-library back end
* \author Norman Feske
* \date 2008-11-11
*/
/*
* Copyright (C) 2008-2013 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.
*/
/* Genode includes */
#include <base/log.h>
/* libc includes */
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
extern "C" int __attribute__((weak)) getrlimit(int resource, struct rlimit *rlim)
{
/*
* The pthread init code on Linux calls getrlimit
* for resource 3 (RLIMIT_STACK). In this case, we
* return unlimited.
*/
if (resource == 3) {
rlim->rlim_cur = ~0;
rlim->rlim_max = ~0;
return 0;
}
Genode::raw("getrlimit called, return 0");
return 0;
}