dirent.h (331722) | dirent.h (341074) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)dirent.h 8.3 (Berkeley) 8/10/94 | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)dirent.h 8.3 (Berkeley) 8/10/94 |
30 * $FreeBSD: stable/11/sys/sys/dirent.h 331722 2018-03-29 02:50:57Z eadler $ | 30 * $FreeBSD: stable/11/sys/sys/dirent.h 341074 2018-11-27 16:51:18Z markj $ |
31 */ 32 33#ifndef _SYS_DIRENT_H_ 34#define _SYS_DIRENT_H_ 35 36#include <sys/cdefs.h> 37#include <sys/_types.h> 38 --- 51 unchanged lines hidden (view full) --- 90 * a manifest constant that is not. 91 */ 92#define _GENERIC_DIRSIZ(dp) \ 93 ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) 94#endif /* __BSD_VISIBLE */ 95 96#ifdef _KERNEL 97#define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) | 31 */ 32 33#ifndef _SYS_DIRENT_H_ 34#define _SYS_DIRENT_H_ 35 36#include <sys/cdefs.h> 37#include <sys/_types.h> 38 --- 51 unchanged lines hidden (view full) --- 90 * a manifest constant that is not. 91 */ 92#define _GENERIC_DIRSIZ(dp) \ 93 ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) 94#endif /* __BSD_VISIBLE */ 95 96#ifdef _KERNEL 97#define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) |
98 99/* 100 * Ensure that padding bytes are zeroed and that the name is NUL-terminated. 101 */ 102static inline void 103dirent_terminate(struct dirent *dp) 104{ 105 106 memset(dp->d_name + dp->d_namlen, 0, 107 dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); 108} |
|
98#endif 99 100#endif /* !_SYS_DIRENT_H_ */ | 109#endif 110 111#endif /* !_SYS_DIRENT_H_ */ |