Hi guys,

Here is the patch for netdb.h file.

Thanks
Himanshu
From a9464ea48eaa7a7f4d08cc1b904ad13cd8abaa3a Mon Sep 17 00:00:00 2001
From: Himanshu40 <himanshuwindows...@gmail.com>
Date: Fri, 7 Dec 2018 23:44:43 +0530
Subject: [PATCH] psxhdrs: POSIX API Signature Compliance Tests for netdb.h
 File (GCI 2018)

---
 testsuites/psxtests/Makefile.am               | 25 +++++++++-
 .../psxtests/psxhdrs/netdb/endhostent.c       | 40 +++++++++++++++
 testsuites/psxtests/psxhdrs/netdb/endnetent.c | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/endprotoent.c      | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/endservent.c       | 40 +++++++++++++++
 .../psxtests/psxhdrs/netdb/freeaddrinfo.c     | 50 +++++++++++++++++++
 .../psxtests/psxhdrs/netdb/gai_strerror.c     | 40 +++++++++++++++
 .../psxtests/psxhdrs/netdb/getaddrinfo.c      | 49 ++++++++++++++++++
 .../psxtests/psxhdrs/netdb/gethostbyaddr.c    | 40 +++++++++++++++
 .../psxtests/psxhdrs/netdb/gethostbyname.c    | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/gethostent.c       | 38 ++++++++++++++
 .../psxtests/psxhdrs/netdb/getnameinfo.c      | 49 ++++++++++++++++++
 .../psxtests/psxhdrs/netdb/getnetbyaddr.c     | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/getnetbyname.c     | 39 +++++++++++++++
 testsuites/psxtests/psxhdrs/netdb/getnetent.c | 37 ++++++++++++++
 .../psxtests/psxhdrs/netdb/getprotobyname.c   | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/getprotobynumber.c | 38 ++++++++++++++
 .../psxtests/psxhdrs/netdb/getprotoent.c      | 37 ++++++++++++++
 .../psxtests/psxhdrs/netdb/getservbyname.c    | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/getservbyport.c    | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/getservent.c       | 38 ++++++++++++++
 testsuites/psxtests/psxhdrs/netdb/h_errno.c   | 39 +++++++++++++++
 .../psxtests/psxhdrs/netdb/sethostent.c       | 39 +++++++++++++++
 testsuites/psxtests/psxhdrs/netdb/setnetent.c | 38 ++++++++++++++
 .../psxtests/psxhdrs/netdb/setprotoent.c      | 38 ++++++++++++++
 .../psxtests/psxhdrs/netdb/setservent.c       | 39 +++++++++++++++
 26 files changed, 1025 insertions(+), 1 deletion(-)
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/endhostent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/endnetent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/endprotoent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/endservent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/freeaddrinfo.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/gai_strerror.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getaddrinfo.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/gethostbyaddr.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/gethostbyname.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/gethostent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getnameinfo.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getnetbyaddr.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getnetbyname.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getnetent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getprotobyname.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getprotobynumber.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getprotoent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getservbyname.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getservbyport.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/getservent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/h_errno.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/sethostent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/setnetent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/setprotoent.c
 create mode 100644 testsuites/psxtests/psxhdrs/netdb/setservent.c

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 6b6bee0d0d..0199694916 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1579,7 +1579,30 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
 	psxhdrs/inttypes/strtoimax.c \
 	psxhdrs/inttypes/strtoumax.c \
 	psxhdrs/inttypes/wcstoimax.c \
-	psxhdrs/inttypes/wcstoumax.c
+	psxhdrs/inttypes/wcstoumax.c \
+	psxhdrs/netdb/endhostent.c \
+	psxhdrs/netdb/endnetent.c \
+	psxhdrs/netdb/endprotoent.c \
+	psxhdrs/netdb/endservent.c \
+	psxhdrs/netdb/sethostent.c \
+	psxhdrs/netdb/setnetent.c \
+	psxhdrs/netdb/setservent.c \
+	psxhdrs/netdb/gethostent.c \
+	psxhdrs/netdb/getprotoent.c \
+	psxhdrs/netdb/getnetent.c \
+	psxhdrs/netdb/getservent.c \
+	psxhdrs/netdb/freeaddrinfo.c \
+	psxhdrs/netdb/gai_strerror.c \
+	psxhdrs/netdb/getaddrinfo.c \
+	psxhdrs/netdb/gethostbyaddr.c \
+	psxhdrs/netdb/gethostbyname.c \
+	psxhdrs/netdb/getnameinfo.c \
+	psxhdrs/netdb/getnetbyname.c \
+	psxhdrs/netdb/getprotobyname.c \
+	psxhdrs/netdb/getprotobynumber.c \
+	psxhdrs/netdb/getservbyname.c \
+	psxhdrs/netdb/getservbyport.c \
+	psxhdrs/netdb/h_errno.c
 
 
 ## Not supported by RTEMS, but POSIX API Compliance tests exist.
diff --git a/testsuites/psxtests/psxhdrs/netdb/endhostent.c b/testsuites/psxtests/psxhdrs/netdb/endhostent.c
new file mode 100644
index 0000000000..fc8167b21e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/endhostent.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief endhostent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct hostent *host;
+
+   host = gethostent();
+   sethostent( 1 );
+   endhostent();
+
+   return ( host != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/endnetent.c b/testsuites/psxtests/psxhdrs/netdb/endnetent.c
new file mode 100644
index 0000000000..78148a9693
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/endnetent.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief endnetent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct netent *nent;
+
+   nent = getnetent();
+   setnetent( 1 );
+   endnetent();
+
+   return ( nent != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/endprotoent.c b/testsuites/psxtests/psxhdrs/netdb/endprotoent.c
new file mode 100644
index 0000000000..55690242ee
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/endprotoent.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief endprotoent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct protoent *protoc;
+
+   protoc = getprotoent();
+   setprotoent( 1 );
+   endprotoent();
+
+   return ( protoc != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/endservent.c b/testsuites/psxtests/psxhdrs/netdb/endservent.c
new file mode 100644
index 0000000000..2475633000
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/endservent.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief endservent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *serv;
+
+   serv = getservent();
+   setservent( 1 );
+   endservent();
+
+   return ( serv != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/freeaddrinfo.c b/testsuites/psxtests/psxhdrs/netdb/freeaddrinfo.c
new file mode 100644
index 0000000000..12d3205c8a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/freeaddrinfo.c
@@ -0,0 +1,50 @@
+/**
+ *  @file
+ *  @brief freeaddrinfo() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct addrinfo hints;
+   struct addrinfo *finfo = NULL;
+   int result;
+
+   hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
+   hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
+   hints.ai_flags = AI_PASSIVE;    /* For wildcard IP address */
+   hints.ai_protocol = 0;          /* Any protocol */
+   hints.ai_canonname = NULL;
+   hints.ai_addr = NULL;
+   hints.ai_next = NULL;
+
+   result = getaddrinfo( NULL, NULL, &hints, &finfo );
+   freeaddrinfo( finfo );
+
+   return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/gai_strerror.c b/testsuites/psxtests/psxhdrs/netdb/gai_strerror.c
new file mode 100644
index 0000000000..c849aebca2
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/gai_strerror.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief gai_strerror() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   int ecode = 2;
+   const char *result;
+
+   result = gai_strerror( ecode );
+
+   return ( result != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getaddrinfo.c b/testsuites/psxtests/psxhdrs/netdb/getaddrinfo.c
new file mode 100644
index 0000000000..a1463b3e87
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getaddrinfo.c
@@ -0,0 +1,49 @@
+/**
+ *  @file
+ *  @brief getaddrinfo() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct addrinfo hints;
+   struct addrinfo *finfo = NULL;
+   int result;
+
+   hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
+   hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
+   hints.ai_flags = AI_PASSIVE;    /* For wildcard IP address */
+   hints.ai_protocol = 0;          /* Any protocol */
+   hints.ai_canonname = NULL;
+   hints.ai_addr = NULL;
+   hints.ai_next = NULL;
+
+   result = getaddrinfo( NULL, NULL, &hints, &finfo );
+
+   return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/gethostbyaddr.c b/testsuites/psxtests/psxhdrs/netdb/gethostbyaddr.c
new file mode 100644
index 0000000000..4e7661e5be
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/gethostbyaddr.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief gethostbyaddr() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <arpa/inet.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct hostent *host;
+   struct in_addr ipv4addr;
+
+   host = gethostbyaddr( &ipv4addr, sizeof(ipv4addr), AF_INET );
+
+   return ( host != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/gethostbyname.c b/testsuites/psxtests/psxhdrs/netdb/gethostbyname.c
new file mode 100644
index 0000000000..f3db8ee952
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/gethostbyname.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief gethostbyname() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct hostent *host;
+   char *name = NULL;
+
+   host = gethostbyname( name );
+
+   return ( host != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/gethostent.c b/testsuites/psxtests/psxhdrs/netdb/gethostent.c
new file mode 100644
index 0000000000..4360f1d423
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/gethostent.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief getservent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *serv;
+
+   serv = getservent();
+
+   return ( serv != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getnameinfo.c b/testsuites/psxtests/psxhdrs/netdb/getnameinfo.c
new file mode 100644
index 0000000000..140f7863c2
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getnameinfo.c
@@ -0,0 +1,49 @@
+/**
+ *  @file
+ *  @brief getnameinfo() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct sockaddr sa;
+   char host[1024];
+   char service[20];
+   int result;
+
+   sa.sa_family      = AF_INET;
+
+   result = getnameinfo( &sa,
+                        sizeof(sa),
+                        host,
+                        sizeof(host),
+                        service,
+                        sizeof(service),
+                        0 );
+
+   return result;
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getnetbyaddr.c b/testsuites/psxtests/psxhdrs/netdb/getnetbyaddr.c
new file mode 100644
index 0000000000..8cdb000777
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getnetbyaddr.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief getnetbyaddr() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct netent *gnet;
+   uint32_t net = 2;
+   int type = 2;
+
+   gnet = getnetbyaddr( net, type );
+
+   return ( gnet != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getnetbyname.c b/testsuites/psxtests/psxhdrs/netdb/getnetbyname.c
new file mode 100644
index 0000000000..55a734f0a3
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getnetbyname.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief getnetbyname() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct netent *gnet;
+   char *name = "ipv4";
+
+   gnet = getnetbyname( name );
+   (void) name;
+
+   return ( gnet != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getnetent.c b/testsuites/psxtests/psxhdrs/netdb/getnetent.c
new file mode 100644
index 0000000000..56443fe665
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getnetent.c
@@ -0,0 +1,37 @@
+/**
+ *  @file
+ *  @brief getnetent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct netent *nent;
+
+   nent = getnetent();
+
+   return ( nent != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getprotobyname.c b/testsuites/psxtests/psxhdrs/netdb/getprotobyname.c
new file mode 100644
index 0000000000..ca862ff846
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getprotobyname.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief getprotobyname() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct protoent *pnet;
+   char *name = "ipv4";
+
+   pnet = getprotobyname( name );
+   (void) name;
+
+   return ( pnet != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getprotobynumber.c b/testsuites/psxtests/psxhdrs/netdb/getprotobynumber.c
new file mode 100644
index 0000000000..278662076a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getprotobynumber.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief getprotobynumber() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct protoent *pnet;
+   int proto = 2;
+
+   pnet = getprotobynumber( proto );
+
+   return ( pnet != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getprotoent.c b/testsuites/psxtests/psxhdrs/netdb/getprotoent.c
new file mode 100644
index 0000000000..d5e0dc7d85
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getprotoent.c
@@ -0,0 +1,37 @@
+/**
+ *  @file
+ *  @brief getprotoent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct protoent *protoc;
+
+   protoc = getprotoent();
+
+   return ( protoc != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getservbyname.c b/testsuites/psxtests/psxhdrs/netdb/getservbyname.c
new file mode 100644
index 0000000000..629ed07ce7
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getservbyname.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief getservbyname() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *pserv;
+   char *name = "ip";
+   char *proto = "ipv4";
+
+   pserv = getservbyname( name, proto );
+
+   return ( pserv != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getservbyport.c b/testsuites/psxtests/psxhdrs/netdb/getservbyport.c
new file mode 100644
index 0000000000..388bb35f4b
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getservbyport.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief getservbyport() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *pserv;
+   int port = 2;
+   char *proto = "ipv4";
+
+   pserv = getservbyport( port, proto );
+
+   return ( pserv != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/getservent.c b/testsuites/psxtests/psxhdrs/netdb/getservent.c
new file mode 100644
index 0000000000..4360f1d423
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/getservent.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief getservent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *serv;
+
+   serv = getservent();
+
+   return ( serv != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/h_errno.c b/testsuites/psxtests/psxhdrs/netdb/h_errno.c
new file mode 100644
index 0000000000..e90bafb621
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/h_errno.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief h_errno() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct hostent *host;
+
+   host = gethostent();
+   sethostent( h_errno );
+
+   return ( host != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/sethostent.c b/testsuites/psxtests/psxhdrs/netdb/sethostent.c
new file mode 100644
index 0000000000..c6a768b3e0
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/sethostent.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief sethostent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct hostent *host;
+
+   host = gethostent();
+   sethostent( 1 );
+
+   return ( host != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/setnetent.c b/testsuites/psxtests/psxhdrs/netdb/setnetent.c
new file mode 100644
index 0000000000..a2cd7b57a2
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/setnetent.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief setnetent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct netent *nent;
+
+   nent = getnetent();
+   setnetent( 1 );
+
+   return ( nent != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/setprotoent.c b/testsuites/psxtests/psxhdrs/netdb/setprotoent.c
new file mode 100644
index 0000000000..e20fbc5b65
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/setprotoent.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief setprotoent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct protoent *protoc;
+
+   protoc = getprotoent();
+   setprotoent( 1 );
+
+   return ( protoc != NULL );
+ }
diff --git a/testsuites/psxtests/psxhdrs/netdb/setservent.c b/testsuites/psxtests/psxhdrs/netdb/setservent.c
new file mode 100644
index 0000000000..60119c1b68
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/netdb/setservent.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief setservent() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
+ #include <sys/socket.h>
+ #include <netdb.h>
+
+ int test( void );
+
+ int test( void )
+ {
+   struct servent *serv;
+
+   serv = getservent();
+   setservent( 1 );
+
+   return ( serv != NULL );
+ }
-- 
2.17.2

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to