From owner-freebsd-questions@freebsd.org Tue Jun 15 23:44:01 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FCB2655EF9 for ; Tue, 15 Jun 2021 23:44:01 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G4PzN2gmyz3qBR for ; Tue, 15 Jun 2021 23:44:00 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: by mail-pf1-x434.google.com with SMTP id k6so670118pfk.12 for ; Tue, 15 Jun 2021 16:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vEz4RmfFxUjHvmV8N5ZxIS2CiPMz8x0SrSkqIO0Zobk=; b=lUQS889hK4r6cy3i9IRMd1hpuUMEyyO4WhpKg1AQgmjAHtWhIZSGeCg1inbi8GrEnk QB6wBPp8V26g2CdxrU8hOMPc390t8/3opTHVZ3lNA+W5sZo2OWtx9NreF9m6NMjGtOm/ cZyUkOuua2VPc5RLbBrWCY8ZEivtNrczIw30kI9+GNDAzwN8SpCX1UGaHthwjbp8gdcB qgT8nrJIX42l/FMBnSFxozwhpkaPCGfWi1gqeoHKsOZ0Q/bJCS6xcRJtVDOGy0kWoQAB KpC+5KPtbF2gZeG2uPsoU0nq3Wkv6FTi4b0pISscZi+y93B5dxQcdP3IDIadyysDZXy+ wFWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vEz4RmfFxUjHvmV8N5ZxIS2CiPMz8x0SrSkqIO0Zobk=; b=oqkB9ns3NEcbpexQvhtRiQ43OwmT+oDd0yGGXps5NtcFZnKo5h8Bs5xorSnM8ojWFe UVWHkvUzB5haRXpSe1a5EhjFG/1sb8FF8mXmnoWDvgnY6CPbrkw/Aq2V+PITlXcwj/G0 yWwRztSZsqvHQrnnEHSdIH0buxwNJFlADTa12AY/IZ/05BUAiAHg4LzZ8JmKMt14dG4F RiydNhJL3+HkvCXTn50xrcKjYkbL4YTbdC7w9J+4CpZazdCbOjCuYAKipDVjnszVH09s nLNzrk4DO0/YQsIEL76xVyzTZpPr/sxEBIhFhGKLjU1DnZebmi9OWrK7XQsej4cSWWC8 8WJg== X-Gm-Message-State: AOAM5332moCZ6YGPnxM5T4m0VjkHZY4qJQUrr0iWqk1VG/q/Q1VjOfG1 1OXexTKCq9TDfiCE0hLaAqEmgVWCwr0zUPPVA4VrZj3UjC5p X-Google-Smtp-Source: ABdhPJwpZVMZCTAjrjRhhqhG0wG3Olnh3La7doDkGgKBxmUUKBMAwoSi+hf2C39VFF0ItloUXUiASCLNXDkSwkQe6Tc= X-Received: by 2002:aa7:81c5:0:b029:2f7:d4e3:78e9 with SMTP id c5-20020aa781c50000b02902f7d4e378e9mr6737036pfn.31.1623800638757; Tue, 15 Jun 2021 16:43:58 -0700 (PDT) MIME-Version: 1.0 References: <25766.1623793238@segfault.tristatelogic.com> In-Reply-To: <25766.1623793238@segfault.tristatelogic.com> From: Paul Procacci Date: Tue, 15 Jun 2021 19:43:47 -0400 Message-ID: Subject: Re: Is a successful call to write(2) atomic? To: "Ronald F. Guilmette" Cc: freeBSD Mailing List X-Rspamd-Queue-Id: 4G4PzN2gmyz3qBR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lUQS889h; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of pprocacci@gmail.com designates 2607:f8b0:4864:20::434 as permitted sender) smtp.mailfrom=pprocacci@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::434:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::434:from:127.0.2.255]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::434:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2021 23:44:01 -0000 > I frankly don't know. It seems highly likely to me that Posix is most > probably very precise in defining the behavior, but one would have to > wade through a hundred pages or so to find the exact and crisp answer.-- > > I read some of them last night before responding to you to ensure all my ducks were in a row. ;) https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_05_01 https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_07 https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html The last link in particular ... used to read as: "This volume of POSIX.1-2008 does not specify behavior of concurrent writes to a file from multiple processes. Applications should use some form of concurrency control. " It now reads: This volume of POSIX.1-2017 does not specify the behavior of concurrent writes to a regular file from multiple threads, except that each write is atomic (see *Thread Interactions with Regular File Operations* ). Applications should use some form of concurrency control. In both cases, it states: "Applications should use some form of concurrency control". ~Paul __________________ :(){ :|:& };: