This could also probably stay as a long though the cast below might need adjusting for architectures where long != intptr_t.
Since this doesn't return valid pointers, just errors, I think I should leave this as long. It also breaks some printf strings that want to use %ld to print these values.
This passes make tinderbox.
Haven't tested but looks good to me.