DOKK / manpages / debian 11 / allegro5-doc / al_get_errno.3alleg5.en
al_get_errno(3alleg5) al_get_errno(3alleg5)

al_get_errno - Allegro 5 API

int al_get_errno(void)
GETTER(allegro_errno, 0)
    

Some Allegro functions will set an error number as well as returning an error code. Call this function to retrieve the last error number set for the calling thread.

Allegro reference manual