From: Eli Zaretskii <eliz@gnu.org>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: emacs-devel@gnu.org
Subject: Re: implement Solaris support for system-process-attributes and list-system-processes
Date: Thu, 18 Dec 2008 22:22:14 +0200 [thread overview]
Message-ID: <u4p11fd3d.fsf@gnu.org> (raw)
In-Reply-To: <200812180916.mBI9GJtr012310@mothra.ics.uci.edu>
> Date: Thu, 18 Dec 2008 01:16:19 -0800 (PST)
> From: Dan Nicolaescu <dann@ics.uci.edu>
>
> #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 <procfs.h>
> #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/ ?
> 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.
> 4. Flist_system_processes and Fsystem_process_attributes use the
> LISTPROC and PROCATTR macros for function calls that need to be defined in src/s/*.h
> These macros are different from how other platform specific functions
> are implemented in emacs, and they seem to be a bit redundant: the
> functions to implement these are system specific anyway....
I hoped that systems with procfs will have only minor differences,
that's why I opted for these macros. In addition, having the macros
provides an easy way of switching between 2 different implementations
on the same platform. But these are not very important reasons, so I
don't object to some different solution.
> So what's the best way to integrate Solaris support?
> Again the existing procfs_list_system_processes function can probably be
> used by all systems using /proc, but procfs_system_process_attributes
> is very likely to be OS specific.
If /proc systems are different to the degree that splitting them into
a common part and OS-specific parts is impractical or unjustified, I
think the implementations of procfs_system_process_attributes should
be moved to sysdep.c, and there we could have a separate variant for
each OS.
next prev parent reply other threads:[~2008-12-18 20:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 9:16 implement Solaris support for system-process-attributes and list-system-processes Dan Nicolaescu
2008-12-18 20:22 ` Eli Zaretskii [this message]
2008-12-19 7:45 ` Dan Nicolaescu
2008-12-19 8:35 ` Eli Zaretskii
2008-12-19 19:51 ` Dan Nicolaescu
2008-12-20 12:10 ` Eli Zaretskii
2008-12-19 8:48 ` Miles Bader
2008-12-19 19:51 ` Dan Nicolaescu
2008-12-20 3:40 ` Miles Bader
2008-12-20 3:50 ` Dan Nicolaescu
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=u4p11fd3d.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dann@ics.uci.edu \
--cc=emacs-devel@gnu.org \
/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.