summaryrefslogtreecommitdiff
path: root/usr.bin/tcfs/tcfs_getstatus.c
blob: 5c135d9ff0e631cde6ca1f568658382e530ffbe5 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*	$OpenBSD: tcfs_getstatus.c,v 1.7 2000/06/20 07:58:57 fgsch Exp $	*/

/*
 *	Transparent Cryptographic File System (TCFS) for NetBSD 
 *	Author and mantainer: 	Luigi Catuogno [luicat@tcfs.unisa.it]
 *	
 *	references:		http://tcfs.dia.unisa.it
 *				tcfs-bsd@tcfs.unisa.it
 */

/*
 *	Base utility set v0.1
 */

#include <sys/types.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <sys/ucred.h>
#include <ctype.h>
#include <pwd.h>
#include <unistd.h>

#include <miscfs/tcfs/tcfs.h>
#include <miscfs/tcfs/tcfs_cmd.h>

#include "tcfsdefines.h"
#include "tcfslib.h"
#include "tcfspwdb.h"


int
tcfs_getstatus(char *filesystem, struct tcfs_status *st)
{
	int i;
	struct tcfs_args x;

	if (!tcfs_verify_fs(filesystem))
		return (-1);	

	x.cmd = TCFS_GET_STATUS;
	i = tcfs_callfunction(filesystem, &x);
	*st = x.st;

	return (i);
}