xref: /openbsd-src/sbin/fsck/fsutil.h (revision 893695cea05286a86be12c6215f6501df588dceb)
1*893695ceSjsg /*	$OpenBSD: fsutil.h,v 1.9 2023/01/04 13:00:11 jsg Exp $	*/
287304b87Stholo /*	$NetBSD: fsutil.h,v 1.3 1996/10/03 20:06:31 christos Exp $	*/
387304b87Stholo 
487304b87Stholo /*
587304b87Stholo  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
687304b87Stholo  *
787304b87Stholo  * Redistribution and use in source and binary forms, with or without
887304b87Stholo  * modification, are permitted provided that the following conditions
987304b87Stholo  * are met:
1087304b87Stholo  * 1. Redistributions of source code must retain the above copyright
1187304b87Stholo  *    notice, this list of conditions and the following disclaimer.
1287304b87Stholo  * 2. Redistributions in binary form must reproduce the above copyright
1387304b87Stholo  *    notice, this list of conditions and the following disclaimer in the
1487304b87Stholo  *    documentation and/or other materials provided with the distribution.
1587304b87Stholo  *
1687304b87Stholo  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1787304b87Stholo  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1887304b87Stholo  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1987304b87Stholo  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2087304b87Stholo  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2187304b87Stholo  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2287304b87Stholo  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2387304b87Stholo  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2487304b87Stholo  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2587304b87Stholo  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2687304b87Stholo  */
2787304b87Stholo 
28dd133929Sthib void xperror(const char *);
29c72b5b24Smillert void errexit(const char *, ...)
3087304b87Stholo     __attribute__((__noreturn__,__format__(__printf__,1,2)));
31c72b5b24Smillert void pfatal(const char *, ...)
3287304b87Stholo     __attribute__((__format__(__printf__,1,2)));
33c72b5b24Smillert void pwarn(const char *, ...)
3487304b87Stholo     __attribute__((__format__(__printf__,1,2)));
35c72b5b24Smillert void panic(const char *, ...)
3687304b87Stholo     __attribute__((__noreturn__,__format__(__printf__,1,2)));
37c72b5b24Smillert char *rawname(char *);
38c72b5b24Smillert char *unrawname(char *);
39c9112980Sderaadt void checkroot(void);
40c72b5b24Smillert char *blockcheck(char *);
41c72b5b24Smillert const char *cdevname(void);
42e729ad4aSjsing void setcdevname(const char *, const char *, int);
43c72b5b24Smillert int  hotroot(void);
44c72b5b24Smillert void *emalloc(size_t);
45119ae1adSderaadt void *ereallocarray(void *, size_t, size_t);
46c72b5b24Smillert char *estrdup(const char *);
4787304b87Stholo 
4887304b87Stholo #define CHECK_PREEN	1
4987304b87Stholo #define	CHECK_VERBOSE	2
5087304b87Stholo #define	CHECK_DEBUG	4
5187304b87Stholo 
5287304b87Stholo struct fstab;
53f3c3a9c6Smillert int checkfstab(int, int, void *(*)(struct fstab *),
54f3c3a9c6Smillert     int (*) (const char *, const char *, const char *, void *, pid_t *));
55