public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixing missing 64 bit time_t usages
@ 2022-10-26 19:04 Adhemerval Zanella
  2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Adhemerval Zanella @ 2022-10-26 19:04 UTC (permalink / raw)
  To: libc-alpha, Zev Weiss, Wayne Tung

With the nscd time_t mismatch issue [1], I tried to check all the glibc
internal time_t usages to check if we are still missing any.  Ignoring
testing and internal function implementation, I could found a couple
of places we 32 bit time_t are used along with 64 bit time_t routines.

[1] https://sourceware.org/pipermail/libc-alpha/2022-October/142937.html

Adhemerval Zanella (3):
  nis: Build libnsl with 64 bit time_t
  nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  time: Use 64 bit time on tzfile

 Makeconfig           |  2 +-
 nis/nis_call.c       | 10 +++++-----
 nscd/nscd.h          |  2 +-
 nscd/nscd_gethst_r.c |  2 +-
 time/tzfile.c        |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] nis: Build libnsl with 64 bit time_t
  2022-10-26 19:04 [PATCH 0/3] Fixing missing 64 bit time_t usages Adhemerval Zanella
@ 2022-10-26 19:04 ` Adhemerval Zanella
  2022-12-09  4:30   ` DJ Delorie
  2022-12-09  4:31   ` DJ Delorie
  2022-10-26 19:04 ` [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402) Adhemerval Zanella
  2022-10-26 19:04 ` [PATCH 3/3] time: Use 64 bit time on tzfile Adhemerval Zanella
  2 siblings, 2 replies; 12+ messages in thread
From: Adhemerval Zanella @ 2022-10-26 19:04 UTC (permalink / raw)
  To: libc-alpha, Zev Weiss, Wayne Tung

And remove the usage of glibc reserved names.
---
 Makeconfig     |  2 +-
 nis/nis_call.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makeconfig b/Makeconfig
index 08a869cd11..f3f816ce32 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -884,7 +884,7 @@ endif
 # Use 64 bit time_t support for installed programs
 installed-modules = nonlib nscd ldconfig locale_programs \
 		    iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \
-		    libutil libpcprofile
+		    libutil libpcprofile libnsl
 +extra-time-flags = $(if $(filter $(installed-modules),\
                            $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64)
 
diff --git a/nis/nis_call.c b/nis/nis_call.c
index 90187e30b1..5b9dd50151 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -574,7 +574,7 @@ static struct nis_server_cache
   unsigned int size;
   unsigned int server_used;
   unsigned int current_ep;
-  __time64_t expires;
+  time_t expires;
   char name[];
 } *nis_server_cache[16];
 static time_t nis_cold_start_mtime;
@@ -583,7 +583,7 @@ __libc_lock_define_initialized (static, nis_server_cache_lock)
 static directory_obj *
 nis_server_cache_search (const_nis_name name, int search_parent,
 			 unsigned int *server_used, unsigned int *current_ep,
-			 struct __timespec64 *now)
+			 struct timespec *now)
 {
   directory_obj *ret = NULL;
   int i;
@@ -641,7 +641,7 @@ nis_server_cache_search (const_nis_name name, int search_parent,
 static void
 nis_server_cache_add (const_nis_name name, int search_parent,
 		      directory_obj *dir, unsigned int server_used,
-		      unsigned int current_ep, struct __timespec64 *now)
+		      unsigned int current_ep, struct timespec *now)
 {
   struct nis_server_cache **loc;
   struct nis_server_cache *new;
@@ -707,7 +707,7 @@ __nisfind_server (const_nis_name name, int search_parent,
   nis_error result = NIS_SUCCESS;
   nis_error status;
   directory_obj *obj;
-  struct __timespec64 ts;
+  struct timespec ts;
   unsigned int server_used = ~0;
   unsigned int current_ep = ~0;
 
@@ -717,7 +717,7 @@ __nisfind_server (const_nis_name name, int search_parent,
   if (*dir != NULL)
     return NIS_SUCCESS;
 
-  __clock_gettime64 (CLOCK_REALTIME, &ts);
+  clock_gettime (CLOCK_REALTIME, &ts);
 
   if ((flags & NO_CACHE) == 0)
     *dir = nis_server_cache_search (name, search_parent, &server_used,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  2022-10-26 19:04 [PATCH 0/3] Fixing missing 64 bit time_t usages Adhemerval Zanella
  2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
@ 2022-10-26 19:04 ` Adhemerval Zanella
  2022-10-26 21:42   ` DJ Delorie
  2022-12-09  4:30   ` DJ Delorie
  2022-10-26 19:04 ` [PATCH 3/3] time: Use 64 bit time on tzfile Adhemerval Zanella
  2 siblings, 2 replies; 12+ messages in thread
From: Adhemerval Zanella @ 2022-10-26 19:04 UTC (permalink / raw)
  To: libc-alpha, Zev Weiss, Wayne Tung

Although the nscd module is built with 64 bit time_t, the routines
linked direct to libc.so need to use the internal symbols.
---
 nscd/nscd.h          | 2 +-
 nscd/nscd_gethst_r.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nscd/nscd.h b/nscd/nscd.h
index 368091aef8..f15321585b 100644
--- a/nscd/nscd.h
+++ b/nscd/nscd.h
@@ -65,7 +65,7 @@ typedef enum
 struct traced_file
 {
   /* Tracks the last modified time of the traced file.  */
-  time_t mtime;
+  __time64_t mtime;
   /* Support multiple registered files per database.  */
   struct traced_file *next;
   int call_res_init;
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index 31d13580a1..5958f181db 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -112,7 +112,7 @@ __nscd_get_nl_timestamp (void)
   if (map == NULL
       || (map != NO_MAPPING
 	  && map->head->nscd_certainly_running == 0
-	  && map->head->timestamp + MAPPING_TIMEOUT < time_now ()))
+	  && map->head->timestamp + MAPPING_TIMEOUT < time64_now ()))
     map = __nscd_get_mapping (GETFDHST, "hosts", &__hst_map_handle.mapped);
 
   if (map == NO_MAPPING)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/3] time: Use 64 bit time on tzfile
  2022-10-26 19:04 [PATCH 0/3] Fixing missing 64 bit time_t usages Adhemerval Zanella
  2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
  2022-10-26 19:04 ` [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402) Adhemerval Zanella
@ 2022-10-26 19:04 ` Adhemerval Zanella
  2022-12-09  4:31   ` DJ Delorie
  2 siblings, 1 reply; 12+ messages in thread
From: Adhemerval Zanella @ 2022-10-26 19:04 UTC (permalink / raw)
  To: libc-alpha, Zev Weiss, Wayne Tung

The tzfile_mtime is already compared to 64 bit time_t stat call.
---
 time/tzfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/time/tzfile.c b/time/tzfile.c
index dd75848ba9..394b098856 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -32,7 +32,7 @@
 int __use_tzfile;
 static dev_t tzfile_dev;
 static ino64_t tzfile_ino;
-static time_t tzfile_mtime;
+static __time64_t tzfile_mtime;
 
 struct ttinfo
   {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  2022-10-26 19:04 ` [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402) Adhemerval Zanella
@ 2022-10-26 21:42   ` DJ Delorie
  2022-10-27 12:31     ` Adhemerval Zanella Netto
  2022-10-27 12:48     ` Andreas Schwab
  2022-12-09  4:30   ` DJ Delorie
  1 sibling, 2 replies; 12+ messages in thread
From: DJ Delorie @ 2022-10-26 21:42 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, zev, wayne.tung

Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> -  time_t mtime;
> +  __time64_t mtime;

Wait... does this mean that the format of the nscd cache changed at some
point and we didn't flag it as an externally visible ABI change?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  2022-10-26 21:42   ` DJ Delorie
@ 2022-10-27 12:31     ` Adhemerval Zanella Netto
  2022-10-27 12:48     ` Andreas Schwab
  1 sibling, 0 replies; 12+ messages in thread
From: Adhemerval Zanella Netto @ 2022-10-27 12:31 UTC (permalink / raw)
  To: DJ Delorie; +Cc: libc-alpha, zev, wayne.tung



On 26/10/22 18:42, DJ Delorie wrote:
> Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
>> -  time_t mtime;
>> +  __time64_t mtime;
> 
> Wait... does this mean that the format of the nscd cache changed at some
> point and we didn't flag it as an externally visible ABI change?
> 

It seems so, not sure how to handle it. We will need to eventually do it
anyway (we have a similar issue with the utmp, wtmp).

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  2022-10-26 21:42   ` DJ Delorie
  2022-10-27 12:31     ` Adhemerval Zanella Netto
@ 2022-10-27 12:48     ` Andreas Schwab
  1 sibling, 0 replies; 12+ messages in thread
From: Andreas Schwab @ 2022-10-27 12:48 UTC (permalink / raw)
  To: DJ Delorie via Libc-alpha; +Cc: Adhemerval Zanella, DJ Delorie, zev, wayne.tung

On Okt 26 2022, DJ Delorie via Libc-alpha wrote:

> Wait... does this mean that the format of the nscd cache changed at some
> point and we didn't flag it as an externally visible ABI change?

nscd_time_t has always been a 64-bit type.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] nis: Build libnsl with 64 bit time_t
  2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
@ 2022-12-09  4:30   ` DJ Delorie
  2022-12-09  4:31   ` DJ Delorie
  1 sibling, 0 replies; 12+ messages in thread
From: DJ Delorie @ 2022-12-09  4:30 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> And remove the usage of glibc reserved names.
> ---
>  Makeconfig     |  2 +-
>  nis/nis_call.c | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
  2022-10-26 19:04 ` [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402) Adhemerval Zanella
  2022-10-26 21:42   ` DJ Delorie
@ 2022-12-09  4:30   ` DJ Delorie
  1 sibling, 0 replies; 12+ messages in thread
From: DJ Delorie @ 2022-12-09  4:30 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, zev, wayne.tung

Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> Although the nscd module is built with 64 bit time_t, the routines
> linked direct to libc.so need to use the internal symbols.

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] time: Use 64 bit time on tzfile
  2022-10-26 19:04 ` [PATCH 3/3] time: Use 64 bit time on tzfile Adhemerval Zanella
@ 2022-12-09  4:31   ` DJ Delorie
  0 siblings, 0 replies; 12+ messages in thread
From: DJ Delorie @ 2022-12-09  4:31 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, zev, wayne.tung

Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> The tzfile_mtime is already compared to 64 bit time_t stat call.

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] nis: Build libnsl with 64 bit time_t
  2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
  2022-12-09  4:30   ` DJ Delorie
@ 2022-12-09  4:31   ` DJ Delorie
  2022-12-09 14:35     ` Adhemerval Zanella Netto
  1 sibling, 1 reply; 12+ messages in thread
From: DJ Delorie @ 2022-12-09  4:31 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> And remove the usage of glibc reserved names.

Will you be doing this for stat64 calls too?  Or is that a different
type of problem?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] nis: Build libnsl with 64 bit time_t
  2022-12-09  4:31   ` DJ Delorie
@ 2022-12-09 14:35     ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 12+ messages in thread
From: Adhemerval Zanella Netto @ 2022-12-09 14:35 UTC (permalink / raw)
  To: DJ Delorie; +Cc: libc-alpha



On 09/12/22 01:31, DJ Delorie wrote:
> Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
>> And remove the usage of glibc reserved names.
> 
> Will you be doing this for stat64 calls too?  Or is that a different
> type of problem?
> 

Good question, let me check if there is an issue for largefile names.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-12-09 14:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 19:04 [PATCH 0/3] Fixing missing 64 bit time_t usages Adhemerval Zanella
2022-10-26 19:04 ` [PATCH 1/3] nis: Build libnsl with 64 bit time_t Adhemerval Zanella
2022-12-09  4:30   ` DJ Delorie
2022-12-09  4:31   ` DJ Delorie
2022-12-09 14:35     ` Adhemerval Zanella Netto
2022-10-26 19:04 ` [PATCH 2/3] nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402) Adhemerval Zanella
2022-10-26 21:42   ` DJ Delorie
2022-10-27 12:31     ` Adhemerval Zanella Netto
2022-10-27 12:48     ` Andreas Schwab
2022-12-09  4:30   ` DJ Delorie
2022-10-26 19:04 ` [PATCH 3/3] time: Use 64 bit time on tzfile Adhemerval Zanella
2022-12-09  4:31   ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).