I'm still thinking about this. It would certainly be useful to get the error result: errno in Unix and GetLastError and possibly also errno in Windows. It don't see a way to specify this as a return type in the FFI calls.
The main problem is that there can be invisible calls into the run-time system as a result of either heap exhaustion or stack overflow. As a first step perhaps the error state should be saved explicitly across these so it doesn't change under the feet of the application.
David
On 13/11/2016 11:49, Florian Weimer wrote:
- David Matthews:
The difficulty with getting errno in this way is that by the time you get it it may have changed from the value it had. Any calls to the run-time system may involve a system call that could affect it.
Would it make sense to use a special return type which instructs PolyML to obtain the errno value at the time of return? This would address the synchronization issue. _______________________________________________ polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml