From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: implement Solaris support for system-process-attributes and list-system-processes Date: Fri, 19 Dec 2008 10:35:48 +0200 Message-ID: References: <200812180916.mBI9GJtr012310@mothra.ics.uci.edu> <200812190745.mBJ7jWVe015085@mothra.ics.uci.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1229675764 23101 80.91.229.12 (19 Dec 2008 08:36:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2008 08:36:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 19 09:37:11 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LDar7-00070C-JN for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2008 09:37:09 +0100 Original-Received: from localhost ([127.0.0.1]:38528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDapv-0001Tn-9l for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2008 03:35:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDapp-0001Qq-L2 for emacs-devel@gnu.org; Fri, 19 Dec 2008 03:35:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDapp-0001QA-41 for emacs-devel@gnu.org; Fri, 19 Dec 2008 03:35:49 -0500 Original-Received: from [199.232.76.173] (port=50563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDapo-0001Q3-Uo for emacs-devel@gnu.org; Fri, 19 Dec 2008 03:35:48 -0500 Original-Received: from mtaout3.012.net.il ([84.95.2.7]:42779) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LDapo-00024q-Gl for emacs-devel@gnu.org; Fri, 19 Dec 2008 03:35:48 -0500 Original-Received: from conversion-daemon.i_mtaout3.012.net.il by i_mtaout3.012.net.il (HyperSendmail v2004.12) id <0KC4009007TOZR00@i_mtaout3.012.net.il> for emacs-devel@gnu.org; Fri, 19 Dec 2008 10:38:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.241.241]) by i_mtaout3.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KC400IY97ZPKMF0@i_mtaout3.012.net.il>; Fri, 19 Dec 2008 10:38:13 +0200 (IST) In-reply-to: <200812190745.mBJ7jWVe015085@mothra.ics.uci.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107060 Archived-At: > Date: Thu, 18 Dec 2008 23:45:32 -0800 (PST) > From: Dan Nicolaescu > Cc: emacs-devel@gnu.org > > Eli Zaretskii writes: > > > > Date: Thu, 18 Dec 2008 01:16:19 -0800 (PST) > > > From: Dan Nicolaescu > > > > > > #ifdef SOLARIS2 > > > #if !defined (_LP64) && defined (_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) > > > #define PROCFS_FILE_OFFSET_BITS_HACK 1 > > > #undef _FILE_OFFSET_BITS > > > #else > > > #define PROCFS_FILE_OFFSET_BITS_HACK 0 > > > #endif > > > #include > > > #if PROCFS_FILE_OFFSET_BITS_HACK == 1 > > > #define _FILE_OFFSET_BITS 64 > > > #endif > > > #endif /* SOLARIS2 */ > > > > > > procfs.h is the header file that contains the proc data structures, but > > > it has an #error if compiled in 32 bit mode and _FILE_OFFSET_BITS is > > > 64. > > > emacs/src/config.in will define _FILE_OFFSET_BITS to 64 when compiled on > > > a 32 bit solaris system. Hence the above hackery. > > > > Can this hackery be moved to a Solaris-specific header file in src/s/ ? > > That file is included everywhere, so it might not be a good idea at this point. It's just too ugly, so if there's a good place to hide it out of sight, I'd be happier. > How does this sound: > - move the procfs_list_system_processes and procfs_system_process_attributes to sysdep.c > - remove the procfs_ prefix > - add the proper #defines (HAVE_PROCFS can probably be used by a few OSes) > - the default implementations just return Qnil > - make Fsystem_process_attributes and Flist_system_processes just call > list_system_processes and system_process_attributes > - rename the w32 versions to system_process_attributes and list_system_processes > - remove the PROCATTR and LISTPROC macros > ? Sounds good to me. Btw, it strikes me that the default implementation could return the Emacs process instead of Qnil, but that can wait for another rainy day.