hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 3f47a059ee6661d2240467eaf81895aadc60f005
parent ebe39803bff0d717d10a505a3b2a1e8f43435d21
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri, 13 May 2022 22:23:03 -0400

linux::keyctl: add strerror

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mlinux/keyctl/types.ha | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/linux/keyctl/types.ha b/linux/keyctl/types.ha @@ -137,3 +137,11 @@ export type caps = enum u8 { CAPS1_NS_KEY_TAG = 0x02, CAPS1_NOTIFICATIONS = 0x04, }; + +// Converts an [[error]] into a human-friendly string. +export fn strerror(err: error) const str = match (err) { +case nokey => + return "A desired key was not found"; +case let err: errors::error => + return errors::strerror(err); +};