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,41 @@
#include "StatTask.h"
using namespace std;
namespace storagemanager
{
StatTask::StatTask(int sock, uint len) : PosixTask(sock, len)
{
}
StatTask::~StatTask()
{
}
void StatTask::run()
{
bool success;
uint8_t buf[1024] = {0};
if (getLength() > 1023) {
handleError("StatTask read", ENAMETOOLONG);
return;
}
success = read(buf, getLength());
check_error("StatTask read");
cmd_overlay *cmd = (cmd_overlay *) buf;
struct stat _stat;
// IOC->stat(cmd->path, &_stat);
// bogus response
memset(&_stat, 0, sizeof(_stat));
uint32_t *buf32 = (uint32_t *) buf;
buf32[0] = SM_MSG_START;
buf32[1] = sizeof(_stat);
memcpy(&buf[SM_HEADER_LEN], &_stat, sizeof(_stat));
write(buf, SM_HEADER_LEN + sizeof(_stat));
}