Turns out, when an application (e.g. a sample) has an option CONFIG_POSIX_API=y in its prj.conf, it doesn't have include/posix/ path added to its compiler include path. This is completely unexpected given the https://github.com/zephyrproject-rtos/zephyr/blob/master/lib/posix/CMakeLists.txt#L6 directive. Turns out that a few POSIX tests we have work that around by explicitly adding that include path explicitly in app's CMakeLists.txt: https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/posix/common/CMakeLists.txt#L7
This is completely not adequate behavior, requiring obscure options to use Zephyr POSIX subsystem, and leaking and repeating details of internal setup into each and every POSIX app.