tech-kern archive

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

Re: how to tell if a process is 64-bit



On Thu, Sep 14, 2017 at 02:31:29PM +0200, Thomas Klausner wrote:
> 	kp = kvm_getproc2(kvmp, KERN_PROC_PID, pid, sizeof(*kp), &res);
> 	if (res != 1)
> 		exit(1);

	if (kp->p_flag & P_32)
		printf("it is a 32bit process\n");

Unless you are running with a 32bit kernel, then you'll never see that
flag (but also the question does not make sense).

Martin


Home | Main Index | Thread Index | Old Index