mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexey Dobriyan' <adobriyan@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: RE: [PATCH] proc: give /proc/cmdline size
Date: Fri, 9 Sep 2022 07:37:37 +0000	[thread overview]
Message-ID: <de33c84cc78747d4901050c792a72b9a@AcuMS.aculab.com> (raw)
In-Reply-To: <YxrKCLXE7k16j9xu@localhost.localdomain>

From: Alexey Dobriyan
> Sent: 09 September 2022 06:07
> 
> On Thu, Sep 08, 2022 at 01:45:46PM -0700, Andrew Morton wrote:
> > On Thu, 8 Sep 2022 21:21:54 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >
> > > Most /proc files don't have length (in fstat sense). This leads
> > > to inefficiencies when reading such files with APIs commonly found in
> > > modern programming languages. They open file, then fstat descriptor,
> > > get st_size == 0 and either assume file is empty or start reading
> > > without knowing target size.
> > >
> > > cat(1) does OK because it uses large enough buffer by default.
> > > But naive programs copy-pasted from SO aren't:
> >
> > What is "SO"?
> 
> StackOverflow, the source of all best programs in the world!

Anyone directly copying anything from there gets what
they deserve.

Useful for hints, but they are so often wrong.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      reply	other threads:[~2022-09-09  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 18:21 Alexey Dobriyan
2022-09-08 20:45 ` Andrew Morton
2022-09-09  5:07   ` Alexey Dobriyan
2022-09-09  7:37     ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de33c84cc78747d4901050c792a72b9a@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®