/**
 * $Id$
 * Copyright (C) 2008 - 2014 Nils Asmussen
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#pragma once

#include <sys/common.h>

#define tpool_lock(...)		0
#define tpool_unlock(...)	0

namespace fs {

static const uid_t KERNEL_UID	= -1;
static const size_t MAX_GROUPS	= 32;

struct User {
	static User kernel() {
		return User(KERNEL_UID,0);
	}

	explicit User() : uid(), gid(), groupCount() {
	}
	explicit User(uid_t _uid,gid_t _gid) : uid(_uid), gid(_gid), groupCount() {
	}

	bool isKernel() const {
		return uid == KERNEL_UID;
	}

	uid_t uid;
	gid_t gid;
	size_t groupCount;
	gid_t gids[MAX_GROUPS];
};

}
