My Project
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
soc_socket.c
Go to the documentation of this file.
1 #include "soc_common.h"
2 #include <sys/socket.h>
3 
4 int socket(int domain, int type, int protocol)
5 {
6  int ret=0;
7  u32 *cmdbuf = getThreadCommandBuffer();
8 
9  cmdbuf[0] = 0x000200C2;
10  cmdbuf[1] = domain;
11  cmdbuf[2] = type;
12  cmdbuf[3] = protocol;
13  cmdbuf[4] = 0x20;
14 
15  if((ret = svcSendSyncRequest(SOCU_handle))!=0)return ret;
16 
17  ret = (int)cmdbuf[1];
18  SOCU_errno = ret;
19 
20  if(ret!=0)return -1;
21  return _net_convert_error(cmdbuf[2]);
22 }
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
int socket(int domain, int type, int protocol)
Definition: soc_socket.c:4
s32 svcSendSyncRequest(Handle session)
Handle SOCU_handle
Definition: soc_common.c:4