errorByNonZeroPredicate

inline fun errorByNonZeroPredicate(msg: String, predicate: () -> Long): Long

Predicate an error if more than 0, based on the return value of the POSIX function. Usually those functions are supposed to return zero or an error.

Receiver

Return

On success returns the result as an Int.

Parameters

msg

Describing the action that may go wrong.

predicate

Lambda carrying out the POSIX operation.


inline fun <E : RuntimeException> errorByNonZeroPredicate(predicate: Long, handler: (it: PosixError) -> E): Long
inline fun <E : RuntimeException> errorByNonZeroPredicate(predicate: Int, handler: (it: PosixError) -> E): Int

Predicate an error if more than 0, based on the return value of the POSIX function. Usually those functions are supposed to return zero or an error.

Receiver

Return

The predicate.

Parameters

E

Generic exception to be turned to the error method.

predicate

Predicate to be examined.

handler

Lambda that build eventual exeption to be thrown.