From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes From: "Bart Schaefer" Message-Id: <990130134019.ZM16947@candle.brasslantern.com> Date: Sat, 30 Jan 1999 13:40:19 -0800 X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@sunsite.auc.dk Subject: Good grief! Thousands of calls to stat() MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailing-List: 5127 In the course of looking at Drazen's tty-initialization bugs/questions, I happened to try running strace -f zsh -i 2>& 1 > /dev/null < /dev/null (for version 3.1.6-pws-6). Imagine my surprise when hundreds of screenfuls of calls to stat() went by -- in fact, there appears to be a loop that calls stat() once for each file in /dev, and that loop runs three times. After much peering at the surrounding output, I finally stuck some calls to write() into setupvals() and tracked it as far as createparamtable() -- the first system call after entering createparamtable() is the brk() to allocate the space, and it finally surfaces 4130 system calls later, nearly all of which are stat("/dev/somethingorother"). Anybody have any idea what's going on here? I'll try to narrow it further, but with all the functions that get run callback-style when certain of the parameters are changed, it's a real pain. There's even a call to ioctl(0, TIOCGWINSZ, ...) happening among those 4130 system calls, which is really strange because by that time SHTTY is already fd 10 and only ioctl(SHTTY, TIOCGWINSZ, ...) appears in the zsh source. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com