lkml.org 
[lkml]   [1997]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: freepages in proc doesn't work right.
Date
From
Russell Coker - mailing lists account wrote:
>
> >Noticed this in 2.0.30:
>
> >The command to set the "freepages" file in /proc/sys/vm used to work like
> >thus:
>
> >echo 100 150 200 > /proc/sys/vm/freepages
>
> >Now, what you get is something like:
>
>
> >200 96 128
>
> >where 96 and 128 are the originals.
>
> >I don't know when this changed, but the problem seems
> >to be that it doesn't like spaces in the input.

Ah.. This looks as if YOUR echo command is writing the three commandline
arguments in different "write" calles to the file.

something like:

for (i=1;i<argc;i++) {
write (1,argv[i],strlen (argv[i]);
if (i < argc -1 ) write (1, " ",1);



My tcsh and bash internals and the /bin/echo command on my Red Hat 4.2
system all do it in one go.....

i.e. something like
buf[0] = '\0';
for (i=1;i<argc;i++) {
strcat (buf,argv[i]);
if (i < argc -1 ) strcat (buf," ");
write (1,buf, strlen (buf));

(see: the second code snippet is longer..... :-)


Roger.

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.050 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site