summaryrefslogtreecommitdiff
path: root/ccan/ptr_valid/_info
blob: 91c9abd37579905d2c1ecfa9fa3eda26fcb10a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "config.h"
#include <stdio.h>
#include <string.h>

/**
 * ptr_valid - test whether a pointer is safe to dereference.
 *
 * This little helper tells you if an address is mapped; it doesn't tell you
 * if it's read-only (or execute only).
 *
 * License: BSD-MIT
 *
 * Ccanlint:
 *	// Our child actually crashes, but that's OK!
 *	tests_pass_valgrind test/run.c:--child-silent-after-fork=yes
 */
int main(int argc, char *argv[])
{
	/* Expect exactly one argument */
	if (argc != 2)
		return 1;

	if (strcmp(argv[1], "depends") == 0) {
		printf("ccan/noerr\n");
		return 0;
	}

	return 1;
}