Re: 2 questions: getter/setter use and streams use
| From: | George Schlossnagle | Date: | Mon, 14 Apr 2003 18:55:33 +0000 |
| Subject: | Re: 2 questions: getter/setter use and streams use | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-914@lists.php.net to get a copy of this message | ||
On Monday, April 14, 2003, at 02:06 PM, Jay Smith wrote:
Here's a test for those interested. Ran this on Solaris 8 SPARC. #include <stdio.h> #include <errno.h> int main () {Sure. The issue is that the stdio libraries (fopen, etc) dont support more than 256 open files. You can alos choose to use open et.al. A further complication is that errno is not correctly set when failing in this case on Solaris 7 and earlier. GeorgeFILE *fd; int i = 0; char filename[30];while (1) { sprintf(filename, "tests/test%d.txt", i++); fd = fopen(filename, "r"); if (fd == NULL) { printf("died on %d, %d, %s\n", i, errno, strerror(errno)); exit(1); } }} Ran this through two tests. ulimit says the max for open files per process is 1024. Here's the results, first with the stock libraries, then with sfio: [jay@portabuddy jay]$ gcc -g test.c [jay@portabuddy jay]$ ./a.out died on 254, 24, Too many open files [jay@portabuddy jay]$ gcc -g test.c -L/export/home/jay/setup/sfio/lib -lstdio -lsfio [jay@portabuddy jay]$ ./a.out died on 1022, 24, Too many open files [jay@portabuddy jay]$ So sfio seems to be the way to go with php4 at the moment. For anybody who's having problems getting sfio to work with php4, just configure with LIBS set to "-L/path/to/sfio/lib -lstdio -lsfio". Just make sure stdio is there before sfio and you should be set. No need for weird includes or anything.