X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fptr_valid%2F_info;fp=ccan%2Fptr_valid%2F_info;h=b577535f3bccc84d2d03fbb03bcc1b186452a08e;hp=0000000000000000000000000000000000000000;hb=1086d8cef04f90f6ba74a35fdc9a44fe615518a8;hpb=655bae650e868e037d3db9f6e475f59b58e3e078 diff --git a/ccan/ptr_valid/_info b/ccan/ptr_valid/_info new file mode 100644 index 00000000..b577535f --- /dev/null +++ b/ccan/ptr_valid/_info @@ -0,0 +1,28 @@ +#include +#include "config.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; +}