]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added gai_strerror
authorLectem <lectem@gmail.com>
Wed, 13 Jan 2016 22:20:46 +0000 (17:20 -0500)
committerLectem <lectem@gmail.com>
Thu, 14 Jan 2016 23:31:45 +0000 (18:31 -0500)
libctru/include/netdb.h
libctru/source/services/soc/soc_gai_strerror.c [new file with mode: 0644]

index e3259b09289fd3c4a07d262e6eaf83184ec63359..836195aab6a988394c90f17bb81fe785733a5e2b 100644 (file)
@@ -72,6 +72,7 @@ extern "C" {
 
        void freeaddrinfo(struct addrinfo *ai);
 
+       const char *gai_strerror(int ecode);
 #ifdef __cplusplus
 }
 #endif
diff --git a/libctru/source/services/soc/soc_gai_strerror.c b/libctru/source/services/soc/soc_gai_strerror.c
new file mode 100644 (file)
index 0000000..3bf2edb
--- /dev/null
@@ -0,0 +1,18 @@
+#include <netdb.h>
+
+const char *gai_strerror(int ecode)
+{
+       switch(ecode)
+       {
+               case EAI_FAMILY :
+                       return "ai_family not supported";
+               case EAI_MEMORY :
+                       return "Memory allocation failure";
+               case EAI_NONAME :
+                       return "Name or service not known";
+               case EAI_SOCKTYPE :
+                       return "ai_socktype not supported";
+               default:
+                       return "Unknown error";
+       }
+}