Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh-3.0-pre1: speed up the "list-choices" etc.
- X-seq: zsh-workers 1577
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: A.Main@xxxxxxxxxxxxxxxxx (Zefram)
- Subject: Re: zsh-3.0-pre1: speed up the "list-choices" etc.
- Date: Mon, 8 Jul 1996 16:42:54 +0200 (MET DST)
- Cc: suzuki@xxxxxxxxxxxxxx, A.Main@xxxxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <6670.199607081051@xxxxxxxxxxxxxxxxxxxxxxx> from Zefram at "Jul 8, 96 11:51:47 am"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> > % truss zsh
>
> Why didn't I think of that before?
>
> I can confirm that output is UNbuffered under Solaris 2, but buffered
> under SunOS 4. How remarkable. Does anyone know *why* it's
> unbuffered? Could this be a SysV thing?
Quote from the Solaris 2.4 fdopen manual:
When opened, a stream is fully buffered if and only if it
can be determined not to refer to an interactive device.
The error and end-of-file indicators are cleared for the
stream.
The patch below should fix this. Note that here setvbuff is called with
NULL buffer and if _IOFBF is not defined setbuffer is not called. That's
because this problem seems to affect only SVR4 systems where setvbuf and
_IOFBF is always defined. And setvbuf used to be called with NULL buffer
but the Linux libc-5.3.6 and earlier versions had a bug that setvbuf with
NULL buffer did not work on unbuffered streams. But Linux fdopen always
gives a buffered stream so that is not a problem here and libc older than
5.3.12 is obsolate anyway :-).
Zoltan
*** Src/init.c 1996/07/08 01:56:51 2.25
--- Src/init.c 1996/07/08 14:14:18
***************
*** 365,370 ****
--- 365,373 ----
/* Associate terminal file descriptor with a FILE pointer */
shout = fdopen(SHTTY, "w");
+ #ifdef _IOFBF
+ setvbuf(shout, NULL, _IOFBF, 0);
+ #endif
gettyinfo(&shttyinfo); /* get tty state */
#if defined(__sgi)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author