win: remove uv_get_osfhandle
As it is not needed anymore after implementing LEP-0005. PR-URL: https://github.com/libuv/libuv/pull/1962 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
6e7da5fbc0
commit
9b668ab2f5
@ -445,15 +445,6 @@ Helper functions
|
||||
|
||||
.. versionadded:: 2.0.0 replace uv_file with uv_os_fd_t
|
||||
|
||||
.. c:function:: int uv_open_osfhandle(uv_os_fd_t os_fd)
|
||||
|
||||
For a OS-dependent handle, get the file descriptor in the C runtime.
|
||||
On UNIX, returns the ``os_fd`` intact. On Windows, this calls `_open_osfhandle <https://msdn.microsoft.com/en-us/library/bdts1c9x.aspx>`_.
|
||||
Note that the return value is still owned by the CRT,
|
||||
any attempts to close it or to use it after closing the handle may lead to malfunction.
|
||||
|
||||
.. versionadded:: 1.23.0
|
||||
|
||||
File open constants
|
||||
-------------------
|
||||
|
||||
|
||||
@ -1131,8 +1131,6 @@ UV_EXTERN int uv_get_process_title(char* buffer, size_t size);
|
||||
UV_EXTERN int uv_set_process_title(const char* title);
|
||||
UV_EXTERN int uv_resident_set_memory(size_t* rss);
|
||||
UV_EXTERN int uv_uptime(double* uptime);
|
||||
UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd);
|
||||
UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd);
|
||||
|
||||
typedef struct {
|
||||
long tv_sec;
|
||||
|
||||
@ -1352,11 +1352,6 @@ int uv_os_gethostname(char* buffer, size_t* size) {
|
||||
}
|
||||
|
||||
|
||||
int uv_open_osfhandle(uv_os_fd_t os_fd) {
|
||||
return os_fd;
|
||||
}
|
||||
|
||||
|
||||
uv_pid_t uv_os_getpid(void) {
|
||||
return getpid();
|
||||
}
|
||||
|
||||
@ -148,8 +148,3 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) {
|
||||
int uv_is_closing(const uv_handle_t* handle) {
|
||||
return !!(handle->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED));
|
||||
}
|
||||
|
||||
|
||||
int uv_open_osfhandle(uv_os_fd_t os_fd) {
|
||||
return _open_osfhandle((intptr_t) os_fd, 0);
|
||||
}
|
||||
|
||||
@ -3264,52 +3264,6 @@ TEST_IMPL(fs_invalid_filename) {
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_IMPL(open_osfhandle_valid_handle) {
|
||||
int r;
|
||||
uv_os_fd_t handle;
|
||||
int fd;
|
||||
|
||||
/* Setup. */
|
||||
unlink("test_file");
|
||||
|
||||
loop = uv_default_loop();
|
||||
|
||||
r = uv_fs_open(NULL,
|
||||
&open_req1,
|
||||
"test_file",
|
||||
O_RDWR | O_CREAT,
|
||||
S_IWUSR | S_IRUSR,
|
||||
NULL);
|
||||
ASSERT(r >= 0);
|
||||
ASSERT(open_req1.result >= 0);
|
||||
uv_fs_req_cleanup(&open_req1);
|
||||
|
||||
handle = (uv_os_fd_t) open_req1.result;
|
||||
#ifdef _WIN32
|
||||
ASSERT(handle != INVALID_HANDLE_VALUE);
|
||||
#else
|
||||
ASSERT(handle >= 0);
|
||||
#endif
|
||||
|
||||
fd = uv_open_osfhandle(handle);
|
||||
#ifdef _WIN32
|
||||
ASSERT(fd > 0);
|
||||
#else
|
||||
ASSERT(fd == open_req1.result);
|
||||
#endif
|
||||
|
||||
r = uv_fs_close(NULL, &close_req, (uv_os_fd_t) open_req1.result, NULL);
|
||||
ASSERT(r == 0);
|
||||
ASSERT(close_req.result == 0);
|
||||
uv_fs_req_cleanup(&close_req);
|
||||
|
||||
/* Cleanup. */
|
||||
unlink("test_file");
|
||||
|
||||
MAKE_VALGRIND_HAPPY();
|
||||
return 0;
|
||||
}
|
||||
|
||||
TEST_IMPL(fs_file_pos_after_op_with_offset) {
|
||||
int r;
|
||||
uv_os_fd_t file;
|
||||
|
||||
@ -352,7 +352,6 @@ TEST_DECLARE (fs_read_write_null_arguments)
|
||||
#ifdef _WIN32
|
||||
TEST_DECLARE (fs_invalid_filename)
|
||||
#endif
|
||||
TEST_DECLARE (open_osfhandle_valid_handle)
|
||||
TEST_DECLARE (fs_write_alotof_bufs)
|
||||
TEST_DECLARE (fs_write_alotof_bufs_with_offset)
|
||||
TEST_DECLARE (fs_file_pos_after_op_with_offset)
|
||||
@ -925,7 +924,6 @@ TASK_LIST_START
|
||||
TEST_ENTRY (fs_open_readonly_acl)
|
||||
TEST_ENTRY (fs_fchmod_archive_readonly)
|
||||
#endif
|
||||
TEST_ENTRY (open_osfhandle_valid_handle)
|
||||
TEST_ENTRY (threadpool_queue_work_simple)
|
||||
TEST_ENTRY (threadpool_queue_work_einval)
|
||||
TEST_ENTRY (threadpool_multiple_event_loops)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user