bug-gnulib
[Top][All Lists]
Advanced

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

Re: libposix stuff


From: Bastien ROUCARIES
Subject: Re: libposix stuff
Date: Mon, 15 Nov 2010 12:41:45 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34-1-amd64; KDE/4.4.5; x86_64; ; )

Le mardi 9 novembre 2010 13:31:03, Bastien ROUCARIES a écrit :
Bruce could you try the following program under HPUX ? It will print the 
program name (i put the following code in public domain if copyrightable I do 
not think it is)

Bastien

#include <sys/param.h> 
#include <sys/pstat.h> 
#include <sys/unistd.h> 

int main()
{
     struct pst_status pst; 
     int target = (int)getppid(); 

     if (pstat_getproc(&pst, sizeof(pst), (size_t)0, target) != -1) 
          (void)printf("Program name is %s",pst.pst_ucomm); 
     else 
          perror("pstat_getproc"); 
    return 0;
} 
> 
> It will also allow to use the pstat command under hpux
> (http://docs.hp.com/en/B2355-90682/pstat.2.html) pst_ucomm field is the
> name of the program.


> 
> Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]