aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2010-03-22 01:23:47 +0100
committermaximilian attems <max@stro.at>2010-03-22 01:27:30 +0100
commitb4a590446427e774529dead48800a6afab0cfc44 (patch)
tree928f86b9f109e9f7d1d88d8681c89239f8d265e1
parent85a53c2c4d45d8980b54d713de38aff599edfd0e (diff)
downloadklibc-b4a590446427e774529dead48800a6afab0cfc44.tar.gz
[klibc] add testcase for future arch socket foo
the test wouldn't be enough to catch sparc64 trickery, but it triggers easily on sparc32 already. Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/klibc/tests/Kbuild1
-rw-r--r--usr/klibc/tests/socket.c19
2 files changed, 20 insertions, 0 deletions
diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild
index 07e8d643b02d5..a3e0254c5685d 100644
--- a/usr/klibc/tests/Kbuild
+++ b/usr/klibc/tests/Kbuild
@@ -35,6 +35,7 @@ select.shared-y := select.o
setenvtest.shared-y := setenvtest.o
setjmptest.shared-y := setjmptest.o
sigint.shared-y := sigint.o
+socket.shared-y := socket.o
stat.shared-y := stat.o
statfs.shared-y := statfs.o
strlcpycat.shared-y := strlcpycat.o
diff --git a/usr/klibc/tests/socket.c b/usr/klibc/tests/socket.c
new file mode 100644
index 0000000000000..6d84472456c29
--- /dev/null
+++ b/usr/klibc/tests/socket.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+int main(int argc, char *argv[])
+{
+ int ret;
+
+ ret = socket(AF_INET, SOCK_DGRAM, 0);
+ if (ret == -1) {
+ fprintf(stderr, "klibc: socket(AF_INET): %s\n",
+ strerror(errno));
+ return 1;
+ }
+
+ return 0;
+}
+