all: initial support for freebsd
- Use `copy_file_range(2)` over `sendfile(2)` which has wider compatibility. - Special case pam on freebsd and document `configDirectory` incompatibility. - Disable jemalloc for FreeBSD by default as it is the system allocator. - Disable breakpad by default on FreeBSD as breakpad is not supported.
This commit is contained in:
parent
341a07d05b
commit
6742148cf4
8 changed files with 39 additions and 10 deletions
|
|
@ -27,7 +27,7 @@
|
|||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/sendfile.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "instanceinfo.hpp"
|
||||
#include "logcat.hpp"
|
||||
|
|
@ -392,7 +392,7 @@ void ThreadLogging::initFs() {
|
|||
delete detailedFile;
|
||||
detailedFile = nullptr;
|
||||
} else {
|
||||
auto lock = flock {
|
||||
struct flock lock = {
|
||||
.l_type = F_WRLCK,
|
||||
.l_whence = SEEK_SET,
|
||||
.l_start = 0,
|
||||
|
|
@ -414,7 +414,7 @@ void ThreadLogging::initFs() {
|
|||
auto* oldFile = this->file;
|
||||
if (oldFile) {
|
||||
oldFile->seek(0);
|
||||
sendfile(file->handle(), oldFile->handle(), nullptr, oldFile->size());
|
||||
copy_file_range(oldFile->handle(), nullptr, file->handle(), nullptr, oldFile->size(), 0);
|
||||
}
|
||||
|
||||
this->file = file;
|
||||
|
|
@ -426,7 +426,14 @@ void ThreadLogging::initFs() {
|
|||
auto* oldFile = this->detailedFile;
|
||||
if (oldFile) {
|
||||
oldFile->seek(0);
|
||||
sendfile(detailedFile->handle(), oldFile->handle(), nullptr, oldFile->size());
|
||||
copy_file_range(
|
||||
oldFile->handle(),
|
||||
nullptr,
|
||||
detailedFile->handle(),
|
||||
nullptr,
|
||||
oldFile->size(),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
crash::CrashInfo::INSTANCE.logFd = detailedFile->handle();
|
||||
|
|
@ -889,7 +896,7 @@ bool LogReader::continueReading() {
|
|||
}
|
||||
|
||||
void LogFollower::FcntlWaitThread::run() {
|
||||
auto lock = flock {
|
||||
struct flock lock = {
|
||||
.l_type = F_RDLCK, // won't block other read locks when we take it
|
||||
.l_whence = SEEK_SET,
|
||||
.l_start = 0,
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ void QsPaths::createLock() {
|
|||
return;
|
||||
}
|
||||
|
||||
auto lock = flock {
|
||||
struct flock lock = {
|
||||
.l_type = F_WRLCK,
|
||||
.l_whence = SEEK_SET,
|
||||
.l_start = 0,
|
||||
|
|
@ -389,7 +389,7 @@ bool QsPaths::checkLock(const QString& path, InstanceLockInfo* info, bool allowD
|
|||
auto file = QFile(QDir(path).filePath("instance.lock"));
|
||||
if (!file.open(QFile::ReadOnly)) return false;
|
||||
|
||||
auto lock = flock {
|
||||
struct flock lock = {
|
||||
.l_type = F_WRLCK,
|
||||
.l_whence = SEEK_SET,
|
||||
.l_start = 0,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ bool QmlToolingSupport::lockTooling() {
|
|||
return false;
|
||||
}
|
||||
|
||||
auto lock = flock {
|
||||
struct flock lock = {
|
||||
.l_type = F_WRLCK,
|
||||
.l_whence = SEEK_SET, // NOLINT (fcntl.h??)
|
||||
.l_start = 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue