Replace select() system call with poll()

poll() is specified in POSIX.1-2001 as a simpler interface for
multiplexed file descriptors than select(). It also provides more
functionality.

This PR replaces the select() calls used in xrdp with poll()
equivalents.
This commit is contained in:
matt335672
2023-01-12 12:04:37 +00:00
parent b414cfcd5e
commit 78fa1c15b2
7 changed files with 204 additions and 235 deletions
+15
View File
@@ -167,6 +167,21 @@ int g_set_wait_obj(tintptr obj);
int g_reset_wait_obj(tintptr obj);
int g_is_wait_obj_set(tintptr obj);
int g_delete_wait_obj(tintptr obj);
/**
* Wait for the specified readable and writeable objs
*
* The wait finishes when at least one of the objects becomes
* readable or writeable
*
* @param read_objs Array of read objects
* @param rcount Number of elements in read_objs
* @param write_objs Array of write objects
* @param rcount Number of elements in write_objs
* @param mstimeout Timeout in milliseconds. <= 0 means an infinite timeout.
*
* @return 0 for success. The objects will need to be polled to
* find out what is readable or writeable.
*/
int g_obj_wait(tintptr *read_objs, int rcount, tintptr *write_objs,
int wcount, int mstimeout);
void g_random(char *data, int len);