Added VG_(rename) (untested), and made VG_(bbs_done) visible to skins, both at
the request of Josef Weidendorfer for his KCachegrind stuff.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1231 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h
index f9a7a40..d657850 100644
--- a/coregrind/vg_include.h
+++ b/coregrind/vg_include.h
@@ -1098,8 +1098,8 @@
the client program really was running on the real cpu. */
extern void VG_(start_GDB_whilst_on_client_stack) ( void );
-/* 64-bit counter for the number of basic blocks done. */
-extern ULong VG_(bbs_done);
+/* VG_(bbs_done) in include/vg_skin.h */
+
/* 64-bit counter for the number of bbs to go before a debug exit. */
extern ULong VG_(bbs_to_go);
diff --git a/coregrind/vg_mylibc.c b/coregrind/vg_mylibc.c
index abb5db3..c94224d 100644
--- a/coregrind/vg_mylibc.c
+++ b/coregrind/vg_mylibc.c
@@ -1087,16 +1087,21 @@
{
Int res;
res = vg_do_syscall2(__NR_stat, (UInt)file_name, (UInt)buf);
- return
- VG_(is_kerror)(res) ? (-1) : 0;
+ return VG_(is_kerror)(res) ? (-1) : 0;
+}
+
+Int VG_(rename) ( Char* old_name, Char* new_name )
+{
+ Int res;
+ res = vg_do_syscall2(__NR_rename, (UInt)old_name, (UInt)new_name);
+ return VG_(is_kerror)(res) ? (-1) : 0;
}
Int VG_(unlink) ( Char* file_name )
{
Int res;
res = vg_do_syscall1(__NR_unlink, (UInt)file_name);
- return
- VG_(is_kerror)(res) ? (-1) : 0;
+ return VG_(is_kerror)(res) ? (-1) : 0;
}
/* Misc functions looking for a proper home. */
diff --git a/include/vg_skin.h b/include/vg_skin.h
index ceb2536..46cc838 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -218,6 +218,9 @@
/* ------------------------------------------------------------------ */
/* General stuff */
+/* 64-bit counter for the number of basic blocks done. */
+extern ULong VG_(bbs_done);
+
/* Get the simulated %esp */
extern Addr VG_(get_stack_pointer) ( void );
@@ -282,6 +285,8 @@
extern void VG_(vprintf) ( void(*send)(Char),
const Char *format, va_list vargs );
+extern Int VG_(rename) ( Char* old_name, Char* new_name );
+
/* ------------------------------------------------------------------ */
/* stdlib.h */
@@ -362,6 +367,7 @@
extern Int VG_(write) ( Int fd, void* buf, Int count);
extern void VG_(close) ( Int fd );
+/* Nb: VG_(rename)() declared in stdio.h section above */
extern Int VG_(unlink) ( Char* file_name );
extern Int VG_(stat) ( Char* file_name, struct vki_stat* buf );