[procps] Re: [PATCH 1/3] Preload sysctl lines even if longer than stdio buffer

  • From: "Dr. Werner Fink" <werner@xxxxxxx>
  • To: Craig Small <csmall@xxxxxxxxxxxx>
  • Date: Wed, 28 Feb 2018 12:48:35 +0100

On Wed, Feb 28, 2018 at 11:22:05AM +0000, Craig Small wrote:

Hi Werner,
  In the newlib branch we don't actually link sysctl to libprocps. I didn't
realise this at first.

So sysctl having fprocopen() seems useful, the question is how generic is
this function?

So I'm wondering how likely is this function going to be needed by other
programs? To me it seems a pretty specific thing and we don't make other
sysctl related functions available but keep them inside sysctl.

I think for newlib I'd rather not link sysctl when it's not otherwise
required, so my preference is to put fprocopen into sysctl and out of the
library. However if you think other programs out there would use fprocopen
then the extra linking would be worth it.

Hi Craig,

I've no problem if this will go into sysctl.c its self or if sysctl.o is
linked with an other object file for fprocopen().  Normally a developer
add some useful functions to a program code and later on it becomes also
useful for other program codes and then the hard way of splitting this into
a new library and cleaning out all existing program codes is the common
way.  My idea was to jump direct to a library call ;)

I've no idea if other programs of procps or foreign program could make use
of the dynamic reallocation code in fprocopen().  Currently this is obviously
only sysctl ...

Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: signature.asc
Description: PGP signature

Other related posts: