On Tue, Nov 11, 2008 at 3:57 PM, Dan McDonald <[EMAIL PROTECTED]> wrote:
>> Is it possible to get know endianness on the solaris target by using
>> dtrace?
>
> My first suggestion would be to find a C preprocessor directive that'd tell
> you the answer. Lacking that, you could do something like:
>
> #!/usr/sbin/dtrace -Cs
>
> /* Look for little-endian archs and set appropriately. */
> #ifdef i386
> #define LITTLE_ENDIAN
> #endif
>
> ::ip_input:entry
> {
> #ifdef LITTLE_ENDIAN
> printf("Little!\n");
> #else
> printf("Big!\n");
> #endif
> exit(0);
> }
>
> Dan
Dan,
How about
#include <sys/isa_defs.h>
instead of
> #ifdef i386
> #define LITTLE_ENDIAN
> #endif
which gives you _LITTLE_ENDIAN and _BIG_ENDIAN ?
--
Regards,
Cyril
_______________________________________________
dtrace-discuss mailing list
[email protected]