]> git.ozlabs.org Git - ccan/blob - ccan/ptr_valid/_info
b577535f3bccc84d2d03fbb03bcc1b186452a08e
[ccan] / ccan / ptr_valid / _info
1 #include <string.h>
2 #include "config.h"
3
4 /**
5  * ptr_valid - test whether a pointer is safe to dereference.
6  *
7  * This little helper tells you if an address is mapped; it doesn't tell you
8  * if it's read-only (or execute only).
9  *
10  * License: BSD-MIT
11  *
12  * Ccanlint:
13  *      // Our child actually crashes, but that's OK!
14  *      tests_pass_valgrind test/run.c:--child-silent-after-fork=yes
15  */
16 int main(int argc, char *argv[])
17 {
18         /* Expect exactly one argument */
19         if (argc != 2)
20                 return 1;
21
22         if (strcmp(argv[1], "depends") == 0) {
23                 printf("ccan/noerr\n");
24                 return 0;
25         }
26
27         return 1;
28 }