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