Re: 2 questions: getter/setter use and streams use

From: Date: Mon, 14 Apr 2003 18:06:11 +0000
Subject: Re: 2 questions: getter/setter use and streams use
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-913@lists.php.net to get a copy of this message
Here's a test for those interested. Ran this on Solaris 8 SPARC. #include <stdio.h> #include <errno.h> int main () { FILE *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. J Wez Furlong wrote: > Thats right - I am talking about ANSI stdio; fopen() etc., not POSIX > open(). > > --Wez. > > On Mon, 14 Apr 2003, George Schlossnagle wrote: >

« previous php.internals (#913) next »