mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 19:38:26 -06:00
Add support for OpenBSD (#779)
* OpenBSD: add basic support modified: Build/Include/Makefile.inc modified: Driver/Fuse/FuseService.cpp modified: Main/FatalErrorHandler.cpp modified: Makefile modified: Platform/Unix/File.cpp modified: Platform/Unix/FilesystemPath.cpp modified: Platform/Unix/SystemInfo.cpp * OpenBSD: some necessary files were missing new file: Core/Unix/OpenBSD/CoreOpenBSD.cpp new file: Core/Unix/OpenBSD/CoreOpenBSD.h new file: Core/Unix/OpenBSD/System.h
This commit is contained in:
@@ -23,6 +23,12 @@
|
||||
#include <sys/disk.h>
|
||||
#endif
|
||||
|
||||
#ifdef TC_OPENBSD
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/dkio.h>
|
||||
#include <sys/disklabel.h>
|
||||
#endif
|
||||
|
||||
#ifdef TC_SOLARIS
|
||||
#include <stropts.h>
|
||||
#include <sys/dkio.h>
|
||||
@@ -113,6 +119,11 @@ namespace VeraCrypt
|
||||
throw_sys_sub_if (ioctl (FileHandle, DIOCGSECTORSIZE, §orSize) == -1, wstring (Path));
|
||||
return (uint32) sectorSize;
|
||||
|
||||
#elif defined (TC_OPENBSD)
|
||||
struct disklabel dl;
|
||||
throw_sys_sub_if (ioctl (FileHandle, DIOCGPDINFO, &dl) == -1, wstring (Path));
|
||||
return (uint32) dl.d_secsize;
|
||||
|
||||
#elif defined (TC_SOLARIS)
|
||||
struct dk_minfo mediaInfo;
|
||||
throw_sys_sub_if (ioctl (FileHandle, DKIOCGMEDIAINFO, &mediaInfo) == -1, wstring (Path));
|
||||
@@ -171,6 +182,10 @@ namespace VeraCrypt
|
||||
throw_sys_sub_if (ioctl (FileHandle, DKIOCGETBLOCKSIZE, &blockSize) == -1, wstring (Path));
|
||||
throw_sys_sub_if (ioctl (FileHandle, DKIOCGETBLOCKCOUNT, &blockCount) == -1, wstring (Path));
|
||||
return blockCount * blockSize;
|
||||
# elif TC_OPENBSD
|
||||
struct disklabel dl;
|
||||
throw_sys_sub_if (ioctl (FileHandle, DIOCGPDINFO, &dl) == -1, wstring (Path));
|
||||
return DL_GETDSIZE(&dl);
|
||||
# else
|
||||
uint64 mediaSize;
|
||||
throw_sys_sub_if (ioctl (FileHandle, DIOCGMEDIASIZE, &mediaSize) == -1, wstring (Path));
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "Platform/StringConverter.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#if !defined(__FreeBSD__) && !defined(__APPLE__)
|
||||
#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__OpenBSD__)
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace VeraCrypt
|
||||
return L"Mac OS X";
|
||||
#elif defined (TC_FREEBSD)
|
||||
return L"FreeBSD";
|
||||
#elif defined (TC_OPENBSD)
|
||||
return L"OpenBSD";
|
||||
#elif defined (TC_SOLARIS)
|
||||
return L"Solaris";
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user