aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-11-22 12:54:57 +0100
committerTom de Vries <tdevries@suse.de>2024-11-22 12:54:57 +0100
commitdcc4d678668bac6e3887ea04ff2337996629411e (patch)
treed03d49f200707d4955bf582f0ce8c9e755fde91a /gdb/python/python.c
parent3c557e1ae9c320efcfd4a7a91b752413a7bfd280 (diff)
downloadgdb-dcc4d678668bac6e3887ea04ff2337996629411e.zip
gdb-dcc4d678668bac6e3887ea04ff2337996629411e.tar.gz
gdb-dcc4d678668bac6e3887ea04ff2337996629411e.tar.bz2
[gdb] Add gdb_select variant for looping
In interruptible_select we run gdb_select in a loop: ... do { res = gdb_select (n, readfds, writefds, exceptfds, timeout); } while (res == -1 && errno == EINTR); ... but man select tells us that: - if using select() within a loop, the sets (readfds, writefds and exceptfds) must be reinitialized before each call, and - timeout should be considered to be undefined after select() returns. Add a gdb_select variant: ... static int gdb_select (int n, const fd_set *req_readfds, fd_set *ret_readfds, const fd_set *req_writefds, fd_set *ret_writefds, const fd_set *req_exceptfds, fd_set *ret_exceptfds, const struct timeval *req_timeout, struct timeval *ret_timeout) ... that keeps requested and returned values separate, ensuring that the requested values stay constant. Tested on x86_64-linux. Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Diffstat (limited to 'gdb/python/python.c')
0 files changed, 0 insertions, 0 deletions