Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hropus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!hropus!ka From: ka@hropus.UUCP (Kenneth Almquist) Newsgroups: net.unix Subject: Re: 4.2BSB Buffered I/O buffersize Message-ID: <235@hropus.UUCP> Date: Thu, 30-Jan-86 20:01:29 EST Article-I.D.: hropus.235 Posted: Thu Jan 30 20:01:29 1986 Date-Received: Sat, 1-Feb-86 04:07:55 EST References: <546@well.UUCP> <211@hadron.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 21 Keywords: buffered I/O setbuf > I've got a program that is having trouble getting input because of the > limitations of the input buffer for buffered i/o (about 256), I'm > occasionally getting myself into trouble. I assume that you are reading from a terminal. In this case, the problem is that the terminal driver will only buffer 256 characters. Since the terminal driver will not pass any characters back to your program until a carriage return is typed, if you type more than 256 characters without typing a carriage return you will hit this limit. The limit can be changed by changing a constant in the kernel and rebuilding your operating system. The alternative to this is to set CBREAK mode on your tty using the stty system call; this will cause the characters to be passed to your program as they are typed. When you are in CBREAK mode the driver will not perform normal erase and kill processing for the simple reason that the driver cannot delete input that it has already passed to your program. Thus you will have to implement erase and kill processing in your program if you need it. Kenneth Almquist ihnp4!houxm!hropus!ka (official name) ihnp4!opus!ka (shorter path)