My Project
Main Page
Modules
Data Structures
Files
File List
Globals
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
}
soc_common.h
getThreadCommandBuffer
u32 * getThreadCommandBuffer(void)
SOCU_errno
int SOCU_errno
Definition:
soc_common.c:5
u32
uint32_t u32
Definition:
types.h:23
_net_convert_error
s32 _net_convert_error(s32 sock_retval)
Definition:
soc_common.c:92
socket
int socket(int domain, int type, int protocol)
Definition:
soc_socket.c:4
svcSendSyncRequest
s32 svcSendSyncRequest(Handle session)
SOCU_handle
Handle SOCU_handle
Definition:
soc_common.c:4
socket.h
source
services
soc
soc_socket.c
Generated on Mon Nov 24 2014 23:37:59 for My Project by
1.8.8