[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [MiNT] expanded /proc vs new /kern



> -----Original Message-----
> From: Martin-Eric Racine [mailto:q-funk@pp.fishpool.fi]
> Sent: Tuesday, December 07, 1999 12:41 PM
> To: unlisted-recipients
> Cc: mint@fishpool.com
> Subject: RE: [MiNT] expanded /proc vs new /kern
> 
> > This means that you could change /proc to support process names
> > like "a_WEIRD-filename with odd_ÆØÅ[]characters.348" and it
> > wouldn't contradict the docs. 
> 
> Yep, except legal characters for filenames are documented
> elsewhere in the Compendium. ;-)

Only for the old GEMDOS-filesystem. All the characters above are AFAIK legal
in e.g. VFAT-names, which can even use unicode.

> Anyhow, this basically means that applications that parse /proc
> to find the PID should only parse the last 3 characters of the
> filename, which would keep it safe.

I'm not quite sure what you mean, but if you mean "how to find the pid of a
process based on it's filename" then you must naturally parse everything
*but* the last four characters. And you must know how the kernel truncates
the filename and do the same yourself (unless the kernel can do it for you).
This is why many programs probably will break, since they're adapted to the
current standard where everything up to the first dot (but at most 8
characters) is used as the process-name. There has simply been no other way
of doing it if you want to use the process-name.

Another way of doing it is naturally to open each file and retrieve the full
path and filename by using PLOADINFO. There you will find the exact same
name as on the disk, and it's much easier and more portable to parse -
everything after the last backslash is the filename.

> The question is, now that we found out that /proc is not limited
> to 8 characters, how high do we set the limit on filename lenght? 

If it should be of any real use it should be unlimited, both in terms of
length and allowed characters. It should simply be a straight copy of the
filename on the filesystem the program was started from, even the file's
usual extension should be included (prg, tos, ttp etc). If you impose *any*
restrictions then you'll quickly end up in the same situation as today and
you've gained nothing. I still doubt the usability of extending the
processnames. PLOADINFO is there and give you the complete and correct
filename already - as long as we're allowed to read this highly sensitive
information ;-)

> Also, assides from the PS command, what else parses the /proc
> filesystem?  How many things need to be recompiled?

Most of the time it's not a matter of recompiling, but rewriting/modifiying
the relevant code. If the code is even available that is. See my previous
post for a few examples.

Then there's also the issue of MagiC-compatibility...

Jo Even Skarstein