[Gambas-user] Get last errno from external function call
benoit.minisini at gambas-basic.org
Thu Oct 6 17:23:44 CEST 2022
Le 06/10/2022 à 17:19, Matheus Castello a écrit :
> On 10/5/2022 8:30 PM, vuott--- via User wrote:
>> Out of curiosity, maybe you could also try "System.GetExternSymbol ()":
>> Dim p As Pointer
>> p = System.GetExternSymbol("libgpiod", "errno")
>> Print Int@(p)
> What I was doing previously was getting the pointer reference calling
> That works too. What is actually overwriting the errno is the IDE's
> Debug session ...
> If you try to run in the IDE debugger this will not work, this will
> return 0 always. (Could you check if its reproducible in your side please?)
I can modify the debugger so that is saves and restore 'errno'.
More information about the User