php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14697 no HAVE_SYS_RESOURCE_H
Submitted: 2001-12-26 00:12 UTC Modified: 2001-12-26 08:25 UTC
From: support at augsoft dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.1.0 OS: RHL6.1/X86
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: support at augsoft dot com
New email:
PHP Version: OS:

 

 [2001-12-26 00:12 UTC] support at augsoft dot com
With gcc version egcs-2.91.66 on RHL6.1/X86, apparently HAVE_SYS_RESOURCE_H is not being defined when it comes time to compile 

   /ext/standard/microtime.c

as in: 

#./configure --with-apxs
#make

resulting in make aborting as follows ->

/bin/sh /home/src/site/webserver/php-4.1.0/libtool --silent --mode=compile gcc  -I. -I/home/src/site/webserver/php-4.1.0/ext/\
standard -I/home/src/site/webserver/php-4.1.0/main -I/home/src/site/webserver/php-4.1.0 -I/usr/include/apache -I/home/src/sit\
e/webserver/php-4.1.0/Zend -I/home/src/site/webserver/php-4.1.0/ext/mysql/libmysql -I/home/src/site/webserver/php-4.1.0/ext/x\
ml/expat  -DLINUX=22 -DMOD_SSL=208105 -DUSE_HSREGEX -DEAPI -DEAPI_MM -DUSE_EXPAT -I/home/src/site/webserver/php-4.1.0/TSRM -g\
 -O2 -prefer-pic  -c microtime.c
microtime.c: In function `zif_getrusage':
microtime.c:98: storage size of `usg' isn't known
microtime.c:101: `RUSAGE_SELF' undeclared (first use in this function)
microtime.c:101: (Each undeclared identifier is reported only once
microtime.c:101: for each function it appears in.)
microtime.c:107: `RUSAGE_CHILDREN' undeclared (first use in this function)
make[3]: *** [microtime.lo] Error 1
make[3]: Leaving directory `/home/src/site/webserver/php-4.1.0/ext/standard'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/src/site/webserver/php-4.1.0/ext/standard'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/src/site/webserver/php-4.1.0/ext'
make: *** [all-recursive] Error 1
#

NotE: by manually editing microtime.c and _forcing_ the inclusion of <sys/resource.h> this problem goes away and the build completes as expected.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-26 00:29 UTC] support at augsoft dot com
It appears to be a bug in the configure script for 4.1.0

This is an extract from the ./configure output:

checking for sys/mman.h... yes
checking for sys/mount.h... yes
checking for sys/resource.h... no   <-- creates the failure
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/statfs.h... yes

Here is a listing of those files

#vdir /usr/include/sys/mman.h /usr/include/sys/mount.h /usr/include/sys/resource.h /usr/include/sys\
/select.h /usr/include/sys/socket.h /usr/include/sys/statfs.h
-rw-r--r--   1 root     root         4175 Sep 20  1999 /usr/include/sys/mman.h
-rw-r--r--   1 root     root         3825 Sep 20  1999 /usr/include/sys/mount.h
-rw-r--r--   1 root     root         3185 Sep 20  1999 /usr/include/sys/resource.h
-rw-r--r--   1 root     root         3359 Sep 20  1999 /usr/include/sys/select.h
-rw-r--r--   1 root     root         8340 Sep 20  1999 /usr/include/sys/socket.h
-rw-r--r--   1 root     root         2066 Sep 20  1999 /usr/include/sys/statfs.h
#

 [2001-12-26 00:52 UTC] mfischer@php.net
Does config.log shows any special hints why sys/resource.h wasn't found?

Feedback.
 [2001-12-26 06:25 UTC] support at augsoft dot com
Here is the bit from config.log that is causing all of this:

configure:6304: checking for sys/resource.h
configure:6314: gcc -E  -DLINUX=22 -DMOD_SSL=208105 -DUSE_HSREGEX -DEAPI -DEAPI_MM -DUSE_EXPAT conftest.c >/dev/null 2>conftest.out
In file included from /usr/include/sys/resource.h:25,
                 from configure:6310:
/usr/include/bits/resource.h:109: warning: `RLIM_INFINITY' redefined
/usr/include/asm/resource.h:26: warning: this is the location of the previous definition
configure: failed program was:
#line 6309 "configure"
#include "confdefs.h"
#include <sys/resource.h>

 [2001-12-26 06:27 UTC] derick@php.net
As that FAQ entry describes, your kernel headers are messed up.

Derick
 [2001-12-26 06:58 UTC] support at augsoft dot com
An update to the user's glibc and headers appears to be in order so as to eliminate the annoying warnings concerning redefinition of values by the latest kernel headers.

However, a harmless warning for sys/resource.h should not be able to trick the otherwise superb PHP4 configure script into generating a non-functional build.  A compromise solution would be to emit a configure error "checking sys/resource.h ....(error discovered, check log)" rather than "checking sys/resource.h....(no)".

 [2001-12-26 08:21 UTC] support at augsoft dot com
An update to the user's glibc and headers appears to be in order so as to eliminate the annoying warnings concerning redefinition of values by the latest kernel headers.

However, a harmless warning for sys/resource.h should not be able to trick the otherwise superb PHP4 configure script into generating a non-functional build.  A compromise solution would be to emit a configure error "checking sys/resource.h ....(error discovered, check log)" rather than "checking sys/resource.h....(no)".

 [2001-12-26 08:25 UTC] support at augsoft dot com
whoops, accidentally reposted while closing browser.  please ignore duplicate posting.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 19:01:34 2024 UTC