xref: /netbsd-src/external/gpl2/lvm2/dist/lib/misc/lvm-wrappers.h (revision 7c604eea85b4f330dc75ffe65e947f4d73758aa0)
1*7c604eeaShaad /*	$NetBSD: lvm-wrappers.h,v 1.1.1.3 2009/12/02 00:26:44 haad Exp $	*/
256a34939Shaad 
356a34939Shaad /*
456a34939Shaad  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
556a34939Shaad  * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
656a34939Shaad  *
756a34939Shaad  * This file is part of LVM2.
856a34939Shaad  *
956a34939Shaad  * This copyrighted material is made available to anyone wishing to use,
1056a34939Shaad  * modify, copy, or redistribute it subject to the terms and conditions
1156a34939Shaad  * of the GNU Lesser General Public License v.2.1.
1256a34939Shaad  *
1356a34939Shaad  * You should have received a copy of the GNU Lesser General Public License
1456a34939Shaad  * along with this program; if not, write to the Free Software Foundation,
1556a34939Shaad  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1656a34939Shaad  */
1756a34939Shaad 
1856a34939Shaad #ifndef _LVM_WRAPPERS_H
1956a34939Shaad #define _LVM_WRAPPERS_H
2056a34939Shaad 
2156a34939Shaad int lvm_getpagesize(void);
2256a34939Shaad 
23bec4d750Shaad /*
24bec4d750Shaad  * Read 'len' bytes of entropy from /dev/urandom and store in 'buf'.
25bec4d750Shaad  */
26bec4d750Shaad int read_urandom(void *buf, size_t len);
27bec4d750Shaad 
28*7c604eeaShaad #  ifndef HAVE_SIGINTERRUPT
29*7c604eeaShaad #    define siginterrupt(sig, flag) \
30*7c604eeaShaad 	do { \
31*7c604eeaShaad 		int ret; \
32*7c604eeaShaad 		struct sigaction act; \
33*7c604eeaShaad 		(void) sigaction(sig, NULL, &act); \
34*7c604eeaShaad 		if (flag) \
35*7c604eeaShaad 			act.sa_flags &= SA_RESTART; \
36*7c604eeaShaad 		else \
37*7c604eeaShaad 			act.sa_flags |= SA_RESTART; \
38*7c604eeaShaad 		ret = sigaction(sig, &act, NULL); \
39*7c604eeaShaad 		return ret; \
40*7c604eeaShaad 	while (0)
41*7c604eeaShaad #  endif
42*7c604eeaShaad 
4356a34939Shaad #endif
44