MCPcopy Create free account
hub / github.com/Tencent/libco / socket

Function socket

co_hook_sys_call.cpp:216–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215}
216int socket(int domain, int type, int protocol)
217{
218 HOOK_SYS_FUNC( socket );
219
220 if( !co_is_enable_sys_hook() )
221 {
222 return g_sys_socket_func( domain,type,protocol );
223 }
224 int fd = g_sys_socket_func(domain,type,protocol);
225 if( fd < 0 )
226 {
227 return fd;
228 }
229
230 rpchook_t *lp = alloc_by_fd( fd );
231 lp->domain = domain;
232
233 fcntl( fd, F_SETFL, g_sys_fcntl_func(fd, F_GETFL,0 ) );
234
235 return fd;
236}
237
238int co_accept( int fd, struct sockaddr *addr, socklen_t *len )
239{

Callers 3

CreateTcpSocketFunction · 0.85
CreateTcpSocketFunction · 0.85
readwrite_routineFunction · 0.85

Calls 3

co_is_enable_sys_hookFunction · 0.85
alloc_by_fdFunction · 0.85
fcntlFunction · 0.85

Tested by

no test coverage detected