Moved Linux-specific routines out of ftkmisc and into ftkunix.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@373 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-05-05 16:48:29 +00:00
parent 2b4f58edb5
commit 86bbf5f33d
4 changed files with 69 additions and 65 deletions

View File

@@ -59,6 +59,12 @@
#include <sys/mount.h>
#endif
#ifdef FLM_LINUX
static FLMUINT gv_uiLinuxMajorVer = 0;
static FLMUINT gv_uiLinuxMinorVer = 0;
static FLMUINT gv_uiLinuxRevision = 0;
#endif
/******************************************************************************
Desc:
*******************************************************************************/
@@ -1312,7 +1318,15 @@ void f_getLinuxKernelVersion(
FLMUINT uiMajorVer = 0;
FLMUINT uiMinorVer = 0;
FLMUINT uiRevision = 0;
if( gv_uiLinuxMajorVer)
{
uiMajorVer = gv_uiLinuxMajorVer;
uiMinorVer = gv_uiLinuxMinorVer;
uiRevision = gv_uiLinuxRevision;
goto Exit;
}
if( (fd = open( "/proc/version", O_RDONLY, 0600)) == -1)
{
goto Exit;
@@ -1381,6 +1395,43 @@ Exit:
}
#endif
/***************************************************************************
Desc:
***************************************************************************/
#ifdef FLM_LINUX
void f_setupLinuxKernelVersion( void)
{
f_getLinuxKernelVersion( &gv_uiLinuxMajorVer,
&gv_uiLinuxMinorVer, &gv_uiLinuxRevision);
}
#endif
/***************************************************************************
Desc: Determines if the linux system we are running on is 2.4 or greater.
***************************************************************************/
#ifdef FLM_LINUX
FLMUINT f_getLinuxMaxFileSize( void)
{
#ifdef FLM_32BIT
return( FLM_MAXIMUM_FILE_SIZE);
#else
FLMUINT uiMaxFileSize = 0x7FF00000;
f_assert( gv_uiLinuxMajorVer);
// Is version 2.4 or greater?
if( gv_uiLinuxMajorVer > 2 ||
(gv_uiLinuxMajorVer == 2 && gv_uiLinuxMinorVer >= 4))
{
uiMaxFileSize = FLM_MAXIMUM_FILE_SIZE;
}
return( uiMaxFileSize);
#endif
}
#endif
/***************************************************************************
Desc:
***************************************************************************/