1 /*	$MirOS: src/sbin/fsck/fsutil.h,v 1.2 2013/10/31 20:06:42 tg Exp $ */
2 /*	$OpenBSD: fsutil.h,v 1.5 2006/05/27 22:30:09 thib Exp $	*/
3 /*	$NetBSD: fsutil.h,v 1.3 1996/10/03 20:06:31 christos Exp $	*/
4 
5 /*
6  * Copyright © 2013
7  *	Thorsten “mirabilos” Glaser <tg@mirbsd.org>
8  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *	This product includes software developed by Christos Zoulas.
21  * 4. The name of the author may not be used to endorse or promote products
22  *    derived from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 void xperror(const char *);
37 void errexit(const char *, ...)
38     __attribute__((__noreturn__, __format__(__printf__, 1, 2)));
39 void pfatal(const char *, ...)
40     __attribute__((__format__(__printf__, 1, 2)));
41 void pwarn(const char *, ...)
42     __attribute__((__format__(__printf__, 1, 2)));
43 void panic(const char *, ...)
44     __attribute__((__noreturn__, __format__(__printf__, 1, 2)));
45 char *rawname(char *);
46 char *unrawname(char *);
47 char *blockcheck(char *);
48 const char *cdevname(void);
49 void setcdevname(const char *, int);
50 int  hotroot(void);
51 void *emalloc(size_t);
52 void *erealloc(void *, size_t);
53 char *estrdup(const char *);
54 
55 #define CHECK_PREEN	1
56 #define	CHECK_VERBOSE	2
57 #define	CHECK_DEBUG	4
58 
59 struct fstab;
60 int checkfstab(int, int, void *(*)(struct fstab *),
61     int (*) (const char *, const char *, const char *, void *, pid_t *));
62