njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Process-related libc stuff pub_tool_libcproc.h ---*/ |
| 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
sewardj | 9ebd6e0 | 2007-01-08 06:01:59 +0000 | [diff] [blame] | 10 | Copyright (C) 2000-2007 Julian Seward |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 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_TOOL_LIBCPROC_H |
| 32 | #define __PUB_TOOL_LIBCPROC_H |
| 33 | |
| 34 | /* --------------------------------------------------------------------- |
| 35 | Command-line and environment stuff |
| 36 | ------------------------------------------------------------------ */ |
| 37 | |
njn | d111d10 | 2005-09-13 00:46:27 +0000 | [diff] [blame] | 38 | /* Client args and environment. Note that VG_(client_argv)[] can be written |
| 39 | to by the client, so you should check each entry is non-NULL before |
| 40 | printing. VG_(client_envp) can be inspected with VG_(getenv)(). */ |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 41 | extern Char** VG_(client_envp); |
| 42 | |
| 43 | /* Looks up VG_(client_envp) */ |
| 44 | extern Char* VG_(getenv) ( Char* name ); |
| 45 | |
njn | 8d9965c | 2005-06-12 17:47:24 +0000 | [diff] [blame] | 46 | /* Path to all our library/aux files */ |
| 47 | extern const Char *VG_(libdir); |
| 48 | |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 49 | /* --------------------------------------------------------------------- |
| 50 | Important syscalls |
| 51 | ------------------------------------------------------------------ */ |
| 52 | |
| 53 | extern Int VG_(waitpid)( Int pid, Int *status, Int options ); |
| 54 | extern Int VG_(system) ( Char* cmd ); |
| 55 | |
| 56 | /* --------------------------------------------------------------------- |
| 57 | Resource limits |
| 58 | ------------------------------------------------------------------ */ |
| 59 | |
| 60 | extern Int VG_(getrlimit) ( Int resource, struct vki_rlimit *rlim ); |
| 61 | extern Int VG_(setrlimit) ( Int resource, const struct vki_rlimit *rlim ); |
| 62 | |
| 63 | /* --------------------------------------------------------------------- |
| 64 | pids, etc |
| 65 | ------------------------------------------------------------------ */ |
| 66 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 67 | extern Int VG_(gettid) ( void ); |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 68 | extern Int VG_(getpid) ( void ); |
| 69 | extern Int VG_(getppid) ( void ); |
| 70 | extern Int VG_(getpgrp) ( void ); |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 71 | extern Int VG_(geteuid) ( void ); |
| 72 | extern Int VG_(getegid) ( void ); |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 73 | |
| 74 | /* --------------------------------------------------------------------- |
| 75 | Timing |
| 76 | ------------------------------------------------------------------ */ |
| 77 | |
njn | b63ca16 | 2007-03-28 12:16:55 +0000 | [diff] [blame^] | 78 | // Returns the number of milliseconds passed since the progam started |
| 79 | // (roughly; it gets initialised partway through Valgrind's initialisation |
| 80 | // steps). |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 81 | extern UInt VG_(read_millisecond_timer) ( void ); |
| 82 | |
| 83 | #endif // __PUB_TOOL_LIBCPROC_H |
| 84 | |
| 85 | /*--------------------------------------------------------------------*/ |
| 86 | /*--- end ---*/ |
| 87 | /*--------------------------------------------------------------------*/ |