Path: utzoo!attcan!uunet!wuarchive!udel!mmdf From: archer%segin4.segin.fr@prime.com (Vincent Archer) Newsgroups: comp.os.minix Subject: Re: A few bugs in 1.5.5: named pipes, sh(1) read Message-ID: <16274@nigel.udel.EDU> Date: 9 Apr 90 13:28:43 GMT Sender: mmdf@udel.EDU Lines: 30 Michael S. Mattone says: MSM>1. Pipe limit 7K. The following fails if 'fd' is a pipe: MSM> write(fd, buf, 8000); MSM> This bug (feature?) has been annoying me since 1.2. Anyone else? MSM> I posted my modifications to make this problem go away 2 1/2 times MSM> before. Should I try for 3 1/2? Or is this something POSIX requires? Better yet, it fails with a specific error code saying that it's too big (8000 that is). That's because Unix requires writes to be atomic. Otherwise, you could find (assuming two processes writing onto the same pipe) the following situation: P1 says: write(8000) the pipe accepts 7K, and P1 waits P1 gets: signal -9 and is killed. FS notices this and purges the remaining 1K P2 says: read(8000) and gets the 7K, but never the 1K (missing) In that situation, you get a partial block of data. If you're using your pipe as a formatted packet stream, you wind up with a non-terminated packet. This can get annoying sometimes, and Unix therefore tries to forbid a write to be done in two (or more) chunks. Do not correct this behaviour, it's standard practice on Unix. Vincent Archer Email: archer%segin4.segin.fr@prime.com (Yes, indirect address required!)