Skip to content

Commit d138835

Browse files
author
leiffyli
committed
add hook
1 parent b0f2306 commit d138835

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

co_hook_sys_call.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,18 @@ struct hostent *gethostbyname(const char *name)
822822
}
823823

824824

825+
struct hostent* co_gethostbyname(const char *name);
826+
827+
struct hostent *gethostbyname(const char *name)
828+
{
829+
HOOK_SYS_FUNC( gethostbyname );
830+
if (!co_is_enable_sys_hook())
831+
{
832+
return g_sys_gethostbyname_func(name);
833+
}
834+
return co_gethostbyname(name);
835+
}
836+
825837
struct res_state_wrap
826838
{
827839
struct __res_state state;

0 commit comments

Comments
 (0)