all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Andreas Schwab <schwab@suse.de>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	bug-gnulib@gnu.org, Emacs-devel@gnu.org
Subject: Re: boot-time: straighten code
Date: Mon, 14 Aug 2023 15:51:08 +0200	[thread overview]
Message-ID: <3585595.R9S75c37gh@nimes> (raw)
In-Reply-To: <mvm7cpxewwy.fsf@suse.de>

Andreas Schwab wrote:
> >    char ut_host[__UT_HOSTSIZE];     /* Hostname for remote login. */
> 
> That's still using reserved symbols.

Fixed through the patch below.

But that is just a workaround. Is someone among the glibc people looking at the
original glibc bug https://sourceware.org/bugzilla/show_bug.cgi?id=30701 ?


2023-08-14  Bruno Haible  <bruno@clisp.org>

	readutmp, boot-time: Don't use __UT_* symbols (regression 2023-08-11).
	* lib/readutmp.h (_GL_UT_USER_SIZE, _GL_UT_ID_SIZE, _GL_UT_LINE_SIZE,
	_GL_UT_HOST_SIZE): New macros.
	(struct utmpx32): Use them.

diff --git a/lib/readutmp.h b/lib/readutmp.h
index 1fbe29d86f..3ddecf3727 100644
--- a/lib/readutmp.h
+++ b/lib/readutmp.h
@@ -136,14 +136,18 @@ enum { UT_HOST_SIZE = -1 };
 /* This is a near-copy of glibc's struct utmpx, which stops working
    after the year 2038.  Unlike the glibc version, struct utmpx32
    describes the file format even if time_t is 64 bits.  */
+#define _GL_UT_USER_SIZE  sizeof (((struct utmpx *) 0)->ut_user)
+#define _GL_UT_ID_SIZE    sizeof (((struct utmpx *) 0)->ut_id)
+#define _GL_UT_LINE_SIZE  sizeof (((struct utmpx *) 0)->ut_line)
+#define _GL_UT_HOST_SIZE  sizeof (((struct utmpx *) 0)->ut_host)
 struct utmpx32
 {
   short int ut_type;               /* Type of login.  */
   pid_t ut_pid;                    /* Process ID of login process.  */
-  char ut_line[__UT_LINESIZE];     /* Devicename.  */
-  char ut_id[4];                   /* Inittab ID.  */
-  char ut_user[__UT_NAMESIZE];     /* Username.  */
-  char ut_host[__UT_HOSTSIZE];     /* Hostname for remote login. */
+  char ut_line[_GL_UT_LINE_SIZE];  /* Devicename.  */
+  char ut_id[_GL_UT_ID_SIZE];      /* Inittab ID.  */
+  char ut_user[_GL_UT_USER_SIZE];  /* Username.  */
+  char ut_host[_GL_UT_HOST_SIZE];  /* Hostname for remote login. */
   struct __exit_status ut_exit;    /* Exit status of a process marked
                                       as DEAD_PROCESS.  */
   /* The fields ut_session and ut_tv must be the same size when compiled






  reply	other threads:[~2023-08-14 13:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4536176.VaOIPsP7d9@nimes>
2023-08-13  2:49 ` boot-time: straighten code Paul Eggert
2023-08-13  3:26   ` Po Lu
2023-08-13  6:35     ` Paul Eggert
2023-08-13 13:45     ` Bruno Haible
2023-08-13 14:16     ` Bruno Haible
2023-08-13 14:36     ` Bruno Haible
2023-08-13 23:44       ` Po Lu
2023-08-13 23:59         ` Bruno Haible
2023-08-14  1:07           ` Po Lu
2023-08-14  2:14             ` Corwin Brust
2023-08-15 19:57               ` Windows port binaries Bruno Haible
2023-08-16  6:45                 ` Po Lu
2023-08-16 11:36                 ` Eli Zaretskii
2023-08-17 14:01                   ` Bruno Haible
2023-08-17 14:14                     ` Eli Zaretskii
2023-08-14  8:02   ` boot-time: straighten code Andreas Schwab
2023-08-14  9:15     ` Bruno Haible
2023-08-14  9:20       ` Andreas Schwab
2023-08-14 10:19         ` Bruno Haible
2023-08-14 10:33           ` Andreas Schwab
2023-08-14 13:51             ` Bruno Haible [this message]
2023-08-15 23:03               ` Paul Eggert
2023-08-15 21:12   ` Bruno Haible
2023-08-16 10:13     ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3585595.R9S75c37gh@nimes \
    --to=bruno@clisp.org \
    --cc=Emacs-devel@gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.