Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110372 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 34583 invoked from network); 4 Jun 2020 15:36:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2020 15:36:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 871991804D3 for ; Thu, 4 Jun 2020 07:19:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 4 Jun 2020 07:19:18 -0700 (PDT) Received: by mail-ot1-f65.google.com with SMTP id m2so4851154otr.12 for ; Thu, 04 Jun 2020 07:19:18 -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=5I3Zz+WiNWnGtoEuRyLBVSguoj8LchWc/T4CaPdeshM=; b=hFqsHB00VefvRtBqjkZfO0rgRKRwov/PyTazCJNQtmAexZAJ6B5rDfU6WZFy8dKPPg OAhLcsnUWQOKTOqPZgUfljSn1uAqO8s4zv3RkjbRc5jfXMgMWbF2HDe1zFPN0P8q+JHC arjYnG3B3DH/mSW6z27eIspgLF7eNDZL5GUXntpCqEza3128zPTjJJjSsayBNNmIwSkW nk8W/CMsutP8W7Lbc0MHheONYYuEtsuNVPSQpqMHHIqbGZAqpD7qxVGWCa/zSVDXbcz4 uohE0oOpFHVBR7mNte8wex2a0NVy/QWLV7QPF0p92lSJ8kJW25fVDUKo0gEL8pdS+D/3 e29A== 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=5I3Zz+WiNWnGtoEuRyLBVSguoj8LchWc/T4CaPdeshM=; b=IM6+8jB9YuJEdFyB/0Yme9EiRfeMtnTqe4NuB7MVz15fp/wvQD5Wasz00RlhKoIwYl fZQKFCj/6VDTG6uHRhavoSY5aipaVG7760LF/Ire1I0tyLV7RCFIe/G9Bw8oBneTILW4 XnJsEmgCSQb84Z5QCGJGk/xFzSXyYOceRFy+8zowjj0aRAeLLGJr9pkSDJn/H4dU7mN6 pYplpj4OWdHgHnzQAebYJe1CXQDZSfa072nEb8LuKQDiKFeO4+xADtdd3aCJ5loOOBwv LrNYU63caCTOXL5zJFrWOtkp4dh3RETLhDH/YRZrckeIoZ6ymUCl2ebcbOJgqWQlTw8u oSDQ== X-Gm-Message-State: AOAM53027fZhv3DIhqWSNDBJjNn/G7LGM5v/I0tFc8Eud3xq+n9v8mIf ENDSBcDmtmc+YoUn9bBm4+09ujIO+kl7uWN7+NU= X-Google-Smtp-Source: ABdhPJyvN4a6SydeTHA60xfI0kCBtAyPUUf1MOsO9WeRW4Xj2duBpNClneAtGKlG8byaKBnPLYNw9NcDH6kLC1uVeAc= X-Received: by 2002:a9d:2253:: with SMTP id o77mr3838246ota.236.1591280356814; Thu, 04 Jun 2020 07:19:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Jun 2020 15:19:01 +0100 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000067f63405a742d419" Subject: Re: [PHP-DEV] RFC proposal: fsync support for file resources From: davidgebler@gmail.com (David Gebler) --00000000000067f63405a742d419 Content-Type: text/plain; charset="UTF-8" It's interesting that you mention fdatasync - perhaps a better C programmer than I am can correct me, but I don't think it has an equivalent on Windows, where _commit() is a wrap on FlushFileBuffers API. So in respect of PHP implementation, the options would be: fdatasync() is not available on Windows, but fsync() is. fdatasync() is available on UNIX builds. fdatasync() on Windows is an alias of fsync(), on UNIX fdatasync() is as expected. Only fsync() is implemented for both Windows and Unix. -Dave On Wed, 3 Jun 2020, 11:16 Nikita Popov, wrote: > On Mon, Jun 1, 2020 at 6:57 PM David Gebler wrote: > >> Exactly as the subject says, I would like to propose an RFC for adding an >> fsync() function for file resources, which would in essence be a thin >> wrapper around C's fsync on UNIX systems and _commit on Windows. >> >> It seems to me an odd oversight that this has never been implemented in >> PHP >> and means PHP has no way to perform durable file write operations, making >> it inherently unsuitable for any systems requiring more intensive I/O, >> mission critical logs, auditing, etc. >> >> I am not really a C programmer and I have been able to implement a simple >> working prototype of this as a compiled extension in merely a few hours, >> so >> I'm sure it wouldn't be difficult to bring in to the language core where >> the functionality really belongs. >> >> Every other major programming language otherwise comparable to PHP in >> features supports a way of providing durability. >> >> Thanks. >> > > No objections from my side. I assume you'd want to add both fsync() and > fdatasync()? > > I think all it takes for this one is a PR... > > Regards, > Nikita > --00000000000067f63405a742d419--