_BSD_SOURCE has been deprecated and replaced with _DEFAULT_SOURCE
for feature test macros. We use this for preadv in the configure
script, but the latest preadv(2) manpage says:
preadv(), pwritev():
since glibc 2.19:
_DEFAULT_SOURCE
Glibc 2.19 and earlier:
_BSD_SOURCE
and the latest feature_test_macros(7) manpage says:
Since glibc 2.20, this macro is deprecated. It now has the same
effect as defining _DEFAULT_SOURCE, but generates a compile-time
warning (unless _DEFAULT_SOURCE is also defined). Use
_DEFAULT_SOURCE instead. To allow code that requires
_BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in
glibc 2.20 and later to compile without warnings, define both
_BSD_SOURCE and _DEFAULT_SOURCE.
So add both to our configure test. They were completely missing
from the actual preadv usage in xfs_io, so add them there too.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen@redhat.com: clarify changelog, add defines to code use too]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <sys/uio.h>
#include "command.h"
#include "input.h"
[ AC_MSG_CHECKING([for preadv])
AC_TRY_LINK([
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <sys/uio.h>
], [
preadv(0, 0, 0, 0);