-
Notifications
You must be signed in to change notification settings - Fork 710
Expand file tree
/
Copy pathunistd.h
More file actions
36 lines (28 loc) · 766 Bytes
/
unistd.h
File metadata and controls
36 lines (28 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* This file is part of libnvme.
* Copyright (c) 2026 Micron Technology, Inc.
*
* Cross-platform compatibility for unistd.h.
* Provides functionality that may be missing on some platforms.
* Compatibility is not comprehensive. Only functionality required by
* nvme-cli and libnvme is included.
*
* Authors: Brandon Busacker <[email protected]>
*/
#pragma once
#include <unistd.h>
#if defined(_WIN32)
#include <io.h>
#include <sysinfoapi.h>
#include <winsock2.h> /* for gethostname */
/* unistd.h POSIX compatibility */
#define fsync _commit
/* getpagesize implementation for Windows */
static inline int getpagesize(void)
{
SYSTEM_INFO si;
GetSystemInfo(&si);
return si.dwPageSize;
}
#endif