1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-17 01:02:23 +03:00

Finished first cut of CRP & PosixTasks. No way it builds yet.

This commit is contained in:
Patrick LeBlanc
2019-01-29 09:52:14 -06:00
parent b38c92738c
commit 8d926202ac
13 changed files with 283 additions and 6 deletions

View File

@@ -0,0 +1,39 @@
#include "TruncateTask.h"
using namespace std;
namespace storagemanager
{
TruncateTask::TruncateTask(int sock, uint len) : PosixTask(sock, len)
{
}
TruncateTask::~TruncateTask()
{
}
void TruncateTask::run()
{
bool success;
uint8_t buf[1024] = {0};
if (getLength() > 1023) {
handleError("TruncateTask read", ENAMETOOLONG);
return;
}
success = read(buf, getLength());
check_error("TruncateTask read");
cmd_overlay *cmd = (cmd_overlay *) buf;
// IOC->truncate(cmd->filename, cmd->newSize);
// generic success msg
uint32_t *buf32 = buf;
buf32[0] = SM_MSG_START;
buf32[1] = 4;
buf32[2] = 0;
write(buf, 12);
}