php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5210 "my_init.c", line 102: undefined struct/union member: ru_maxrss
Submitted: 2000-06-24 00:36 UTC Modified: 2000-08-29 18:44 UTC
From: brothers at halcyon dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.0 Release OS: Dynix/Ptx
Private report: No CVE-ID: None
 [2000-06-24 00:36 UTC] brothers at halcyon dot com
Sequent Dynix/Ptx 4.4.4 has only two elements in struct rusage.  my_init.c must have the extra elements protected with an #ifdef just as in microtime.c.   Here is the symptoms' compiler error display, followed by something nearly resembling a fix.  The semblance is near enough to solve the problem on my machine.  It is intended to retain the extended functionality on all other machines.

Making all in libmysql
     cc -DHAVE_CONFIG_H -I. -I/opt/php-4.0.0/ext/mysql/libmysql -I/opt/php-4.0.0 -I/opt/php-4.0.0/Zend -I/opt/php-4.0.0 -I/opt/php-4.0.0/ext/mysql/libmysql -I/opt/php-4.0.0/ext/xml/expat/xmltok -I/opt/php-4.0.0/ext/xml/expat/xmlparse -DXML_BYTE_ORDER=12 -Wc,+abi-socket -g  -c my_init.c && touch my_init.lo
"my_init.c", line 102: undefined struct/union member: ru_maxrss
"my_init.c", line 102: undefined struct/union member: ru_idrss
"my_init.c", line 103: undefined struct/union member: ru_minflt
"my_init.c", line 103: undefined struct/union member: ru_majflt
"my_init.c", line 104: undefined struct/union member: ru_nswap
"my_init.c", line 104: undefined struct/union member: ru_inblock
"my_init.c", line 104: undefined struct/union member: ru_oublock
"my_init.c", line 105: undefined struct/union member: ru_msgsnd
"my_init.c", line 105: undefined struct/union member: ru_msgrcv
"my_init.c", line 105: undefined struct/union member: ru_nsignals
"my_init.c", line 106: undefined struct/union member: ru_nvcsw
"my_init.c", line 106: undefined struct/union member: ru_nivcsw
*** Error code 1
Make: .  Stop.
*** Error code 1
Make: .  Stop.
*** Error code 1
Make: .  Stop.
*** Error code 1
Make: .  Stop.
*** Error code 1
Make: .  Stop.
% 

Ow.

Now for the fix.  This diff is against PHP 4.0.0 Release.  Observe the moved commas and closing pren. The minor spelling correction is included because I noticed it, not because I spell perfectly.  Note that not all C compilers join contiguous strings, as they ought, so this "fix" might break working code on some platforms.

% diff my_init.orig my_init.c
97c97,101
<       fprintf(info_file,"\nUser time %.2f, System time %.2f\nMaximum resident set size %d, Integral resident set size %d\nNon physical pagefaults %d, Physical pagefaults %d, Swaps %d\nBlocks in %d out %d, Messages in %d out %d, Signals %d\nVouluntary context switches %d, Invouluntary context switches %d\n",
---
>       fprintf(info_file,"\nUser time %.2f, System time %.2f\n"
> #ifdef _OSD_POSIX /* Some have only a few fields in the rusage struct */
> "Maximum resident set size %d, Integral resident set size %d\nNon physical pagefaults %d, Physical pagefaults %d, Swaps %d\nBlocks in %d out %d, Messages in %d out %d, Signals %d\nVoluntary context switches %d, Involuntary context switches %d\n"
> #endif
>               ,
101c105,107
<              rus.ru_stime.tv_usec / SCALE_USEC) / 100.0,
---
>              rus.ru_stime.tv_usec / SCALE_USEC) / 100.0
> #ifdef _OSD_POSIX /* Some have only a few fields in the rusage struct */
>               ,
106c112,114
<             rus.ru_nvcsw, rus.ru_nivcsw);
---
>             rus.ru_nvcsw, rus.ru_nivcsw
> #endif
>               );
% 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 01:15 UTC] waldschrott@php.net
This is a correction to Bug # 5210.  My email address and password are evidently not
enough to allow me to edit my earlier bug report.  Sorry about the seeming duplicate.

--------------------
Re: my fix in bug report 5210

Uh, no.  That will break on the BS2000.  It suppresses the compiler error on the Sequent
for the wrong reason, and leaves open the same problem in microtime.c.

After the patch diff from bug report 5210 is applied, line 98 in my_init.c should read

#if !defined(_OSD_POSIX) && !defined(_SEQUENT_)

instead of #ifdef _OSD_POSIX

Then, a similar change is needed in microtime.c, where line 117 should become

#if !defined(_OSD_POSIX) && !defined(_SEQUENT_)

as well, instead of #ifndef _OSD_POSIX

 [2000-07-26 01:26 UTC] waldschrott@php.net
Just to avoid misunderstanding, the comment above is copied from bug 5211 and the words belong to the user who posted and aren?t mine :)
 [2000-08-18 13:28 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-08-29 18:44 UTC] sniper@php.net
No feedback. Please try PHP4.0.2 and reopen if problem still exists.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 03:01:29 2024 UTC