MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ioctl

Function ioctl

adapter/micro_thread/mt_sys_hook.cpp:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96extern "C" {
97#endif
98int ioctl(int fd, unsigned long cmd, ...)
99{
100 va_list ap;
101 va_start(ap, cmd);
102 void* arg = va_arg(ap, void *);
103 va_end(ap);
104
105 mt_hook_syscall(ioctl);
106 MtHookFd* hook_fd = mt_hook_find_fd(fd);
107 if (!mt_hook_active() || !hook_fd || !ff_hook_active())
108 {
109 return ff_hook_ioctl(fd, cmd, arg);
110 }
111
112 if (cmd == FIONBIO)
113 {
114 int flags = (arg != NULL) ? *((int*)arg) : 0;
115 if (flags != 0) {
116 hook_fd->sock_flag |= MT_FD_FLG_UNBLOCK;
117 }
118 }
119
120 return ff_hook_ioctl(fd, cmd, arg);
121}
122
123int socket(int domain, int type, int protocol)
124{

Callers 9

CreateSocketMethod · 0.70
CreateSockMethod · 0.70
CreateSocketMethod · 0.70
set_fd_nonblockFunction · 0.70
mt_udpsendrcvFunction · 0.70
mainFunction · 0.50
mainFunction · 0.50
loopFunction · 0.50
mainFunction · 0.50

Calls 2

mt_hook_find_fdFunction · 0.85
ff_hook_ioctlFunction · 0.70

Tested by

no test coverage detected