Menu

[0a35e6]: / src / rtlib / win32 / file_hlock.c  Maximize  Restore  History

Download this file

18 lines (14 with data), 561 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/* low-level lock and unlock functions */
#include "../fb.h"
#include <io.h>
#include <windows.h>
int fb_hFileLock( FILE *f, fb_off_t inipos, fb_off_t size )
{
return fb_ErrorSetNum( LockFile( (HANDLE)get_osfhandle( fileno( f ) ), inipos, 0, size, 0 ) == TRUE ?
FB_RTERROR_OK : FB_RTERROR_FILEIO );
}
int fb_hFileUnlock( FILE *f, fb_off_t inipos, fb_off_t size )
{
return fb_ErrorSetNum( UnlockFile( (HANDLE)get_osfhandle( fileno( f ) ), inipos, 0, size, 0 ) == TRUE ?
FB_RTERROR_OK : FB_RTERROR_FILEIO );
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.