Debian Codegraph @

testsuite/systemtap.context/usymbols_lib.c

raw
1 /* usymbol test case - library helper
2 * Copyright (C) 2008, Red Hat Inc.
3 *
4 * This file is part of systemtap, and is free software. You can
5 * redistribute it and/or modify it under the terms of the GNU General
6 * Public License (GPL); either version 2, or (at your option) any
7 * later version.
8 *
9 * Uses signal to tranfer user space addresses into the kernel where a
10 * probe on sigaction will extract them and produce the symbols. To
11 * poke into the executable we get the sa_handler set through signal
12 * from this library.
13 */
14
15 #include <signal.h>
16 typedef void (*sighandler_t)(int);
17
18 void
19 lib_handler (int signum)
20 {
21 /* dummy handler, just used for the address... */
22 }
23
24 void
25 lib_main ()
26 {
27 // Use SIGFPE since we never expect that to be triggered.
28 signal(SIGFPE, lib_handler);
29 }