aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/stdsocket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/std/stdsocket.c b/std/stdsocket.c
index 94d2ebe..0a47f97 100644
--- a/std/stdsocket.c
+++ b/std/stdsocket.c
@@ -1,4 +1,3 @@
-#include "stdlib.c"
#include <netinet/in.h>
#include <stdbool.h>
#include <stdio.h>
@@ -66,6 +65,14 @@ char *recvsock(int soc) {
return buf;
}
+size_t
+strlen(const char *str)
+{
+ const char *s;
+ for (s = str; *s; ++s);
+ return(s - str);
+}
+
void sendsock(char *msg, int soc) { send(soc, msg, strlen(msg), 0); }
void closesock(int soc, bool server) {