Mac OS X 10.4 needs a runtime check if we are going to use the
syscall, there is no cpp define to use to check the version. Every after 10.0 (darwin 8.0) uses the /dev/ version of the pioctl. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16117 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -410,6 +410,38 @@ k_hasafs(void)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
/*
|
||||||
|
* Darwin needs runtime check if we want to use the syscall
|
||||||
|
*/
|
||||||
|
do {
|
||||||
|
int version;
|
||||||
|
int mib[2];
|
||||||
|
size_t len;
|
||||||
|
char *kernelVersion;
|
||||||
|
|
||||||
|
mib[0] = CTL_KERN;
|
||||||
|
mib[1] = KERN_OSRELEASE;
|
||||||
|
|
||||||
|
if (sysctl(mib, 2, NULL, &len, NULL, 0))
|
||||||
|
break;
|
||||||
|
kernelVersion = malloc(len);
|
||||||
|
if (kernelVersion == NULL)
|
||||||
|
break;
|
||||||
|
if (sysctl(mib, 2, kernelVersion, &len, NULL, 0)) {
|
||||||
|
free(kernelVersion);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
version = atoi(kernelVersion);
|
||||||
|
free(kernelVersion);
|
||||||
|
if (version >= 8)
|
||||||
|
goto skip_syscall;
|
||||||
|
|
||||||
|
} while(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(AFS_SYSCALL) || defined(AFS_SYSCALL2) || defined(AFS_SYSCALL3)
|
#if defined(AFS_SYSCALL) || defined(AFS_SYSCALL2) || defined(AFS_SYSCALL3)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
@@ -491,6 +523,10 @@ k_hasafs(void)
|
|||||||
goto done;
|
goto done;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
skip_syscall:
|
||||||
|
#endif
|
||||||
|
|
||||||
if (try_ioctlpath("/proc/fs/openafs/afs_ioctl", LINUX_PROC_POINT) == 0)
|
if (try_ioctlpath("/proc/fs/openafs/afs_ioctl", LINUX_PROC_POINT) == 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (try_ioctlpath("/proc/fs/nnpfs/afs_ioctl", LINUX_PROC_POINT) == 0)
|
if (try_ioctlpath("/proc/fs/nnpfs/afs_ioctl", LINUX_PROC_POINT) == 0)
|
||||||
|
Reference in New Issue
Block a user