>| Where does the foreign-pointer come from?
>it comes from POSIX:FOPEN.
Then it must be changed to interact nicely with the rest of the FFI, i.e. return type FOREIGN-ADDRESS, not FOREIGN-POINTER. FOREIGN-ADDESS is what you'd get if you used (def-call-out "fopen").
Are there other functions like this one?
FOREIGN-POINTER is what C-level code can use internally, if need be.
For historical reasons (which I believe I mentioned some years ago, rooted in the Amiga FFI analysis, where offsets to base pointers were valuable), CLISP has both foreign pointer and foreign-address, whereas the former is unknown to the FFI, except that we choose to make the SET-POINTER API public a few years ago.