blob: 69afe3256586d3e2f742d5bb3cdf6e7bf283d264 [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
njned8b05d2005-06-12 20:51:09 +000041/* The directory we look for all our auxillary files in. Useful for
42 running Valgrind out of a build tree without having to do "make install". */
njnf39e9a32005-06-12 02:43:17 +000043#define VALGRINDLIB "VALGRINDLIB"
44
45/* Additional command-line arguments; they are overridden by actual
46 command-line option. Each argument is separated by spaces. There
47 is no quoting mechanism. */
48#define VALGRINDOPTS "VALGRIND_OPTS"
49
50/* If this variable is present in the environment, then valgrind will
51 not parse the command line for options at all; all options come
52 from this variable. Arguments are terminated by ^A (\001). There
53 is no quoting mechanism.
54
55 This variable is not expected to be set by anything other than
56 Valgrind itself, as part of its handling of execve with
57 --trace-children=yes. This variable should not be present in the
58 client environment. */
59#define VALGRINDCLO "_VALGRIND_CLO"
60
njn75b65aa2005-06-19 19:25:44 +000061// Client's executable file descriptor.
62extern Int VG_(clexecfd);
63
njnf39e9a32005-06-12 02:43:17 +000064// Client's original rlimit data and rlimit stack
65extern struct vki_rlimit VG_(client_rlimit_data);
66extern struct vki_rlimit VG_(client_rlimit_stack);
67
68// Environment manipulations
69extern Char **VG_(env_setenv) ( Char ***envp, const Char* varname,
70 const Char *val );
71extern void VG_(env_unsetenv) ( Char **env, const Char *varname );
72extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );
73
74// misc
75extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
76extern void VG_(nanosleep) ( struct vki_timespec * );
77
78// atfork
79typedef void (*vg_atfork_t)(ThreadId);
njn310ed282005-06-26 15:11:37 +000080extern void VG_(atfork_child) ( vg_atfork_t child_action );
81extern void VG_(do_atfork_child) ( ThreadId tid );
njnf39e9a32005-06-12 02:43:17 +000082
83#endif // __PUB_CORE_LIBCPROC_H
84
85/*--------------------------------------------------------------------*/
86/*--- end ---*/
87/*--------------------------------------------------------------------*/