-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[libc++][FreeBSD] use copy_file_range() in FreeBSD >= 13.0 #169179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
@llvm/pr-subscribers-libcxx Author: Raman Shishniou (004helix) ChangesThe copy_file_range() function appeared in FreeBSD 13.0. https://man.freebsd.org/cgi/man.cgi?copy_file_range Full diff: https://github.com/llvm/llvm-project/pull/169179.diff 1 Files Affected:
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index b71f94a89d6df..e58486bf5cbbd 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -50,7 +50,10 @@
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
# endif
#elif defined(__FreeBSD__)
-# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
+# include <sys/param.h>
+# if __FreeBSD_version >= 1300000
+# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
+# endif
#endif
#if __has_include(<sys/sendfile.h>)
# include <sys/sendfile.h>
|
philnik777
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emaste @DimitryAndric is FreeBSD 12 still supported?
|
According to web-site, FreeBSD 12+ |
|
FreeBSD 12 is no longer supported, so the version check is not strictly necessary. Can't hurt to let it in, though. |
|
I'm tempted to reject this, since I'm really not interested in accumulating tech debt for a platform that's already EOL and has been for quite a while AFAICT. This change has been in trunk for almost a year at this point, so there doesn't seem to be much demand for supporting FreeBSD 12 either. I'm not exactly psyched about the general non-existence of a support policy for different libcs/platforms, especially glibc. Requiring the FreeBSD version to not be EOL seems like a rather obvious policy to me, especially for an OS that's literally free. (I'm aware it's not always easy to upgrade, but that has to be done at some point, and I don't see much of a reason to drag libc++ into it) IMO the most sensible thing here is to update our documentation to reflect what we actually test and support, i.e. FreeBSD 13. |
The copy_file_range() function appeared in FreeBSD 13.0.
https://man.freebsd.org/cgi/man.cgi?copy_file_range