blob: 1830d8b6dae5326f1ddceefe7e27e3c7ef1198d8 [file] [log] [blame]
njn2521d322005-05-08 14:45:13 +00001
2/*--------------------------------------------------------------------*/
3/*--- System call wrappers, etc. pub_core_syscalls.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_SYSCALLS_H
32#define __PUB_CORE_SYSCALLS_H
33
34//--------------------------------------------------------------------
35// PURPOSE: This module contains all the syscall junk: mostly wrappers,
36// but also the code that executes them, and related stuff.
37//--------------------------------------------------------------------
38
39extern HChar* VG_(resolve_filename_nodup)(Int fd);
40extern HChar* VG_(resolve_filename)(Int fd);
41
42extern void VG_(client_syscall) ( ThreadId tid );
43
44extern void VG_(post_syscall) ( ThreadId tid );
45
46// Fix up the thread's state because a syscall may have been
47// interrupted with a signal. Returns True if the syscall completed
48// (either interrupted or finished normally), or False if it was
49// restarted (or the signal didn't actually interrupt a syscall).
50extern void VGA_(interrupted_syscall)(ThreadId tid,
51 struct vki_ucontext *uc,
52 Bool restart);
53
54extern Bool VG_(is_kerror) ( Word res );
55
56/* Internal atfork handlers */
57typedef void (*vg_atfork_t)(ThreadId);
58extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child);
59
60/* fd leakage calls. */
61extern void VG_(init_preopened_fds) ( void );
62extern void VG_(show_open_fds) ( void );
63
64#endif // __PUB_CORE_SYSCALLS_H
65
66/*--------------------------------------------------------------------*/
67/*--- end ---*/
68/*--------------------------------------------------------------------*/
69