FSIZE
LIM(FSIZE, 1024),
LIM(FSIZE, 1024),
static long fsize = FSIZE;
*begin = (uint32_t)((uint64_t)FSIZE * (uint64_t)pat->partitions[chunk - 1] >> 31);
*end = (uint32_t)((uint64_t)FSIZE * (uint64_t)pat->partitions[chunk] >> 31);
if ( ftruncate(outfd, FSIZE)){
for(ofs=0; ofs < FSIZE; ofs+=CLUSTERSIZE){
*begin = (uint32_t)((uint64_t)FSIZE * (uint64_t)pat->partitions[chunk - 1] >> 31);
*end = (uint32_t)((uint64_t)FSIZE * (uint64_t)pat->partitions[chunk] >> 31);
if ( ftruncate(outfd, FSIZE)){
for(ofs=0; ofs < FSIZE; ofs+=CLUSTERSIZE){
p_file = mmap(0, FSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, outfd, 0);
if (munmap(p_file, FSIZE)){
ATF_REQUIRE(ftruncate(c->fd, FSIZE) == 0);
ATF_REQUIRE((c->mfd = mmap(NULL, FSIZE, PROT_READ | PROT_WRITE,
arc4random_buf(c->mfd, FSIZE);
while (nread < FSIZE && (n = SSL_read_b(c.cln, buf, sizeof(buf))) > 0) {
ATF_REQUIRE(nread == FSIZE);
require_sbytes(&c, FSIZE);
offset = arc4random() % FSIZE;
expect = offset + size < FSIZE ? size : FSIZE - offset;
#define TRUNC (FSIZE - 1024)
ATF_REQUIRE(setsockopt(c.ss, SOL_SOCKET, SO_SNDBUF, &(int){FSIZE / 16},
ATF_REQUIRE(setsockopt(c.cs, SOL_SOCKET, SO_RCVBUF, &(int){FSIZE / 16},
#define GROW (FSIZE/2)
ATF_REQUIRE(setsockopt(c.ss, SOL_SOCKET, SO_SNDBUF, &(int){FSIZE / 16},
ATF_REQUIRE(setsockopt(c.cs, SOL_SOCKET, SO_RCVBUF, &(int){FSIZE / 16},
ATF_REQUIRE(ftruncate(c.fd, FSIZE + GROW) == 0);
MAP_SHARED, c.fd, FSIZE)) != MAP_FAILED);
while (nread < FSIZE && (n = SSL_read_b(c.cln, buf,
FSIZE - nread > sizeof(buf) ? sizeof(buf) : FSIZE - nread)) > 0) {
ATF_REQUIRE(nread == FSIZE);
require_sbytes(&c, FSIZE + GROW);
sendme(&c, FSIZE + 1, 0, false);
sendme_locked_wait(&c, 0, FSIZE, true);
sendme_locked_wait(&c, 0, FSIZE, true);
sendme_locked_wait(&c, FSIZE, 0, true);
sendme_locked_wait(&c, FSIZE - 100, 0, true);