vfs_posixacl: catch ACL_EVERYONE on FreeBSD
[Samba.git] / lib / util / fault.h
blob98a24a34709311d826b0de9d6d4ea1ee1d886478
1 /*
2 Unix SMB/CIFS implementation.
3 Critical Fault handling
4 Copyright (C) Andrew Tridgell 1992-1998
5 Copyright (C) Tim Prouty 2009
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SAMBA_FAULT_H_
22 #define _SAMBA_FAULT_H_
24 #include <sys/types.h>
26 #include "attr.h"
27 #include "debug.h"
29 /**
30 * assert macros
32 #define SMB_ASSERT(b) \
33 do { \
34 if (!(b)) { \
35 DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
36 __FILE__, __LINE__, #b)); \
37 smb_panic("assert failed: " #b); \
38 } \
39 } while(0)
41 extern const char *panic_action;
43 /**
44 Something really nasty happened - panic !
45 **/
46 typedef void (*smb_panic_handler_t)(const char *why);
48 void fault_configure(smb_panic_handler_t panic_handler);
49 void fault_setup(void);
50 void fault_setup_disable(void);
51 _NORETURN_ void smb_panic(const char *reason);
54 #endif /* _SAMBA_FAULT_H_ */