summaryrefslogtreecommitdiff
path: root/lib/intercept/intercept.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/intercept/intercept.h')
-rw-r--r--lib/intercept/intercept.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/intercept/intercept.h b/lib/intercept/intercept.h
index bc6557f3..80a17d3f 100644
--- a/lib/intercept/intercept.h
+++ b/lib/intercept/intercept.h
@@ -23,17 +23,20 @@ extern "C"
typedef struct dirent *(readdir_t) (DIR *dir);
typedef int (closedir_t)(DIR *dir);
#if defined __GNUC__ && __GNUC__ >= 2
-#define LINUX_WEIRD_LSTAT
-#define STAT_STRUCT struct stat /* should be stat64 */
- typedef int (lstat_t) (int ver, const char *file_name,
- STAT_STRUCT *buf);
+ #define LINUX_WEIRD_LSTAT
+ #define STAT_STRUCT struct stat /* should be stat64 */
+ typedef int (lstat_t) (int ver, const char *file_name,
+ STAT_STRUCT *buf);
#else
-#define STAT_STRUCT struct stat
- typedef int (lstat_t) (const char *file_name,
- STAT_STRUCT *buf);
+ #define STAT_STRUCT struct stat
+ typedef int (lstat_t) (const char *file_name,
+ STAT_STRUCT *buf);
#endif
}
+typedef int (lstat_post_hook_t) (int old_ret, const char *file_name,
+ struct stat *buf);
+
void intercept_setup_error(const char *filename, unsigned int errorafter,
int errortoreturn, int syscalltoerror);
void intercept_setup_delay(const char *filename, unsigned int delay_after,
@@ -42,6 +45,10 @@ bool intercept_triggered();
void intercept_setup_readdir_hook(const char *dirname, readdir_t hookfn);
void intercept_setup_lstat_hook (const char *filename, lstat_t hookfn);
+void intercept_setup_lstat_post_hook(lstat_post_hook_t hookfn);
+void intercept_setup_stat_post_hook (lstat_post_hook_t hookfn);
+
+void intercept_clear_setup();
#endif // !PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE
#endif // !INTERCEPT_H