cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob 72e60e6c6169b4df1a132b713ac1ec26967ba2d2 506 bytes (raw)
$ git show HEAD:test/fdmap-1.c	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
/*
 * Copyright (C) 2012-2020 all contributors <cmogstored-public@yhbt.net>
 * License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 */
#include "check.h"

int main(void)
{
	struct mog_fd *mfd;
	int open_max = (int)sysconf(_SC_OPEN_MAX);
	int i;

	mfd = mog_fd_init(0, MOG_FD_TYPE_UNUSED);
	{
		struct mog_mgmt *mgmt = &mfd->as.mgmt;

		assert(mog_fd_of(mgmt) == mfd);
	}

	for (i = 0; i < open_max; i++) {
		mfd = mog_fd_init(i, MOG_FD_TYPE_UNUSED);
		assert(mfd && "mfd unset");
	}

	return 0;
}

git clone https://yhbt.net/cmogstored.git