From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs 28.1 doesn't compile on Mac OS 10.7.5 Date: Fri, 15 Apr 2022 18:41:28 +0200 Message-ID: <13EE40A1-503F-4CDE-8334-E818E8702DCE@acm.org> References: <20220415.135547.28187788939231142.wl@gnu.org> <3F594037-7DF0-406B-A8DB-8709F76D7583@acm.org> <20220415.172301.1386462415020611428.wl@gnu.org> <2BC45081-033F-4796-891E-D052149C8BCB@acm.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_C5AC425B-469F-40C9-9371-4C79179B01F2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40353"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dports@macports.org, Paul Eggert , Filipp Gunbin , Emacs-Devel To: Werner LEMBERG Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 15 18:48:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfP7x-000AHJ-Ev for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Apr 2022 18:48:57 +0200 Original-Received: from localhost ([::1]:53846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfP7w-0006LX-3r for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Apr 2022 12:48:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfP5c-0005F7-40 for emacs-devel@gnu.org; Fri, 15 Apr 2022 12:46:32 -0400 Original-Received: from mail1446c50.megamailservers.eu ([91.136.14.46]:40784 helo=mail265c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfP5Z-0000lg-SO; Fri, 15 Apr 2022 12:46:31 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1650041173; bh=cDwSkXhw3fUJMjGo1O9WxoZvNL2jvsQ7bYatzDRH9+k=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=h+DLn137Ibi128jVULJcD/83n3EUfSDBacbqim58pyHubyXUWRqmhKqf4kueVeIsT TVVphgIqX4P5uPpLL03Od4Qomyn9KXKtST5LTYo8CeAgO18O35n9M0DsH2Wa5WRl5o OqdT6fbupThsa0wOtfmI9mXvD2W/U/y8x9WMYQxw= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 23FGkAD8022436; Fri, 15 Apr 2022 16:46:12 +0000 In-Reply-To: <2BC45081-033F-4796-891E-D052149C8BCB@acm.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F19.6259A155.002A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.46; envelope-from=mattiase@acm.org; helo=mail265c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288451 Archived-At: --Apple-Mail=_C5AC425B-469F-40C9-9371-4C79179B01F2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 15 apr. 2022 kl. 18.22 skrev Mattias Engdeg=C3=A5rd : > This appears to be a consequence of 6d51805154 (bug#48548) which uses = an interface that was introduced in macOS 10.9. It should be possible to = unify the old and new code to get something that works on your system as = well. I'll write a patch. Please try this (not tested on your macOS version). --Apple-Mail=_C5AC425B-469F-40C9-9371-4C79179B01F2 Content-Disposition: attachment; filename=old-macos-proced.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="old-macos-proced.diff" Content-Transfer-Encoding: 7bit diff --git a/src/sysdep.c b/src/sysdep.c index 1e630835ad..b184c8e7a7 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -4027,6 +4027,9 @@ system_process_attributes (Lisp_Object pid) #elif defined DARWIN_OS +#define HAVE_PROC_PID_RUSAGE (MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) +#define HAVE_PROC_PIDINFO (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) + Lisp_Object system_process_attributes (Lisp_Object pid) { @@ -4130,6 +4133,7 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qtpgid, INT_TO_INTEGER (proc.kp_eproc.e_tpgid)), attrs); +#if HAVE_PROC_PID_RUSAGE rusage_info_current ri; if (proc_pid_rusage(proc_id, RUSAGE_INFO_CURRENT, (rusage_info_t *) &ri) == 0) { @@ -4143,6 +4147,24 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qmajflt, INT_TO_INTEGER (ri.ri_pageins)), attrs); } +#else /* !HAVE_PROC_PID_RUSAGE */ + struct rusage *rusage = proc.kp_proc.p_ru; + if (rusage) + { + attrs = Fcons (Fcons (Qminflt, INT_TO_INTEGER (rusage->ru_minflt)), + attrs); + attrs = Fcons (Fcons (Qmajflt, INT_TO_INTEGER (rusage->ru_majflt)), + attrs); + + attrs = Fcons (Fcons (Qutime, make_lisp_timeval (rusage->ru_utime)), + attrs); + attrs = Fcons (Fcons (Qstime, make_lisp_timeval (rusage->ru_stime)), + attrs); + struct timespec t = timespec_add (timeval_to_timespec (rusage->ru_utime), + timeval_to_timespec (rusage->ru_stime)); + attrs = Fcons (Fcons (Qtime, make_lisp_time (t)), attrs); + } +#endif /* !HAVE_PROC_PID_RUSAGE */ starttime = proc.kp_proc.p_starttime; attrs = Fcons (Fcons (Qnice, make_fixnum (proc.kp_proc.p_nice)), attrs); @@ -4152,6 +4174,7 @@ system_process_attributes (Lisp_Object pid) t = timespec_sub (now, timeval_to_timespec (starttime)); attrs = Fcons (Fcons (Qetime, make_lisp_time (t)), attrs); +#if HAVE_PROC_PIDINFO struct proc_taskinfo taskinfo; if (proc_pidinfo (proc_id, PROC_PIDTASKINFO, 0, &taskinfo, sizeof (taskinfo)) > 0) { @@ -4159,6 +4182,7 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qrss, make_fixnum (taskinfo.pti_resident_size / 1024)), attrs); attrs = Fcons (Fcons (Qthcount, make_fixnum (taskinfo.pti_threadnum)), attrs); } +#endif /* HAVE_PROC_PIDINFO */ #ifdef KERN_PROCARGS2 char args[ARG_MAX]; --Apple-Mail=_C5AC425B-469F-40C9-9371-4C79179B01F2--