public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] inptl: Use 64 bit time_t stat internally for sem_open (BZ #28880)
@ 2022-02-11 12:50 Adhemerval Zanella
  2022-02-11 14:52 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2022-02-11 12:50 UTC (permalink / raw)
  To: libc-alpha

The __sem_check_add_mapping internal stat calls fails with
EOVERFLOW if system time is larger than 32 bit.

It is a missing spot from 52a5fe70a2c fix to use 64 bit stat
internally.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 sysdeps/pthread/sem_routines.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/pthread/sem_routines.c b/sysdeps/pthread/sem_routines.c
index 9e1924398d..877e1e8556 100644
--- a/sysdeps/pthread/sem_routines.c
+++ b/sysdeps/pthread/sem_routines.c
@@ -25,7 +25,7 @@
 struct inuse_sem
 {
   dev_t dev;
-  ino_t ino;
+  ino64_t ino;
   int refcnt;
   sem_t *sem;
   char name[];
@@ -34,7 +34,7 @@ struct inuse_sem
 struct search_sem
 {
   dev_t dev;
-  ino_t ino;
+  ino64_t ino;
   int refcnt;
   sem_t *sem;
   char name[NAME_MAX + 1];
@@ -77,8 +77,8 @@ __sem_check_add_mapping (const char *name, int fd, sem_t *existing)
   sem_t *result = SEM_FAILED;
 
   /* Get the information about the file.  */
-  struct stat64 st;
-  if (__fstat64 (fd, &st) == 0)
+  struct __stat64_t64 st;
+  if (__fstat64_time64 (fd, &st) == 0)
     {
       /* Get the lock.  */
       lll_lock (sem_mappings_lock, LLL_PRIVATE);
-- 
2.32.0


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

* Re: [PATCH] inptl: Use 64 bit time_t stat internally for sem_open (BZ #28880)
  2022-02-11 12:50 [PATCH] inptl: Use 64 bit time_t stat internally for sem_open (BZ #28880) Adhemerval Zanella
@ 2022-02-11 14:52 ` Florian Weimer
  2022-02-11 18:18   ` Adhemerval Zanella
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2022-02-11 14:52 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

* Adhemerval Zanella via Libc-alpha:

> The __sem_check_add_mapping internal stat calls fails with
> EOVERFLOW if system time is larger than 32 bit.
>
> It is a missing spot from 52a5fe70a2c fix to use 64 bit stat
> internally.

Typo in the subject, and this isn't actually nptl-specific, so you could
use pthread.  But I think you will need to come up with caustom solution
for Hurd.

Thanks,
Florian


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

* Re: [PATCH] inptl: Use 64 bit time_t stat internally for sem_open (BZ #28880)
  2022-02-11 14:52 ` Florian Weimer
@ 2022-02-11 18:18   ` Adhemerval Zanella
  0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2022-02-11 18:18 UTC (permalink / raw)
  To: Florian Weimer, Adhemerval Zanella via Libc-alpha



On 11/02/2022 11:52, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The __sem_check_add_mapping internal stat calls fails with
>> EOVERFLOW if system time is larger than 32 bit.
>>
>> It is a missing spot from 52a5fe70a2c fix to use 64 bit stat
>> internally.
> 
> Typo in the subject, and this isn't actually nptl-specific, so you could
> use pthread.  But I think you will need to come up with caustom solution
> for Hurd.

Hurd will continue to use the code as-is, __fstat64_time64 will continue
to be __fstat64.

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

end of thread, other threads:[~2022-02-11 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 12:50 [PATCH] inptl: Use 64 bit time_t stat internally for sem_open (BZ #28880) Adhemerval Zanella
2022-02-11 14:52 ` Florian Weimer
2022-02-11 18:18   ` Adhemerval Zanella

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).