forked from openzfs/spl
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Linux 5.0 compat: Fix timespec_sub()
The 5.0 kernel no longer include timespec_sub(). It only has timespec64_sub(). Add a compatibility function. Signed-off-by: Tony Hutter <hutter2@llnl.gov>
- Loading branch information
1 parent
489f931
commit a333b28
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| dnl # | ||
| dnl # 5.0 API change | ||
| dnl # | ||
| dnl # Does timespec_sub() exists? If not, use timespec64_sub(). | ||
| dnl # | ||
| AC_DEFUN([SPL_AC_KERNEL_TIMESPEC_SUB], [ | ||
| AC_MSG_CHECKING([whether timespec_sub() exists]) | ||
| SPL_LINUX_TRY_COMPILE([ | ||
| #include <linux/time.h> | ||
| ],[ | ||
| struct timespec a = {0}, b = {0}; | ||
| timespec_sub(a, b); | ||
| ],[ | ||
| AC_MSG_RESULT(yes) | ||
| AC_DEFINE(HAVE_KERNEL_TIMESPEC_SUB, 1, | ||
| [kernel has timespec_sub]) | ||
| ],[ | ||
| AC_MSG_RESULT(no) | ||
| ]) | ||
| ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters