blob: 2079ed5ba497dc0dfe4be3f62f41092aade38ca5 [file] [log] [blame]
njnf39e9a32005-06-12 02:43:17 +00001
2/*--------------------------------------------------------------------*/
3/*--- Process-related libc stuff. pub_core_libcproc.h ---*/
4/*--------------------------------------------------------------------*/
5
6/*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
9
10 Copyright (C) 2000-2005 Julian Seward
11 jseward@acm.org
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 02111-1307, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
31#ifndef __PUB_CORE_LIBCPROC_H
32#define __PUB_CORE_LIBCPROC_H
33
34//--------------------------------------------------------------------
35// PURPOSE: This module contains libc code related to the process.
36// It's a bit of a mixed bag.
37//--------------------------------------------------------------------
38
39#include "pub_tool_libcproc.h"
40
41/* The directory we look for all our auxillary files in */
42#define VALGRINDLIB "VALGRINDLIB"
43
44/* Additional command-line arguments; they are overridden by actual
45 command-line option. Each argument is separated by spaces. There
46 is no quoting mechanism. */
47#define VALGRINDOPTS "VALGRIND_OPTS"
48
49/* If this variable is present in the environment, then valgrind will
50 not parse the command line for options at all; all options come
51 from this variable. Arguments are terminated by ^A (\001). There
52 is no quoting mechanism.
53
54 This variable is not expected to be set by anything other than
55 Valgrind itself, as part of its handling of execve with
56 --trace-children=yes. This variable should not be present in the
57 client environment. */
58#define VALGRINDCLO "_VALGRIND_CLO"
59
60// Client's original rlimit data and rlimit stack
61extern struct vki_rlimit VG_(client_rlimit_data);
62extern struct vki_rlimit VG_(client_rlimit_stack);
63
64// Environment manipulations
65extern Char **VG_(env_setenv) ( Char ***envp, const Char* varname,
66 const Char *val );
67extern void VG_(env_unsetenv) ( Char **env, const Char *varname );
68extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );
69
70// misc
71extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
72extern void VG_(nanosleep) ( struct vki_timespec * );
73
74// atfork
75typedef void (*vg_atfork_t)(ThreadId);
76extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child);
77extern void VG_(do_atfork_pre) ( ThreadId tid );
78extern void VG_(do_atfork_parent) ( ThreadId tid );
79extern void VG_(do_atfork_child) ( ThreadId tid );
80
81#endif // __PUB_CORE_LIBCPROC_H
82
83/*--------------------------------------------------------------------*/
84/*--- end ---*/
85/*--------------------------------------------------------------------*/