summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cab2440)
winsock2.h needs to be included before windows.h.
Separate declarations and code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <errno.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <errno.h>
#include <windows.h>
#include <psapi.h>
#include <stdlib.h>
#include <windows.h>
#include <psapi.h>
#include <stdlib.h>
{
int rc = 0;
HANDLE hFile;
{
int rc = 0;
HANDLE hFile;
+ GET_LENGTH_INFORMATION info;
+ DWORD outBytes;
+ LARGE_INTEGER size;
if (f->hFile == NULL) {
hFile = CreateFile(f->file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
if (f->hFile == NULL) {
hFile = CreateFile(f->file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
- GET_LENGTH_INFORMATION info;
- DWORD outBytes;
- LARGE_INTEGER size;
size.QuadPart = 0;
if (DeviceIoControl(hFile, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &outBytes, NULL))
*bytes = info.Length.QuadPart;
size.QuadPart = 0;
if (DeviceIoControl(hFile, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &outBytes, NULL))
*bytes = info.Length.QuadPart;
{
static LARGE_INTEGER freq = {{0,0}};
LARGE_INTEGER counts;
{
static LARGE_INTEGER freq = {{0,0}};
LARGE_INTEGER counts;
QueryPerformanceCounter(&counts);
if (freq.QuadPart == 0)
QueryPerformanceCounter(&counts);
if (freq.QuadPart == 0)
tp->tv_sec = counts.QuadPart / freq.QuadPart;
/* Get the difference between the number of ns stored
* in 'tv_sec' and that stored in 'counts' */
tp->tv_sec = counts.QuadPart / freq.QuadPart;
/* Get the difference between the number of ns stored
* in 'tv_sec' and that stored in 'counts' */
- uint64_t t = tp->tv_sec * freq.QuadPart;
+ t = tp->tv_sec * freq.QuadPart;
t = counts.QuadPart - t;
/* 't' now contains the number of cycles since the last second.
* We want the number of nanoseconds, so multiply out by 1,000,000,000
t = counts.QuadPart - t;
/* 't' now contains the number of cycles since the last second.
* We want the number of nanoseconds, so multiply out by 1,000,000,000