I think on reflection that requiring the name of the Scheme procedure (and ipso facto its arguments) is bad. I wasn't thinking about the case where the C procedure *itself* understands how to create foreign-status objects, in which case there is no Scheme procedure.
[In Gauche]:
> Yes, we have our own C wrappers for many POSIX calls that also handles
> signals, restarts, architecture-dependent stuff, etc. FFI calls to
> POSIX APIs would duplicate such code, so I'd like to use the
> existing code for srfi-170 as well.
> And those C wrappers longjmp (we have our own macros for C stack unwinding.)
Would it be difficult if the C wrapper always take an extra symbol that
says which Scheme procedure called them? If such a C wrapper returns an
error, it could return the given symbol as part of the error object.