Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test / verify uv_fileno binding #408

Open
squeek502 opened this issue Oct 11, 2019 · 1 comment
Open

Test / verify uv_fileno binding #408

squeek502 opened this issue Oct 11, 2019 · 1 comment

Comments

@squeek502
Copy link
Member

squeek502 commented Oct 11, 2019

Split from #403

Can you check that fileno is operating properly?

uv_os_fd_t is a HANDLE on Windows and a typedef int on Unix. We have no test cases and it's unclear if we're binding it in a way that makes sense for all platforms.

luv/src/handle.c

Lines 182 to 189 in cfd4f38

static int luv_fileno(lua_State* L) {
uv_handle_t* handle = luv_check_handle(L, 1);
uv_os_fd_t fd;
int ret = uv_fileno(handle, &fd);
if (ret < 0) return luv_error(L, ret);
lua_pushinteger(L, (LUA_INTEGER)(ptrdiff_t)fd);
return 1;
}

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant