cmogstored.git  about / heads / tags
alternative mogstored implementation for MogileFS
blob 17d104bfdd84c34775a4eba56105b9f4dbfe00c1 499 bytes (raw)
$ git show gl-env: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-2016 all contributors <cmogstored-public@bogomips.org>
 * License: GPLv3 or later (see COPYING for details)
 */
#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