port/getrusage.c?

Started by Nonamealmost 28 years ago15 messages
#1Noname
t-ishii@sra.co.jp

Does anybody know why getrusage() in backend/port/getrusage.c is
removed (surrounded by #if 0)?

Some ports including Solaris 2.4, NEWS OS 6 (I'm trying now) etc. need
getrusage().
--
Tatsuo Ishii
t-ishii@sra.co.jp

#2Hal Snyder
hal@vailsys.com
In reply to: Noname (#1)
Re: [HACKERS] port/getrusage.c?

From: t-ishii@sra.co.jp
Date: Thu, 12 Mar 1998 11:13:54 +0900

Does anybody know why getrusage() in backend/port/getrusage.c is
removed (surrounded by #if 0)?

Some ports including Solaris 2.4, NEWS OS 6 (I'm trying now) etc. need
getrusage().

I have the same question - have been wrestling with the SCO (ODT 5)
port. Actually all we need here is client-side pgsql code to run on
SCO so I butchered my way thru the build to make it happen.

Used gcc-2.8.1 to get past the monster macro - altho if there's C
code we can put in for easily confused compilers it would be nice to
have a port buildable with SCO native tools. Bruce?

Additions to wishlist - client-only builds, fix setup so Pg.pm builds
on first install.

Will be happy to work with the experts on SCO port + these small
items - my hat is off to the 6.3 team.

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Hal Snyder (#2)
Re: [HACKERS] port/getrusage.c?

I have the same question - have been wrestling with the SCO (ODT 5)
port. Actually all we need here is client-side pgsql code to run on
SCO so I butchered my way thru the build to make it happen.

Used gcc-2.8.1 to get past the monster macro - altho if there's C
code we can put in for easily confused compilers it would be nice to
have a port buildable with SCO native tools. Bruce?

OK, please tell me what macro is a monster, and what define I can check
to see if I am using the SCO/Microsoft/piece-O-junk :-) compiler, and I
will take a crack at making a static function out of the macro and send
you a patch to test.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#4Hal Snyder
hal@vailsys.com
In reply to: Bruce Momjian (#3)
Re: [HACKERS] port/getrusage.c?

From: Bruce Momjian <maillist@candle.pha.pa.us>
Date: Wed, 11 Mar 1998 23:11:37 -0500 (EST)

OK, please tell me what macro is a monster, and what define I can check
to see if I am using the SCO/Microsoft/piece-O-junk :-) compiler, and I
will take a crack at making a static function out of the macro and send
you a patch to test.

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

BTW just so you won't think we're total idiots - we run the pgsql
server on FreeBSD where it belongs - but some of our hosts use
hardware for which vendors refuse to allow FreeBSD support. Thus we
have SCO systems (plus hardware to reboot them when they wedge).

#5Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Hal Snyder (#4)
Re: [HACKERS] port/getrusage.c?

From: Bruce Momjian <maillist@candle.pha.pa.us>
Date: Wed, 11 Mar 1998 23:11:37 -0500 (EST)

OK, please tell me what macro is a monster, and what define I can check
to see if I am using the SCO/Microsoft/piece-O-junk :-) compiler, and I
will take a crack at making a static function out of the macro and send
you a patch to test.

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

What define can I use to check for SCO open-deathtrap cc?

BTW just so you won't think we're total idiots - we run the pgsql
server on FreeBSD where it belongs - but some of our hosts use
hardware for which vendors refuse to allow FreeBSD support. Thus we
have SCO systems (plus hardware to reboot them when they wedge).

This is funny.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#6The Hermit Hacker
scrappy@hub.org
In reply to: Hal Snyder (#4)
Re: [HACKERS] port/getrusage.c?

On Wed, 11 Mar 1998, Hal Snyder wrote:

From: Bruce Momjian <maillist@candle.pha.pa.us>
Date: Wed, 11 Mar 1998 23:11:37 -0500 (EST)

OK, please tell me what macro is a monster, and what define I can check
to see if I am using the SCO/Microsoft/piece-O-junk :-) compiler, and I
will take a crack at making a static function out of the macro and send
you a patch to test.

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

I don't believe that this is a "religious war" issue...but why do
ppl even *use* the stock C compilers anymore? I know at work we us all
GCC/G++ stuff, since its one helluva lot cheaper then picking up Sun's CC
compiler...I'm not advocating requiring GCC...just wondering one ppl
actually do use the stock compiler..

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

#7Hal Snyder
hal@vailsys.com
In reply to: Bruce Momjian (#5)
Re: [HACKERS] port/getrusage.c?

From: Bruce Momjian <maillist@candle.pha.pa.us>
Date: Thu, 12 Mar 1998 00:15:51 -0500 (EST)

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

What define can I use to check for SCO open-deathtrap cc?

Good question. I don't see one, but the config stuff is not familiar
ground. There is reference to "sco" on line 85 of

src/include/utils/memutils.h - "#if ! defined(sco)"

but I think nothing sets this any more. (Actually this is another
thing on the list of SCO breakage in 6.3). I'd add something to the
template for sco.

#8Hal Snyder
hal@vailsys.com
In reply to: Hal Snyder (#7)
Re: [HACKERS] port/getrusage.c?

From: dg@illustra.com (David Gould)
Date: Wed, 11 Mar 1998 22:37:59 -0800 (PST)

...

Good question. I don't see one, but the config stuff is not familiar
ground. There is reference to "sco" on line 85 of

src/include/utils/memutils.h - "#if ! defined(sco)"

but I think nothing sets this any more. (Actually this is another
thing on the list of SCO breakage in 6.3). I'd add something to the
template for sco.

What is the policy for defines on Postgres?

It is often suggested that that 'ifdef defined(RANDOM_PLATFORM)' is not a
nice way to proceed. Far better to use for example 'defined(HAS_FEATURE_XYZ)'
than something like:

'defined(SOLARIS) or defined(SUNOS) or defined(PYRAMID) && !defined(WIN32)'.

In the case at hand, perhaps something like 'if defined(BROKEN_CPP_GCC_271)',
and then define it in the SCO part of the build system. After all, SCO
might survive long enough to upgrade to a current compiler...

Ack. How about changing

CFLAGS:

to

CFLAGS:-DLAME_CPP

in src/templates/sco?

#9Hal Snyder
hal@vailsys.com
In reply to: The Hermit Hacker (#6)
Re: [HACKERS] port/getrusage.c?

Date: Thu, 12 Mar 1998 01:48:28 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
cc: maillist@candle.pha.pa.us, hackers@postgreSQL.org

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

I don't believe that this is a "religious war" issue...but why do
ppl even *use* the stock C compilers anymore? I know at work we us all
GCC/G++ stuff, since its one helluva lot cheaper then picking up Sun's CC
compiler...I'm not advocating requiring GCC...just wondering one ppl
actually do use the stock compiler..

1. Corporate engineering management scared of stuff that only builds
with GNU tools and not "commercial quality" native compiler. Feh.

2. OS's so whacked-out that GNU tools don't build without major pain
and suffering. Look at what it took to build pre-2.8 gcc on SCO.

Where I work we have two kinds of programmer using the same SCO
development system - the GNU'ers who spend as much time as possible on
FreeBSD and only use the SCO box when held at gunpoint, and the SCO
users who would just get all confused by enhanced warnings emitted by
gcc -Wall -ansi -pedantic (prototype checking, printf arg checks, etc)
and just sit catatonic in their cubes for weeks if their moldy old
/bin/cc tools don't work on a module they pull out of CVS. Aargh.

#10Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Hal Snyder (#7)
Re: [HACKERS] port/getrusage.c?

From: Bruce Momjian <maillist@candle.pha.pa.us>
Date: Thu, 12 Mar 1998 00:15:51 -0500 (EST)

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

What define can I use to check for SCO open-deathtrap cc?

Good question. I don't see one, but the config stuff is not familiar
ground. There is reference to "sco" on line 85 of

src/include/utils/memutils.h - "#if ! defined(sco)"

but I think nothing sets this any more. (Actually this is another
thing on the list of SCO breakage in 6.3). I'd add something to the
template for sco.

Go to src/tools and run ccsym with the SCO compiler. Send me the
output. Should be something unique in there.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#11Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Hal Snyder (#8)
Re: [HACKERS] port/getrusage.c?]

'defined(SOLARIS) or defined(SUNOS) or defined(PYRAMID) && !defined(WIN32)'.

In the case at hand, perhaps something like 'if defined(BROKEN_CPP_GCC_271)',
and then define it in the SCO part of the build system. After all, SCO
might survive long enough to upgrade to a current compiler...

Ack. How about changing

CFLAGS:

to

CFLAGS:-DLAME_CPP

in src/templates/sco?

But we don't want that if they use a good compiler under SCO. I have
asked them to run src/tools/ccsym and send the output. Should be
something unique in there.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#12Noname
darrenk@insightdist.com
In reply to: Bruce Momjian (#10)
Re: [HACKERS] port/getrusage.c?

OK, please tell me what macro is a monster, and what define I can check
to see if I am using the SCO/Microsoft/piece-O-junk :-) compiler, and I
will take a crack at making a static function out of the macro and send
you a patch to test.

src/include/access/heapam.h - heap_getattr is the one that blows the
mind of SCO ODT5 /bin/cc as well as their Skunkware gcc-2.7.2.1. Pure
GNU 2.8.1 was all I could get to handle it.

I don't believe that this is a "religious war" issue...but why do
ppl even *use* the stock C compilers anymore? I know at work we us all
GCC/G++ stuff, since its one helluva lot cheaper then picking up Sun's CC
compiler...I'm not advocating requiring GCC...just wondering one ppl
actually do use the stock compiler..

Because it was there...

darrenk

#13Hal Snyder
hal@vailsys.com
In reply to: Bruce Momjian (#11)
SCO vs. the monster macro

But we don't want that if they use a good compiler under SCO. I have
asked them to run src/tools/ccsym and send the output. Should be
something unique in there.

On SCO, ccsym becomes /bin/cc -b elf -ii -E foo.c, which after filtering
gives the symbols below. If I omit "-b elf", the last line is replaced
by the two lines
'-D_M_COFF'
'-D_SCO_COFF'

How about _SCO_DS as the define when testing for SCO's native
compiler? (I confess ignorance as to SCO's intended use of this symbol.)

'-D__i386'
'-D_SCO_DS=1'
'-D__unix'
'-D_M_I386'
'-D_M_XENIX'
'-D_M_UNIX'
'-D_SCO_C_DIALECT=1'
'-D_STRICT_NAMES'
'-D_M_I86'
'-D_M_I86SM'
'-D_M_SDATA'
'-D_M_STEXT'
'-D_M_BITFIELDS'
'-D_M_INTERNAT'
'-D_M_SYS5'
'-D_M_SYSV'
'-D_M_SYSIII'
'-D_M_WORDSWAP'
'-Di386'
'-Dunix'
'-DM_I386'
'-DM_UNIX'
'-DM_XENIX'
'-D_SCO_XPG_VERS=4'
'-D_SCO_ELF'

#14Noname
dg@illustra.com
In reply to: Hal Snyder (#13)
Re: [HACKERS] SCO vs. the monster macro

But we don't want that if they use a good compiler under SCO. I have
asked them to run src/tools/ccsym and send the output. Should be
something unique in there.

On SCO, ccsym becomes /bin/cc -b elf -ii -E foo.c, which after filtering
gives the symbols below. If I omit "-b elf", the last line is replaced
by the two lines
'-D_M_COFF'
'-D_SCO_COFF'

How about _SCO_DS as the define when testing for SCO's native
compiler? (I confess ignorance as to SCO's intended use of this symbol.)

'-D__i386'
'-D_SCO_DS=1'
'-D__unix'
'-D_M_I386'
'-D_M_XENIX'
'-D_M_UNIX'
'-D_SCO_C_DIALECT=1'
'-D_STRICT_NAMES'
'-D_M_I86'
'-D_M_I86SM'
'-D_M_SDATA'
'-D_M_STEXT'
'-D_M_BITFIELDS'
'-D_M_INTERNAT'
'-D_M_SYS5'
'-D_M_SYSV'
'-D_M_SYSIII'
'-D_M_WORDSWAP'
'-Di386'
'-Dunix'
'-DM_I386'
'-DM_UNIX'
'-DM_XENIX'
'-D_SCO_XPG_VERS=4'
'-D_SCO_ELF'

Or even: '-D_SCO_C_DIALECT=1' as in:

#if _SCO_C_DIALECT == 1 ...

Can't get much more specific than that.

-dg

David Gould dg@illustra.com 510.628.3783 or 510.305.9468
Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612
- I realize now that irony has no place in business communications.

#15Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Hal Snyder (#13)
Re: SCO vs. the monster macro

But we don't want that if they use a good compiler under SCO. I have
asked them to run src/tools/ccsym and send the output. Should be
something unique in there.

On SCO, ccsym becomes /bin/cc -b elf -ii -E foo.c, which after filtering
gives the symbols below. If I omit "-b elf", the last line is replaced
by the two lines
'-D_M_COFF'
'-D_SCO_COFF'

How about _SCO_DS as the define when testing for SCO's native
compiler? (I confess ignorance as to SCO's intended use of this symbol.)

I am inclined to choose:

-D_SCO_C_DIALECT=1

Not to test for the value of one, but just to test if it is defined.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)