summaryrefslogtreecommitdiff
path: root/libmudflap/mf-hooks2.c
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-07-07 10:14:02 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-07-07 10:14:02 +0000
commit891a2e42599a554e074f3c9e5fde54cce4795ed9 (patch)
treedabd723386297a21ecafc7c91d84abf760884544 /libmudflap/mf-hooks2.c
parent8384ac41e6036d9055c6a1725546eced5d479ec8 (diff)
downloadgcc-891a2e42599a554e074f3c9e5fde54cce4795ed9.tar.gz
re PR libmudflap/49550 (Many libmudflap tests fail on Solaris 11/x86)
gcc: PR libmudflap/49550 * gcc.c (MFWRAP_SPEC): Also wrap mmap64. libmudflap: PR libmudflap/49550 * mf-runtime.c (__wrap_main) [__sun__ && __svr4__]: Don't register stdin, stdout, stderr. Register __ctype, __ctype_mask. * configure.ac: Check for mmap64. Check for rawmemchr, stpcpy, mempcpy. * configure: Regenerate. * config.h.in: Regenerate. * mf-hooks1.c [HAVE_MMAP64] (__mf_0fn_mmap64): New function. (mmap64): New wrapper function. * mf-impl.h (__mf_dynamic_index) [HAVE_MMAP64]: Add dyn_mmap64. * mf-runtime.c (__mf_dynamic) [HAVE_MMAP64]: Handle mmap64. * mf-hooks2.c [HAVE_GETMNTENT && HAVE_SYS_MNTTAB_H]: Implement getmntent wrapper. * mf-hooks3.c (_REENTRANT): Define. * testsuite/libmudflap.c/heap-scalestress.c (SCALE): Reduce to 10000. * testsuite/libmudflap.c/pass-stratcliff.c: Include ../config.h. (MIN): Define. Use HAVE_RAWMEMCHR, HAVE_STPCPY, HAVE_MEMPCPY as guards. * testsuite/libmudflap.c/pass47-frag.c: Expect __ctype warning on *-*-solaris2.*. From-SVN: r175961
Diffstat (limited to 'libmudflap/mf-hooks2.c')
-rw-r--r--libmudflap/mf-hooks2.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/libmudflap/mf-hooks2.c b/libmudflap/mf-hooks2.c
index 77d58131bfa..c030e694035 100644
--- a/libmudflap/mf-hooks2.c
+++ b/libmudflap/mf-hooks2.c
@@ -2102,7 +2102,42 @@ WRAPPER2(struct mntent *, getmntent, FILE *filep)
return m;
}
#elif defined HAVE_SYS_MNTTAB_H
-/* FIXME: Implement. */
+WRAPPER2(int, getmntent, FILE *filep, struct mnttab *mp)
+{
+ static struct mnttab *last = NULL;
+ int res;
+
+ MF_VALIDATE_EXTENT (filep, sizeof (*filep), __MF_CHECK_WRITE,
+ "getmntent stream");
+#define UR(field) __mf_unregister(last->field, strlen (last->field)+1, __MF_TYPE_STATIC)
+ if (last)
+ {
+ UR (mnt_special);
+ UR (mnt_mountp);
+ UR (mnt_fstype);
+ UR (mnt_mntopts);
+ UR (mnt_time);
+ __mf_unregister (last, sizeof (*last), __MF_TYPE_STATIC);
+ }
+#undef UR
+
+ res = getmntent (filep, mp);
+ last = mp;
+
+#define R(field) __mf_register(last->field, strlen (last->field)+1, __MF_TYPE_STATIC, "mntent " #field)
+ if (mp)
+ {
+ R (mnt_special);
+ R (mnt_mountp);
+ R (mnt_fstype);
+ R (mnt_mntopts);
+ R (mnt_time);
+ __mf_register (last, sizeof (*last), __MF_TYPE_STATIC, "getmntent result");
+ }
+#undef R
+
+ return res;
+}
#endif
#endif