8d1af19 for CDRIVER-4227 introduced -D_XOPEN_SOURCE=700, which specifies POSIX 2008. When adding that to PHPC's CFLAGS, I now see errors that several DNS constants and symbols are no longer defined. The Conforming To section of h_errno(3) states:
POSIX.1-2008 removes the specifications of gethostbyname(), gethostbyaddr(), and _h_errno_, recommending the use of getaddrinfo(3) and getnameinfo(3) instead.
Seems relevant, but I'm not sure why libmongoc didn't require additional changes (mongodb/mongo-c-driver#910) when instituting that change. Build errors follow:
phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c: In function ‘_mongoc_hstrerror’: phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:306:9: error: ‘HOST_NOT_FOUND’ undeclared (first use in this function) 306 | case HOST_NOT_FOUND: | ^~~~~~~~~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:306:9: note: each undeclared identifier is reported only once for each function it appears in phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:308:9: error: ‘NO_ADDRESS’ undeclared (first use in this function) 308 | case NO_ADDRESS: | ^~~~~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:310:9: error: ‘NO_RECOVERY’ undeclared (first use in this function) 310 | case NO_RECOVERY: | ^~~~~~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:312:9: error: ‘TRY_AGAIN’ undeclared (first use in this function); did you mean ‘EAI_AGAIN’? 312 | case TRY_AGAIN: | ^~~~~~~~~ | EAI_AGAIN phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c: In function ‘srv_callback’: phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:349:37: error: ‘h_errno’ undeclared (first use in this function); did you mean ‘errno’? 349 | _mongoc_hstrerror (h_errno)); | ^~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:99:23: note: in definition of macro ‘DNS_ERROR’ 99 | __VA_ARGS__); \ | ^~~~~~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c: In function ‘_mongoc_get_rr_search’: phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:495:40: error: ‘h_errno’ undeclared (first use in this function); did you mean ‘errno’? 495 | _mongoc_hstrerror (h_errno)); | ^~~~~~~ phpc/src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.c:99:23: note: in definition of macro ‘DNS_ERROR’ 99 | __VA_ARGS__); \ | ^~~~~~~~~~~
- is related to
-
CDRIVER-4028 Wrong error message printed when DNS resolution fails
- Closed
-
CDRIVER-4227 Use a shared_mutex when locking in shared_ptr atomic operations
- Closed
- related to
-
PHPC-2270 Define constants for POSIX features and extensions used by libmongoc 1.24
- Closed