Merge new AGP functions from OpenBSD.