Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c
Show All 27 Lines | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
/* | /* | ||||
* The canonical name should be 'go' since we prefer symbol names with fewer | * The canonical name should be 'go' since we prefer symbol names with fewer | ||||
* leading underscores. | * leading underscores. | ||||
*/ | */ | ||||
extern int _go(int); | |||||
static int __unused | static int __unused | ||||
go(int a) | go(int a) | ||||
{ | { | ||||
return (a + 1); | return (a + 1); | ||||
} | } | ||||
#pragma weak _go = go | |||||
static void | static void | ||||
handle(int sig __unused) | handle(int sig __unused) | ||||
{ | { | ||||
_go(1); | _go(1); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
int | int | ||||
main(void) | main(void) | ||||
{ | { | ||||
(void) signal(SIGUSR1, handle); | (void) signal(SIGUSR1, handle); | ||||
for (;;) | for (;;) | ||||
getpid(); | getpid(); | ||||
} | } | ||||
#pragma weak _go = go |