From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 2 08:07:22 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99DB437B401 for ; Mon, 2 Jun 2003 08:07:22 -0700 (PDT) Received: from mail.mundomateo.com (24-56-193-117.mdmmi.voyager.net [24.56.193.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBDE143F93 for ; Mon, 2 Jun 2003 08:07:21 -0700 (PDT) (envelope-from matthew@mundomateo.com) Received: from mundomateo.com (localhost.mundomateo.com [127.0.0.1]) by mail.mundomateo.com (Postfix) with SMTP id B2EAB5C93 for ; Mon, 2 Jun 2003 11:07:20 -0400 (EDT) Received: from 216.120.158.65 (SquirrelMail authenticated user matthew) by www.mundomateo.com with HTTP; Mon, 2 Jun 2003 11:07:20 -0400 (EDT) Message-ID: <1553.216.120.158.65.1054566440.squirrel@www.mundomateo.com> Date: Mon, 2 Jun 2003 11:07:20 -0400 (EDT) From: "Matthew Hagerty" To: freebsd-hackers@freebsd.org User-Agent: SquirrelMail/1.4.0 RC2a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 Importance: Normal Subject: Are write() calls guaranteed atomic? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: matthew@mundomateo.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 15:07:22 -0000 Greetings, I'm writing a server that receives data via a named pipe (FIFO) and will always have more than one other process sending data to it, and I'm concerned with preventing data multiplexing. The data coming in will be lines of text delimited with a newline, but the processes writing the data have no knowledge of the FIFO, they simply think they are writing to a file. This being the case, the processes writing the data give no regard to PIPE_BUF and may send data in longer lengths (but probably never longer than 2K to 4K.) Will the kernel ensure that the data write() will be delivered to the FIFO atomically even if the data is larger than PIPE_BUF, such that two or more successive read() calls will retrieve the data in order? If this is the case, is this specific to FreeBSD, or is this functionality defined as a POSIX standard and generally portable? Any insight would be greatly appreciated. Thanks, Matthew