xref: /freebsd/lib/libc/gen/gen-compat.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*69921123SKonstantin Belousov /*-
2*69921123SKonstantin Belousov  * Copyright (c) 2012 Gleb Kurtsou <gleb@FreeBSD.org>
3*69921123SKonstantin Belousov  * All rights reserved.
4*69921123SKonstantin Belousov  *
5*69921123SKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
6*69921123SKonstantin Belousov  * modification, are permitted provided that the following conditions
7*69921123SKonstantin Belousov  * are met:
8*69921123SKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
9*69921123SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer.
10*69921123SKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
11*69921123SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer in the
12*69921123SKonstantin Belousov  *    documentation and/or other materials provided with the distribution.
13*69921123SKonstantin Belousov  *
14*69921123SKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*69921123SKonstantin Belousov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*69921123SKonstantin Belousov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*69921123SKonstantin Belousov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*69921123SKonstantin Belousov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*69921123SKonstantin Belousov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*69921123SKonstantin Belousov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*69921123SKonstantin Belousov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*69921123SKonstantin Belousov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*69921123SKonstantin Belousov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*69921123SKonstantin Belousov  * SUCH DAMAGE.
25*69921123SKonstantin Belousov  */
26*69921123SKonstantin Belousov 
27*69921123SKonstantin Belousov #ifndef	_GEN_COMPAT_H_
28*69921123SKonstantin Belousov #define	_GEN_COMPAT_H_
29*69921123SKonstantin Belousov 
30*69921123SKonstantin Belousov #include <dirent.h>
31*69921123SKonstantin Belousov 
32*69921123SKonstantin Belousov #define FREEBSD11_DIRSIZ(dp)						\
33*69921123SKonstantin Belousov 	(sizeof(struct freebsd11_dirent) - sizeof((dp)->d_name) +	\
34*69921123SKonstantin Belousov 	    (((dp)->d_namlen + 1 + 3) &~ 3))
35*69921123SKonstantin Belousov 
36*69921123SKonstantin Belousov struct freebsd11_dirent;
37*69921123SKonstantin Belousov struct freebsd11_stat;
38*69921123SKonstantin Belousov struct freebsd11_statfs;
39*69921123SKonstantin Belousov 
40*69921123SKonstantin Belousov struct freebsd11_dirent *freebsd11_readdir(DIR *);
41*69921123SKonstantin Belousov int	freebsd11_readdir_r(DIR *, struct freebsd11_dirent *,
42*69921123SKonstantin Belousov 	    struct freebsd11_dirent **);
43*69921123SKonstantin Belousov int	freebsd11_stat(const char *, struct freebsd11_stat *);
44*69921123SKonstantin Belousov int	freebsd11_lstat(const char *, struct freebsd11_stat *);
45*69921123SKonstantin Belousov int	freebsd11_fstat(int, struct freebsd11_stat *);
46*69921123SKonstantin Belousov int	freebsd11_fstatat(int, const char *, struct freebsd11_stat *, int);
47*69921123SKonstantin Belousov 
48*69921123SKonstantin Belousov int	freebsd11_statfs(const char *, struct freebsd11_statfs *);
49*69921123SKonstantin Belousov int	freebsd11_getfsstat(struct freebsd11_statfs *, long, int);
50*69921123SKonstantin Belousov int	freebsd11_getmntinfo(struct freebsd11_statfs **, int);
51*69921123SKonstantin Belousov 
52*69921123SKonstantin Belousov char	*freebsd11_devname(__uint32_t dev, __mode_t type);
53*69921123SKonstantin Belousov char	*freebsd11_devname_r(__uint32_t dev, __mode_t type, char *buf, int len);
54*69921123SKonstantin Belousov 
55*69921123SKonstantin Belousov #endif /* _GEN_COMPAT_H_ */
56