-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: chunkio: sync dev changes (details below)
8ce449f file: fix invalid metadata length 8487554 crc32: endian.h is in /usr/include/sys on FreeBSD 02a5eed file: fallocate exists only on Linux 530063e meta: move the file writer into a separate function 709e7d2 file_compat: include <chunkio_compat.h> explicitly d6edbdd meta: include <chunkio_compat.h> explicitly 1e9947b scan: stub out cio_scan_streams() if file system backend is disabled 4b56c09 compat: accumulate platform dependent headers 7ef89bb os: include <sys/types.h> for mode_t 1213306 compat: do not expose chunk_compat.h as part of library interface 74d4651 compat: clean up the compatibility stuffs for Windows 9146eae compat: fix the compat implementation of dirname() d1849a0 chunk: include <sys/types.h> explicitly b8ecd33 tests: memfs: avoid using mmap() for portability a9a4065 tests: memfs: do not touch file system while testing memfs 496c2aa build: Use /W4 instead of /Wall on MSVC b75047a core: return early when given a unsupported backend 90789c7 core: revert "CIO_HAVE_FILESYSTEM_BACKEND" ifdefs 7378992 file_compat: implement a bare compat layer for cio_file_* 7d0159c tools: cio: fix up the description of the command line options bc76f24 tests: fix SIGSEGV in 'cio-test-fs' and 'cio-test-memfs' 26bd83c tools: cio: fix SIGSEGV due to incompatible argument types d11c50e tests: Add a missing ${UNIT_TESTS_FILES} if filesystem backend available b41a266 cio_meta: Add a missing CIO_HAVE_BACKEND_FILESYSTEM if branch 22d4de5 compat: Add a missing ws2_32.lib pragma b7a83cc compat: Use strerror_s instead of strerror_r on Windows 6e1fc85 compat: Implement getpagesize() on Windows 8a00fd1 compat: Define alternative S_ISREG macro 83f6a3c tests: Don't build filesystem backend testcase 7f4546a Don't build filesystem backend related code f96d9bc build: Stop to build cio_file when filesystem backend is disabled d35623a build: Add switch for filesystem backend 378d69e build: Adjust CFLAGS for MSVC 0a14edb compat: new windows layer 0bbb338 chunkio_compat: Use _access instead of access on Windows c00c404 Add compat layer 7515cc0 tests: memfs: fix log callback function prototype Signed-off-by: Eduardo Silva <[email protected]>
- Loading branch information
Showing
23 changed files
with
436 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
|
||
/* Chunk I/O | ||
* ========= | ||
* Copyright 2018 Eduardo Silva <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef CHUNKIO_COMPAT_H | ||
#define CHUNKIO_COMPAT_H | ||
|
||
#ifdef _WIN32 | ||
#include <winsock2.h> | ||
#include <windows.h> | ||
#include <io.h> | ||
#include <direct.h> | ||
#pragma comment(lib, "ws2_32.lib") | ||
|
||
/** mode flags for access() */ | ||
#define R_OK 04 | ||
#define W_OK 02 | ||
#define X_OK 01 | ||
#define F_OK 00 | ||
|
||
#define PATH_MAX MAX_PATH | ||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) | ||
#define strerror_r(errno,buf,len) strerror_s(buf,len,errno) | ||
|
||
typedef SSIZE_T ssize_t; | ||
typedef unsigned mode_t; | ||
|
||
static inline char* dirname(const char *path) | ||
{ | ||
char drive[_MAX_DRIVE]; | ||
char dir[_MAX_DIR]; | ||
char fname[_MAX_FNAME]; | ||
char ext[_MAX_EXT]; | ||
static char buf[_MAX_PATH]; | ||
|
||
_splitpath_s(path, drive, _MAX_DRIVE, dir, _MAX_DIR, | ||
fname, _MAX_FNAME, ext, _MAX_EXT); | ||
|
||
_makepath_s(buf, _MAX_PATH, drive, dir, "", ""); | ||
|
||
return buf; | ||
} | ||
|
||
inline int getpagesize(void) | ||
{ | ||
SYSTEM_INFO system_info; | ||
GetSystemInfo(&system_info); | ||
return system_info.dwPageSize; | ||
} | ||
#else | ||
#include <unistd.h> | ||
#include <libgen.h> | ||
#include <dirent.h> | ||
#include <arpa/inet.h> | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.