add opendir alias
[minix.git] / lib / libc / compat / gen / compat_fts.c
blobe590120b099f4c2b4b54acececbfd08c376cacf2
1 /* $NetBSD: compat_fts.c,v 1.6 2012/03/15 16:47:38 christos Exp $ */
3 /*
4 * Written by Jason R. Thorpe <thorpej@NetBSD.org>, October 21, 1997.
5 * Public domain.
6 */
8 #include "namespace.h"
9 #include <sys/cdefs.h>
10 #include <dirent.h>
12 #define __LIBC12_SOURCE__
13 #include <sys/stat.h>
14 #include <compat/sys/time.h>
15 #include <compat/sys/stat.h>
17 #define __fts_stat_t struct stat12
18 #define __fts_nlink_t u_int16_t
19 #define __fts_ino_t u_int32_t
20 #define __fts_length_t unsigned short
21 #define __fts_number_t long
22 #define __fts_dev_t uint32_t
23 #define __fts_level_t short
25 #ifndef ftsent_namelen
26 #define ftsent_namelen_truncate(a) \
27 ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
28 #endif
29 #ifndef fts_pathlen_truncate
30 #define ftsent_pathlen_truncate(a) \
31 ((a) > USHRT_MAX ? USHRT_MAX : (unsigned short)(a))
32 #endif
34 #include <fts.h>
35 #include <compat/include/fts.h>
37 #ifdef __weak_alias
38 __weak_alias(fts_children,_fts_children)
39 __weak_alias(fts_close,_fts_close)
40 __weak_alias(fts_open,_fts_open)
41 __weak_alias(fts_read,_fts_read)
42 __weak_alias(fts_set,_fts_set)
43 #endif /* __weak_alias */
45 __warn_references(fts_children,
46 "warning: reference to compatibility fts_children();"
47 " include <fts.h> for correct reference")
48 __warn_references(fts_close,
49 "warning: reference to compatibility fts_close();"
50 " include <fts.h> for correct reference")
51 __warn_references(fts_open,
52 "warning: reference to compatibility fts_open();"
53 " include <fts.h> for correct reference")
54 __warn_references(fts_read,
55 "warning: reference to compatibility fts_read();"
56 " include <fts.h> for correct reference")
57 __warn_references(fts_set,
58 "warning: reference to compatibility fts_set();"
59 " include <fts.h> for correct reference")
61 #define __FTS_COMPAT_TAILINGSLASH
62 #define __FTS_COMPAT_LENGTH
63 #define __FTS_COMPAT_LEVEL
65 #include "gen/fts.c"