The functions return zero for success and -1 in the event of an error (whereon errno is set. The constructors throw an exception of type std::runtime_error in the event of an error.