123456789101112131415161718192021222324openCtypesmoduleDef(F:Cstubs.FOREIGN)=structopenF(* Errno access functions *)letposix_errno_get_errno=foreign"posix_errno_get_errno"(void@->returningnativeint)letposix_errno_set_errno=foreign"posix_errno_set_errno"(nativeint@->returningvoid)(* strerror function - returns OCaml string (cross-platform, not thread-safe) *)letstrerror=foreign"strerror"(nativeint@->returningstring)(* strerror_r function - POSIX version returns int (0 on success) *)(* Raises Invalid_argument on Windows *)letstrerror_r=foreign"posix_errno_strerror_r"(nativeint@->ptrchar@->int@->returningnativeint)(* strlen function to get string length *)letstrlen=foreign"strlen"(ptrchar@->returningint)end