Set the current value of the ctypes-private copy of the system errno variable in the calling thread to value and return the previous value.
ctypes/set_errno
set_errno