From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: implement Solaris support for system-process-attributes and list-system-processes Date: Thu, 18 Dec 2008 23:45:32 -0800 (PST) Message-ID: <200812190745.mBJ7jWVe015085@mothra.ics.uci.edu> References: <200812180916.mBI9GJtr012310@mothra.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229672760 15322 80.91.229.12 (19 Dec 2008 07:46:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2008 07:46:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 19 08:47:06 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 1LDa4g-0001b6-9U for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2008 08:47:06 +0100 Original-Received: from localhost ([127.0.0.1]:43855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDa3T-0004yz-VN for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2008 02:45:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDa3O-0004yk-4d for emacs-devel@gnu.org; Fri, 19 Dec 2008 02:45:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDa3M-0004yY-KZ for emacs-devel@gnu.org; Fri, 19 Dec 2008 02:45:44 -0500 Original-Received: from [199.232.76.173] (port=58246 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDa3M-0004yV-EK for emacs-devel@gnu.org; Fri, 19 Dec 2008 02:45:44 -0500 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:63065) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LDa3G-0006AK-Oz; Fri, 19 Dec 2008 02:45:39 -0500 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id mBJ7jWGx007279; Thu, 18 Dec 2008 23:45:32 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mBJ7jWVe015085; Thu, 18 Dec 2008 23:45:32 -0800 (PST) In-Reply-To: (Eli Zaretskii's message of "Thu, 18 Dec 2008 22:22:14 +0200") Original-Lines: 48 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mBJ7jWGx007279 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.363, required 5, autolearn=disabled, ALL_TRUSTED -1.44, TW_OC 0.08) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:107056 Archived-At: 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. > > 2. process.c has a function `procfs_list_system_processes' that works on > > Solaris (and probably on all systems that use a /proc). > > The problem is that procfs_list_system_processes is inside a #ifdef HAVE_PROCFS > > that contains a few other functions (time_from_jiffies, get_up_time) > > that are Linux specific. > > Should I move those functions inside a #ifdef LINUX ? > > I guess GNU_LINUX would be better, and perhaps move them to sysdep.c > while at that. 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 ?