* to do here.
*/
ret_val = socreate(domain, type, protocol);
+
+#if FEATURE(DEBUG_NET)
dbg_printf("socreate(0x%08x, 0x%08x, 0x%08x) = 0x%08x\n", domain, type, protocol, ret_val);
+#endif /* FEATURE(DEBUG_NET) */
return(ret_val);
}
* going to return to the caller.
*/
if(ret_val >= 0) {
+#if FEATURE(DEBUG_NET)
dbg_printf("soclose(0x%08x)\n", ret_val);
+#endif /* FEATURE(DEBUG_NET) */
+
ret_val = soclose(ret_val);
}
}
return(ret_val);
}
-int sys_shutdown(int sockfd, int how)
+int sys_shutdown(int procfd, int how)
{
- return(-ENOSYS);
+ process_t *cproc;
+ int ret_val;
+
+ ret_val = -EFAULT;
+ cproc = process_get_current();
+
+ if(cproc) {
+ /* attempt to look up the system-wide sockfd for this procfd */
+ ret_val = process_flookup(cproc, procfd);
+
+ /* pass on the arguments to soshutdown(), if the lookup was successful */
+ if(!ret_val) {
+ ret_val = soshutdown(ret_val, how);
+ }
+ }
+
+ return(ret_val);
}
int sys_select(int nfds, fd_set *readfds, fd_set *writefds,
int sosetopt(int, int, const void*, size_t);
int sogetopt(int, int, void*, size_t*);
+int soshutdown(int, int);
#endif /* __SOCKET_H */