diff --git a/io/include/pcl/io/low_level_io.h b/io/include/pcl/io/low_level_io.h index 7cc26fd95c9..e28672235cf 100644 --- a/io/include/pcl/io/low_level_io.h +++ b/io/include/pcl/io/low_level_io.h @@ -181,6 +181,12 @@ namespace pcl // All other errors are passed up. if (errno != EINVAL) return -1; +# elif defined(__OpenBSD__) + // OpenBSD does not have neither posix_fallocate nor fallocate + if (::ftruncate(fd, length) == 0) + return 0; + if (errno != EINVAL) + return -1; # else // Conforming POSIX systems have posix_fallocate. const int res = ::posix_fallocate(fd, 0, length);