1 /*****************************************************************************
2 * RRDtool 1.3rc8 Copyright by Tobi Oetiker, 1997-2008
3 * This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
4 * & Tobias Oetiker
5 * Distributed under the GPL
6 *****************************************************************************
7 * rrd_not_thread_safe.c Contains routines used when thread safety is not
8 * an issue
9 *****************************************************************************
10 * $Id$
11 *************************************************************************** */
12 #include "rrd.h"
13 #include "rrd_tool.h"
14 #define MAXLEN 4096
15 #define ERRBUFLEN 256
17 /* The global context is very useful in the transition period to even
18 more thread-safe stuff, it can be used whereever we need a context
19 and do not need to worry about concurrency. */
20 static rrd_context_t global_ctx = {
21 "",
22 ""
23 };
25 /* #include <stdarg.h> */
27 rrd_context_t *rrd_get_context(
28 void)
29 {
30 return &global_ctx;
31 }
33 /* how ugly that is!!! - make sure strerror is what it should be. It
34 might be redefined to help in keeping other modules thread safe by
35 silently turning misplaced strerror into rrd_strerror, but here
36 this turns recursive! */
37 #undef strerror
38 const char *rrd_strerror(
39 int err)
40 {
41 return strerror(err);
42 }