MCPcopy Create free account
hub / github.com/git/git / IsSocketHandle

Function IsSocketHandle

compat/poll/poll.c:85–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83#define IsConsoleHandle(h) (((long) (intptr_t) (h) & 3) == 3)
84
85static BOOL
86IsSocketHandle (HANDLE h)
87{
88 WSANETWORKEVENTS ev;
89
90 if (IsConsoleHandle (h))
91 return FALSE;
92
93 /* Under Wine, it seems that getsockopt returns 0 for pipes too.
94 WSAEnumNetworkEvents instead distinguishes the two correctly. */
95 ev.lNetworkEvents = 0xDEADBEEF;
96 WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
97 return ev.lNetworkEvents != 0xDEADBEEF;
98}
99
100/* Declare data structures for ntdll functions. */
101typedef struct _FILE_PIPE_LOCAL_INFORMATION {

Callers 1

pollFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected