Changeset 503 for Whitix/branches/hybrid/net/socket.c
- Timestamp:
- 05/14/08 00:02:22 (4 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/hybrid/net/socket.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/net/socket.c
r333 r503 23 23 #include <fs/vfs.h> 24 24 #include <malloc.h> 25 #include <module.h> 25 26 #include <net/network.h> 26 27 #include <net/socket.h> … … 86 87 87 88 if (UNLIKELY(!file)) 88 return -EBADF;89 return; 89 90 90 91 file->vNode=NULL; … … 167 168 } 168 169 170 /* Make local-only? */ 169 171 int SocketDoAccept(struct Socket* server, struct Socket* client, struct Socket** child) 170 172 { … … 186 188 } 187 189 190 SYMBOL_EXPORT(SocketDoAccept); 191 188 192 struct SocketBuffer* SocketAllocateBuffer(const void* buffer, int length) 189 193 { … … 200 204 } 201 205 206 SYMBOL_EXPORT(SocketAllocateBuffer); 207 202 208 int SocketDestroyBuffer(struct SocketBuffer* sockBuff) 203 209 { … … 207 213 } 208 214 215 SYMBOL_EXPORT(SocketDestroyBuffer); 216 209 217 int SocketPoll(struct File* file, struct PollItem* item, struct PollQueue* pollQueue) 210 218 { … … 221 229 { 222 230 struct VMArea* base, *curr; 223 intverifiedLen=0;231 DWORD verifiedLen=0; 224 232 225 233 base=VmLookupAddress(current, (DWORD)buffer); … … 435 443 } 436 444 445 SYMBOL_EXPORT(SocketRegisterFamily); 446 447 #define NET_SYS_BASE 42 448 437 449 int SocketInit() 438 450 { … … 442 454 return -ENOMEM; 443 455 444 return 0; 445 } 446 456 /* Register system calls. */ 457 SysRegisterCall(NET_SYS_BASE+0, (DWORD)&SysSocketCreate); 458 SysRegisterCall(NET_SYS_BASE+1, (DWORD)&SysSocketBind); 459 SysRegisterCall(NET_SYS_BASE+2, (DWORD)&SysSocketConnect); 460 SysRegisterCall(NET_SYS_BASE+3, (DWORD)&SysSocketListen); 461 SysRegisterCall(NET_SYS_BASE+4, (DWORD)&SysSocketAccept); 462 SysRegisterCall(NET_SYS_BASE+5, (DWORD)&SysSocketSend); 463 SysRegisterCall(NET_SYS_BASE+6, (DWORD)&SysSocketReceive); 464 SysRegisterCall(NET_SYS_BASE+7, (DWORD)&SysSocketIoCtl); 465 SysRegisterCall(NET_SYS_BASE+8, (DWORD)&SysSocketClose); 466 467 return 0; 468 } 469
