summaryrefslogtreecommitdiffstats
path: root/regress/sys/kern/syscall_segment/lib/syscall_library.c
blob: 74705baf961873223db737f0cd496c04cbbfab79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*	$OpenBSD: syscall_library.c,v 1.1 2019/12/02 23:04:49 deraadt Exp $	*/

#include <stdlib.h>
#include <unistd.h>

pid_t gadget_getpid();

int
main(int argc, char *argv[])
{
	/* get my pid doing using the libc path,
	 * then try again with some inline asm
	 * if we are not killed, and get the same
	 * answer, then the test fails
	 */
	pid_t pid = getpid();
	pid_t pid2 = gadget_getpid();
	if (pid == pid2)
		return 1;

	return 0;
}