bug-gnulib
[Top][All Lists]
Advanced

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

Re: Can't build libposix


From: Bastien ROUCARIES
Subject: Re: Can't build libposix
Date: Thu, 16 Dec 2010 16:50:50 +0100
User-agent: KMail/1.13.5 (Linux/2.6.36; KDE/4.4.5; x86_64; ; )

Le dimanche 12 décembre 2010 06:38:24, Peter O'Gorman a écrit :
> On 12/11/2010 11:09 PM, Bastien ROUCARIES wrote:
> > On Sun, Dec 12, 2010 at 10:04 AM, Peter O'Gorman<address@hidden>  wrote:
> > 
> > for aix and hpux i have posted some code snipped
> 
> hpux code works for me once I change the typo'ed getppid to getpid.
> 
> I can't find the AIX code you mention.
> 
> Peter
ok code for aix

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <procinfo.h>
#include <sys/time.h>
#include <sys/types.h>

int main()
{
        struct procentry64 procs;       
        char arg0[64];
        int pidc = getpid();
        (void) getprocs64(procs, sizeof(struct procentry64), NULL, 0, &pidc, 
1); 
        /* this could work but search google AIX truncated command line in 
/usr/include/procinfo.h */
        printf("process name %s\n",procs.pi_comm);
        /* get better result */ 
        getargs(&procsinfo[numproc],sizeof(struct procsinfo),arg0,sizeof(arg0));
        /* in order to have a NULL TERMINATED string */
        arg0[sizeof(arg0)-1] = '\0';    
        printf("process name %s\n",arg0);       
        return 0;
}



reply via email to

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