PHP 4.0 Bug #5210: "my_init.c", line 102: undefined struct/union member: ru_maxrss
| From: | brothers at halcyon dot com | Date: | Fri, 23 Jun 2000 22:36:00 +0000 |
| Subject: | PHP 4.0 Bug #5210: "my_init.c", line 102: undefined struct/union member: ru_maxrss | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22149@lists.php.net to get a copy of this message | ||
From: brothers@halcyon.com
Operating system: Dynix/Ptx
PHP version: 4.0.0 Release
PHP Bug Type: Compile Failure
Bug description: "my_init.c", line 102: undefined struct/union member: ru_maxrss
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
> );
%