unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* syswait.h
@ 2002-07-26 18:43 Richard Stallman
  2002-07-26 18:52 ` syswait.h Andreas Schwab
  2002-07-29 11:08 ` syswait.h Klaus Zeitler
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Stallman @ 2002-07-26 18:43 UTC (permalink / raw)


It looks like your system's sys/wait.h defines macros to access the
wait argument as a structure, but that is not what Emacs expects on a
POSIX system.  I don't have a copy of the POSIX spec here; does anyone
know what it says about this?

Meanwhile, I think some people have build Emacs on HPUX 11
and do not have this problem.  Why is that?  Could others who
have HPUX 11 see how these macros are defined in sys/wait.h?
Do they expect to operate on a struct or on an int?

If you add #undef HAVE_SYS_WAIT_H to s/hpux11.h, does that make it
work?


To: rms@gnu.org
Cc: emacs-pretest-bug@gnu.org
Subject: Re: build under HP-UX-B.10.20 or 11.11 fails in process.c
References: <q5gd6tmwixu.fsf@lucent.com>
	<200207181455.g6IEtRe25036@aztec.santafe.edu>
X-Uboat-Death-Message: 
   ATTACKED BY ATOMIC BOMB. CAPTAIN INTOXICATED. SINKING. U-144.
From: Klaus Zeitler <kzeitler@lucent.com>
Date: 19 Jul 2002 17:42:46 +0200
In-Reply-To: <200207181455.g6IEtRe25036@aztec.santafe.edu>
Message-ID: <q5g7kjrn2q1.fsf@lucent.com>
Lines: 60
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Length: 1510

>>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:
    Richard> 
    Richard> Can you figure out what caused the problem?

WAITTYPE is defined as int in syswait.h, but macros defined in
/usr/include/sys/wait.h that deal with WAITTYPE,
e.g. WIFSTOPPED, try to access variables of type WAITTYPE as a struct.

e.g. status_convert from process.c:


Lisp_Object
status_convert (w)
     WAITTYPE w;
{
  if (WIFSTOPPED (w))
    return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil));


looks in preprocessor file like:


int
status_convert (w)
     int w;
{
  if (((w).w_S.w_Stopval == 0177))
    return Fcons (Qstop, Fcons (((((int) (((w).w_S.w_Stopsig))) & ((((int) 1)<<(32 - 4)) - 1)) | ((int) Lisp_Int) << (32 - 4)), Qnil));



So either the definition or the macros need to change.
I've done it the bold way, by undefining HAVE_SYS_WAIT_H
(first I changed config.h but hpux8.h explicitly defines HAVE_SYS_WAIT_H
so I went ahead and inserted in syswait.h:

#if defined(HPUX10) || defined(HPUX11)
#undef HAVE_SYS_WAIT_H
#endif

right after the line:
#include <sys/types.h>


that works, but may not be the developers intention, but with this change
emacs cvs compiles on HP-UX 10.20 and 11.11


Klaus



-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Never let your sense of morals prevent you from doing
what is right.         -- Salvor Hardin, "Foundation"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: syswait.h
  2002-07-26 18:43 syswait.h Richard Stallman
@ 2002-07-26 18:52 ` Andreas Schwab
  2002-07-29 11:08 ` syswait.h Klaus Zeitler
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2002-07-26 18:52 UTC (permalink / raw)
  Cc: kzeitler, emacs-devel

Richard Stallman <rms@gnu.org> writes:

|> It looks like your system's sys/wait.h defines macros to access the
|> wait argument as a structure, but that is not what Emacs expects on a
|> POSIX system.  I don't have a copy of the POSIX spec here; does anyone
|> know what it says about this?

POSIX does not define union wait, and wait/waitpid take a pointer to int
for the status.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: syswait.h
  2002-07-26 18:43 syswait.h Richard Stallman
  2002-07-26 18:52 ` syswait.h Andreas Schwab
@ 2002-07-29 11:08 ` Klaus Zeitler
  2002-07-30  0:59   ` syswait.h Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Klaus Zeitler @ 2002-07-29 11:08 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:
    Richard> 
    Richard> It looks like your system's sys/wait.h defines macros to access
    Richard> the wait argument as a structure, but that is not what Emacs
    Richard> expects on a POSIX system.  I don't have a copy of the POSIX spec
    Richard> here; does anyone know what it says about this?
    Richard> 
    Richard> Meanwhile, I think some people have build Emacs on HPUX 11
    Richard> and do not have this problem.  Why is that?  Could others who
    Richard> have HPUX 11 see how these macros are defined in sys/wait.h?
    Richard> Do they expect to operate on a struct or on an int?
    Richard> 
this is amazing, so here's an excerpt from /usr/include/sys/wait.h, i.e.
the last 20 lines:

#ifdef _BSD
#  undef  WIFEXITED
#  define WIFEXITED(_X)		((_X).w_stopval != WSTOPFLG && (_X).w_termsig == 0)
#  undef  WIFSTOPPED
#  define WIFSTOPPED(_X)	((_X).w_stopval == WSTOPFLG)
#  undef  WIFSIGNALED
#  define WIFSIGNALED(_X)	((_X).w_stopval != WSTOPFLG && (_X).w_termsig != 0)
#  undef  WEXITSTATUS
#  define WEXITSTATUS(_X) 	((_X).w_retcode)
#  undef  WTERMSIG
#  define WTERMSIG(_X)    	((_X).w_termsig)
#  undef  WCOREDUMP
#  define WCOREDUMP(_X)   	((_X).w_coredump)
#  undef  WSTOPSIG
#  define WSTOPSIG(_X)    	((_X).w_stopsig)
#endif  /* _BSD */

#endif	/* _SYS_WAIT_INCLUDED */


now looking at wait.h I thought maybe an #undef of _BSD would do also and
yes it works when I remove those 2 -D_BSD definitions from:
gcc -c -D_BSD   -Demacs -DHAVE_CONFIG_H -DUSE_MOTIF  -I. -I/vol/freeware/source/emacs-cvs/emacs/src -D_BSD -I/usr/include/X11R6 -I/usr/local/gnu/include -I/usr/include/X11R6 -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/contrib/X11R6/include -I/usr/contrib/X11R5/include -g -O2 /vol/freeware/source/emacs-cvs/emacs/src/process.c

a quick grep for _BSD showed that this is hardly used, but set in Makefile,
so I removed it and emacs compiled fine (under HP-UX-B.11.11).
So maybe it would be a better idea to remove -D_BSD instead of
an undef of HAVE_SYS_WAIT_H

    Richard> If you add #undef HAVE_SYS_WAIT_H to s/hpux11.h, does that make it
    Richard> work?
    Richard> 
I've put it in s/hpux10.h since I had the same problems under 10.20 and yes
that works for 10.20 and 11.11, but as I said above I think it'd be
better to remove _BSD (for HP-UX 10.20 and above that is)

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
The economy depends about as much on economists as the weather
does on weather forecasters.            -- Jean-Paul Kauffmann

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: syswait.h
  2002-07-29 11:08 ` syswait.h Klaus Zeitler
@ 2002-07-30  0:59   ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2002-07-30  0:59 UTC (permalink / raw)
  Cc: emacs-devel

    a quick grep for _BSD showed that this is hardly used, but set in Makefile,

Could you please show me exactly what defines _BSD, and where?
I don't see it.  (I don't have HPUX.)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-30  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-26 18:43 syswait.h Richard Stallman
2002-07-26 18:52 ` syswait.h Andreas Schwab
2002-07-29 11:08 ` syswait.h Klaus Zeitler
2002-07-30  0:59   ` syswait.h Richard Stallman

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).