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