diff options
Diffstat (limited to 'libs/nixio/src/nixio.c')
-rw-r--r-- | libs/nixio/src/nixio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/nixio/src/nixio.c b/libs/nixio/src/nixio.c index 383fc0af9..ae1af7a16 100644 --- a/libs/nixio/src/nixio.c +++ b/libs/nixio/src/nixio.c @@ -88,8 +88,14 @@ int nixio__tofd(lua_State *L, int ud) { return fd; } +static int nixio_strerror(lua_State *L) { + lua_pushstring(L, strerror(luaL_checkinteger(L, 1))); + return 1; +} + /* object table */ static const luaL_reg R[] = { + {"strerror", nixio_strerror}, {NULL, NULL} }; |