chiark / gitweb /
regress: Wrap up fopen() too
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 19 Nov 2016 18:22:49 +0000 (18:22 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
The fuzzer is going to want to wrap fopen.  So add it to the special
syscall list, and implement it with the obvious wrapper in hnonfuzz.c.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
regress/hnonfuzz.c
regress/hsyscalls.i4

index 89876a930ed7f06c4abca2d55645f259e1decae2..e6fa2fa06deb258ad08a2164fec03c0003adb017 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "harness.h"
 
+FILE *Hfopen(const char *path, const char *mode) { return fopen(path,mode); }
+
 int Ttestinputfd(void) {
   const char *fdstr= getenv("ADNS_TEST_IN_FD");
   if (!fdstr) return -1;
index 68c769c93b7ed934b7c4c8ecec9b88c25c45a583..57270d8662e5debf0aab3b388a0dc2af879d7b8b 100644 (file)
@@ -141,3 +141,5 @@ hm_specsyscall(void*, malloc, `size_t sz')
 hm_specsyscall(void, free, `void *ptr')
 hm_specsyscall(void*, realloc, `void *op, size_t nsz')
 hm_specsyscall(void, exit, `int rv', NONRETURNING)
+
+hm_specsyscall(FILE*, fopen, `const char *path, const char *mode')