My Project
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
soc_closesocket.c
Go to the documentation of this file.
1 #include "soc_common.h"
2 #include <sys/socket.h>
3 
4 int closesocket(int sockfd)
5 {
6  int ret=0;
7  u32 *cmdbuf = getThreadCommandBuffer();
8 
9  cmdbuf[0] = 0x000B0042;
10  cmdbuf[1] = (u32)sockfd;
11  cmdbuf[2] = 0x20;
12 
13  if((ret = svcSendSyncRequest(SOCU_handle))!=0)return ret;
14 
15  ret = (int)cmdbuf[1];
16  if(ret==0)ret =_net_convert_error(cmdbuf[2]);
17  SOCU_errno = ret;
18 
19  if(ret!=0)return -1;
20  return 0;
21 }
int closesocket(int sockfd)
u32 * getThreadCommandBuffer(void)
int SOCU_errno
Definition: soc_common.c:5
uint32_t u32
Definition: types.h:23
s32 _net_convert_error(s32 sock_retval)
Definition: soc_common.c:92
s32 svcSendSyncRequest(Handle session)
Handle SOCU_handle
Definition: soc_common.c:4