1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

the begginning

This commit is contained in:
david hill
2016-01-06 14:08:59 -06:00
parent 66a31debcb
commit f6afc42dd0
18251 changed files with 16460679 additions and 2 deletions

27
tools/vbgen/myrand.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "myrand.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdexcept>
using namespace std;
namespace myrand
{
MyRand::MyRand(int min, int max) :
fMin(min),
fMax(max)
{
if (fMax < fMin) throw range_error("max<min");
int fd;
fd = open("/dev/urandom", O_RDONLY);
if (fd < 0) throw runtime_error("open");
read(fd, &fSeed, 4);
close(fd);
}
}
// vim:ts=4 sw=4: