On Wed, Aug 03, 2016 at 03:15:49PM -0400, Brandon Allbery wrote:
> On Wed, Aug 3, 2016 at 3:12 PM, Nicholas Clark <perl6-bugs-follo...@perl.org
> > wrote:
> 
> > I don't know what file would be safer. Maybe mem?
> 
> 
> None of them. There's no guarantee that /proc exists (non-SVR4 commercial
> Unixes), or that it is in any way compatible with Linux's notion of /proc
> (FreeBSD, commercial SVR4 that didn't add Linux compatibility names like
> Solaris did).

Sorry, wasn't clear (and *I* definitely confused things by mentioning Solaris
Zones). *This* code is only run on Linux:

my $procfile = '/proc/1/comm';
{
  if $*KERNEL.name eq 'linux' {
    my $fh = open $procfile or die qq/Failed to open "$procfile": $!/;
;
    $fh.slurp-rest;

...

but it seems that it's not portable between different Linux variants.


I was mentioning Zones in the context of "we discovered that it's not actually
safe to assume that process 1 exists", and I'm wary of assuming that it's only
Solaris that can be strange. I wouldn't put it past Linux, somewhere, somehow.


Your comments about /proc generally are useful for us all to keep in mind.

Nicholas Clark


Reply via email to