mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Ensure 64-bit off_t is used in user space instead of loff_t
Use 64-bit POSIX off_t in user space instead of the Linux kernel type loff_t. This is enforced at configure time via AC_SYS_LARGEFILE and AC_CHECK_SIZEOF([off_t]). loff_t remains in shared headers where they mirror Linux VFS interfaces, and on FreeBSD we typedef loff_t to off_t in those headers since libc does not provide it. Reviewed-by: Rob Norris <robn@despairlabs.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Moch <mail@alexmoch.com> Closes #18020
This commit is contained in:
@@ -25,6 +25,17 @@
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
|
||||
/*
|
||||
* loff_t is a Linux kernel/VFS type. glibc and musl expose it to user
|
||||
* space via <fcntl.h>, but FreeBSD libc does not. For FreeBSD user
|
||||
* space we map loff_t to off_t so the shared interfaces that use the
|
||||
* loff_t name still compile. The FreeBSD kernel gets loff_t from its
|
||||
* own linux-compat headers.
|
||||
*/
|
||||
#if !defined(_KERNEL) && defined(__FreeBSD__)
|
||||
typedef off_t loff_t;
|
||||
#endif
|
||||
|
||||
#ifndef _KERNEL
|
||||
typedef struct zfs_file {
|
||||
int f_fd;
|
||||
|
||||
Reference in New Issue
Block a user