Files
lightning/ccan/ccan/ptr_valid/_info
Rusty Russell f8344baf64 ccan: update, new modules.
ccan/autodata, ccan/breakpoint, ccan/crypto/hmac_sha256, ccan/crypto/hkdf_sha256,
ccan/fdpass and ccan/io/fdpass.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-04 13:16:47 +10:30

30 lines
596 B
Plaintext

#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;
}