2 * This file is part of the Valgrind port to L4Re.
4 * (c) 2009-2010 Aaron Pohle <apohle@os.inf.tu-dresden.de>,
5 * Bjoern Doebel <doebel@os.inf.tu-dresden.de>
6 * economic rights: Technische Universitaet Dresden (Germany)
9 #include <l4/sys/compiler.h>
11 #include "pub_core_basics.h"
13 #include "pub_l4re_consts.h"
14 #include "pub_tool_libcbase.h"
15 #include "pub_tool_libcfile.h"
16 #include "pub_core_libcprint.h"
17 #include "l4re_helper.h"
20 // max number of fd->name mappings
21 static const int _num_filenames = 25;
22 // storage for mappings
23 Char _filenames[_num_filenames][50] = { { 0 } };
26 void vrm_register_filename(int fd, Char *name)
31 if (fd > _num_filenames) {
32 VG_(printf)("fd out of range: %d\n",fd);
36 VG_(strncpy)(_filenames[fd], name, 50);
40 void vrm_unregister_filename(int fd)
45 if (fd > _num_filenames) {
46 VG_(printf)("fd out of range: %d\n",fd);
50 VG_(memset)(_filenames[fd], 0, 50);
54 Char *vrm_get_filename(int fd)
56 if (fd < 0 || fd > _num_filenames) {
57 VG_(printf)("fd out of range: %d\n",fd);
61 return _filenames[fd];