-) Let's not use _POSIX_SOURCE. It usually implies too much C99. _BSD_SOURCE would be the right thing to do here.
-) _BSD_SOURCE is getting deprecated by glibc, so we also have to define _DEFAULT_SOURCE under Linux.
-) accept4 and eventfd arn't as old as we may think; let's detect for it.
-) stdint.h interferes with all these definitions if included too early; let's move it down.
Let's include <features.h> to figure out if the system we're on is supporting secure_getenv, and adapt accordingly.
I suspect we might want to do the same with epoll, as it was added to glibc in 2.3.2, and eventfd has been added to glibc in 2.8.
This is a multipoller based on epoll rather than poll.
Note that this implementation is aimed at correctness rather than
performance, although it should immediately have better scalability to
large numbers of FDs, both due to epoll's O(1) sized API and due to not
needing to wake up polling threads to do interest set changes.
One notable difference here is that we directly attach a wakeup fd
rather than using the freelisting kick mechanism that the poll() based
implementations use, because modifying the epoll set to use a different
kick fd each time isn't free.
The problem is that for the typedef to work we need _POSIX_C_SOURCE to
be defined properly before any file that uses gpr_timespec includes
anything. This is extremely fragile unless we change CFLAGS, which
probably isn't worth doing for this.
- Had to add support for files and environment variables as well.
- I can't compile on windows so I'm sure there will be some issues.
- Tested end-to-end with the simple ssl fullstack test.
This introduces the wakeup fd interface, corresponding approximately to
the existing Google version, complete with a ported giant detailed usage
comment.
The implementation has two layers, "specialized" and "fallback". The
specialized layer is intended to be a suitable platform specific
implementation like eventfd, whereas "fallback" is probably pipe, with
runtime detection of whether the specialized version works on this
system (currently stubbed out).
- Changed the unsigned char * + size to NULL terminated strings which
makes sense for the PEM format. I may change TSI later (but the impact
will hopefully be much more limited).
- Added a way to pass multiple key/cert pairs to servers which is needed
when hosting more than one domain.
- Removed the C++ SSL credentials tests as we are going to have an
option to not specify the roots which will then be derived from the
environment (well-known platform dependent locations and/or
environment variable).
- Fixed the php build which is the only one added in the run_test.py.
This change will certainly break node, python and ruby.
Allows servers to expedite shutdown once all in-progress calls are
completed. We may want to eventually remove grpc_server_shutdown in
preference to this.