Subject: Re: PTRTOINT64() / INT64TOPTR()
To: Andrew Brown <atatat@atatdot.net>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 02/18/2004 09:17:58
Andrew Brown wrote:
> currently, the PTRTOINT64() macro is used in sys/kern/init_sysctl.c
> for packing the kinfo_proc2 and kinfo_lwp structures, and is defined
> independently in lib/libkvm/kvm_proc.c for some related usage.
>
> would anyone object to this macro being moved to sys/sysctl.h and the
> definition removed from the other two places, so that the definition
> can be kept in one place (and not in two or more), and other pieces of
> code may use it (kern.buf for one, proc and lwp stuff being shuffled
> around being another)?
I wonder if <sys/sysctl.h> is the right place - the macro isn't
sysctl-specific. That said, I'm not sure where else. <sys/param.h>
seems like overkill.
> i also find it vaguely curious that there's no INT64TOPTR() macro
> anywhere...
At least for the sysctl users, it's mainly a value that is printed out.
I guess if there was a need for it it would have sprung up somewhere...
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD Support and Service: http://www.wasabisystems.com/