The error code for batch error in the kernel is 65.  I'll have to search to see if there is a nice symbol that the kernel uses.