From: Darren Tucker Date: Tue, 8 Mar 2022 22:29:30 +0000 (+1100) Subject: Check for missing ftruncate prototype. X-Git-Tag: V_9_0_P1~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c41c84b439f4cd74d4fe44298a4b4037ddd7d2ae;p=thirdparty%2Fopenssh-portable.git Check for missing ftruncate prototype. From github PR#301 in conjunction with rsbeckerca. --- diff --git a/configure.ac b/configure.ac index a165d0879..41761c5b9 100644 --- a/configure.ac +++ b/configure.ac @@ -2092,6 +2092,12 @@ AC_CHECK_DECLS([O_NONBLOCK], , , #endif ]) +AC_CHECK_DECLS([ftruncate], , , + [ +#include +#include + ]) + AC_CHECK_DECLS([readv, writev], , , [ #include #include diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index c202e1429..0cecfb621 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -65,6 +65,10 @@ int bindresvport_sa(int sd, struct sockaddr *sa); void closefrom(int); #endif +#if defined(HAVE_DECL_FTRUNCATE) && HAVE_DECL_FTRUNCATE == 0 +int ftruncate(int filedes, off_t length); +#endif + #ifndef HAVE_GETLINE #include ssize_t getline(char **, size_t *, FILE *);