* if (force_write_to_non_tty) {
* handle = 1;
* } else {
- * handle = isatty(<fd>);
+ * handle = isatty_noinline(<fd>);
* }
* } else {
* handle = 0;
if (unlikely(force_write_to_non_tty)) { \
handle = 1; \
} else { \
- handle = isatty(fd); \
+ handle = isatty_noinline(fd); \
} \
} else { \
handle = 0; \
if (unlikely(force_write_to_non_tty)) { \
handle = 1; \
} else { \
- handle = isatty(fileno(file)); \
+ handle = isatty_noinline(fileno(file)); \
} \
} else { \
handle = 0; \
_HOOK_POST_FD_(fd) \
}
+#define HOOK_FD2(type, name, fd, type1, arg1, type2, arg2) \
+ static type (*real_ ## name)(type1, type2); \
+ type name(type1 arg1, type2 arg2) { \
+ _HOOK_PRE_FD(type, name, fd) \
+ result = real_ ## name(arg1, arg2); \
+ _HOOK_POST_FD(fd) \
+ }
#define HOOK_FD3(type, name, fd, type1, arg1, type2, arg2, type3, arg3) \
static type (*real_ ## name)(type1, type2, type3); \
type name(type1 arg1, type2 arg2, type3 arg3) { \
}
#define HOOK_VAR_FILE3(type, name, file, func, type1, arg1, type2, arg2, type3, arg3) \
static type (*real_ ## func)(type1, type2, type3, va_list); \
- type name(type1 arg1, type2 arg2, type3 arg3, ...) \
- { \
+ type name(type1 arg1, type2 arg2, type3 arg3, ...) { \
va_list ap; \
_HOOK_PRE_FILE(type, func, file) \
va_start(ap, arg3); \