6ca6e8
commit d910ba48f47158d21c322b9f7e96831c83f69c67
6ca6e8
Author: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
6ca6e8
Date:   Wed Oct 26 16:04:23 2022 -0300
6ca6e8
6ca6e8
    nis: Build libnsl with 64 bit time_t
6ca6e8
    
6ca6e8
    And remove the usage of glibc reserved names.
6ca6e8
    Reviewed-by: DJ Delorie <dj@redhat.com>
6ca6e8
    
6ca6e8
    (cherry picked from commit 545eefc2f5da61801ba82b7a32ca2589b769ec90)
6ca6e8
6ca6e8
diff --git a/Makeconfig b/Makeconfig
6ca6e8
index 9accb5b38d1d37b3..89a2881b1ef605e4 100644
6ca6e8
--- a/Makeconfig
6ca6e8
+++ b/Makeconfig
6ca6e8
@@ -885,7 +885,7 @@ endif
6ca6e8
 # Use 64 bit time_t support for installed programs
6ca6e8
 installed-modules = nonlib nscd lddlibc4 libresolv ldconfig locale_programs \
6ca6e8
 		    iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \
6ca6e8
-		    libutil libpcprofile libSegFault
6ca6e8
+		    libutil libpcprofile libSegFault libnsl
6ca6e8
 +extra-time-flags = $(if $(filter $(installed-modules),\
6ca6e8
                            $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64)
6ca6e8
 
6ca6e8
diff --git a/nis/nis_call.c b/nis/nis_call.c
6ca6e8
index 043f1bd4316aa284..37feba201c37cbca 100644
6ca6e8
--- a/nis/nis_call.c
6ca6e8
+++ b/nis/nis_call.c
6ca6e8
@@ -575,7 +575,7 @@ static struct nis_server_cache
6ca6e8
   unsigned int size;
6ca6e8
   unsigned int server_used;
6ca6e8
   unsigned int current_ep;
6ca6e8
-  __time64_t expires;
6ca6e8
+  time_t expires;
6ca6e8
   char name[];
6ca6e8
 } *nis_server_cache[16];
6ca6e8
 static time_t nis_cold_start_mtime;
6ca6e8
@@ -584,7 +584,7 @@ __libc_lock_define_initialized (static, nis_server_cache_lock)
6ca6e8
 static directory_obj *
6ca6e8
 nis_server_cache_search (const_nis_name name, int search_parent,
6ca6e8
 			 unsigned int *server_used, unsigned int *current_ep,
6ca6e8
-			 struct __timespec64 *now)
6ca6e8
+			 struct timespec *now)
6ca6e8
 {
6ca6e8
   directory_obj *ret = NULL;
6ca6e8
   int i;
6ca6e8
@@ -642,7 +642,7 @@ nis_server_cache_search (const_nis_name name, int search_parent,
6ca6e8
 static void
6ca6e8
 nis_server_cache_add (const_nis_name name, int search_parent,
6ca6e8
 		      directory_obj *dir, unsigned int server_used,
6ca6e8
-		      unsigned int current_ep, struct __timespec64 *now)
6ca6e8
+		      unsigned int current_ep, struct timespec *now)
6ca6e8
 {
6ca6e8
   struct nis_server_cache **loc;
6ca6e8
   struct nis_server_cache *new;
6ca6e8
@@ -708,7 +708,7 @@ __nisfind_server (const_nis_name name, int search_parent,
6ca6e8
   nis_error result = NIS_SUCCESS;
6ca6e8
   nis_error status;
6ca6e8
   directory_obj *obj;
6ca6e8
-  struct __timespec64 ts;
6ca6e8
+  struct timespec ts;
6ca6e8
   unsigned int server_used = ~0;
6ca6e8
   unsigned int current_ep = ~0;
6ca6e8
 
6ca6e8
@@ -718,7 +718,7 @@ __nisfind_server (const_nis_name name, int search_parent,
6ca6e8
   if (*dir != NULL)
6ca6e8
     return NIS_SUCCESS;
6ca6e8
 
6ca6e8
-  __clock_gettime64 (CLOCK_REALTIME, &ts);
6ca6e8
+  clock_gettime (CLOCK_REALTIME, &ts);
6ca6e8
 
6ca6e8
   if ((flags & NO_CACHE) == 0)
6ca6e8
     *dir = nis_server_cache_search (name, search_parent, &server_used,