Page MenuHome GnuPG

Using poll instead, removing use of select for POSIX system
Needs ReviewPublic

Authored by gniibe on Nov 4 2021, 3:50 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

In some situations when an application uses a lot of file descriptors (like > 1024), event handling in gpgme fails miserably.

As a library, it is better to use poll instead of select.

There are (relatively minor) corner cases for portability in difference between poll and select (about regular files, /dev/null, sockets, and what event is detected how), but for the use cases in gpgme, this patch works well.

Test Plan

make check

test with gnupg test suite

test with more than 1024 fds

Diff Detail

Repository
rM GPGME
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

gniibe created this revision.

Update to include the change of tests.
Also include a change for tests/gpg/t-support.h to run tests under artificial environment.

Don't apply tests/gpg/t-support.h, it's only for testing this patch.
When test, before running 'make check' please do:

$ ulimit -n 2048 # that is, more than 1024