[Openmcl-devel] Troubleshooting FFI calls on ARM

Ron Garret ron at flownet.com
Wed Jun 19 14:25:58 PDT 2019


On Jun 19, 2019, at 2:04 PM, Jeremy Shoemaker <jeremy at codingkoi.com> wrote:

> > One suggestion: use %get-signed-long to read out a few bytes of memory at the location reported by (external "getpid”) and then write a little C program that does the same thing and see if you get the same result.
> 
> I'm not sure I entirely follow, at least the C program part. Are you suggesting peeking at the memory pointed to by the `getpid` function in C?

Yes.  Exactly.

> I'm not quite sure how to do that, but my C is pretty rusty.

#include <unistd.h>
#include <stdio.h>

int main() {
  unsigned int *p = (unsigned int *)getpid;
  for (int i=0; i<16; i++) printf("%x ", *(p+i));
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20190619/f944c175/attachment.htm>


More information about the Openmcl-devel mailing list