From owner-freebsd-hackers Thu Jun 28 1:47:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 68E8A37B406 for ; Thu, 28 Jun 2001 01:47:41 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 81224 invoked by uid 1000); 28 Jun 2001 08:52:26 -0000 Date: Thu, 28 Jun 2001 11:52:26 +0300 From: Peter Pentchev To: Zhihui Zhang Cc: Manas Bhatt , hackers@FreeBSD.ORG Subject: Re: does data overflow in pipes Message-ID: <20010628115226.D80342@ringworld.oblivion.bg> Mail-Followup-To: Zhihui Zhang , Manas Bhatt , hackers@FreeBSD.ORG References: <20010628024057.71824.qmail@web10705.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from zzhang@cs.binghamton.edu on Wed, Jun 27, 2001 at 10:45:21PM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It is also possible that it would only write as much as it can, and return the amount written, leaving it to you to write the rest later. (Uhm.. you do check the return values from write(2), right? :) The relevant source is in src/sys/kern/sys_pipe.c, namely the pipe_write() function. From a quick look, it would seem that writes behave exactly the way I thought - only writing as much as there is space left in the pipe buffer. G'luck, Peter -- I am the meaning of this sentence. On Wed, Jun 27, 2001 at 10:45:21PM -0400, Zhihui Zhang wrote: > > I guess the kernel will block the process trying to write more data than > that can be accommodated. Or if you are using non-blocking I/O, it will > return an error. > > -Zhihui > > On Wed, 27 Jun 2001, Manas Bhatt wrote: > > > hi all, > > pipes uses only direct blocks to store data. so > > depending on the blocksize , a total data of > > 10*blocksize can be written in one go but what happens > > if a writer process tries to write more 10*blocksize > > of data in one go. Does the kernel overwrites the > > data in pipe or not ? if yes, why? if not, then how > > does it allow the writer to write more 10*blocksize of > > data? > > if someone can direct me to implementation > > (source files), it would be great. > > thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message