diff options
author | bde <bde@FreeBSD.org> | 1997-04-13 15:38:10 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-04-13 15:38:10 +0000 |
commit | 1c9db9a173eb2859df457050c43bc491c1e7c955 (patch) | |
tree | 1cccd29bdab4ff1f3d9e8547673f51aa274df1f4 /sys | |
parent | b9d8e9106dd254df3090edad75501f9c3d28e12d (diff) | |
download | FreeBSD-src-1c9db9a173eb2859df457050c43bc491c1e7c955.zip FreeBSD-src-1c9db9a173eb2859df457050c43bc491c1e7c955.tar.gz |
#ifdef'ed the declaration of lseek() so that -Wredundant-decls doesn't
cause noise.
Duplicated the lseek() redeclaration hack for all functions involving
off_t's (ftruncate(), mmap() and truncate()) to help broken programs
work.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/mman.h | 5 | ||||
-rw-r--r-- | sys/sys/types.h | 40 |
2 files changed, 32 insertions, 13 deletions
diff --git a/sys/sys/mman.h b/sys/sys/mman.h index ba1b9b2..f8d9a04 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mman.h 8.2 (Berkeley) 1/9/95 - * $Id$ + * $Id: mman.h,v 1.17 1997/02/22 09:45:34 peter Exp $ */ #ifndef _SYS_MMAN_H_ @@ -104,7 +104,10 @@ #include <sys/cdefs.h> __BEGIN_DECLS +#ifndef _MMAP_DECLARED +#define _MMAP_DECLARED caddr_t mmap __P((caddr_t, size_t, int, int, int, off_t)); +#endif int mprotect __P((caddr_t, size_t, int)); int munmap __P((caddr_t, size_t)); int msync __P((caddr_t, size_t, int)); diff --git a/sys/sys/types.h b/sys/sys/types.h index dd9e4df..7469a96 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)types.h 8.6 (Berkeley) 2/19/95 - * $Id: types.h,v 1.18 1997/02/22 09:46:18 peter Exp $ + * $Id: types.h,v 1.19 1997/04/13 15:27:12 bde Exp $ */ #ifndef _SYS_TYPES_H_ @@ -81,17 +81,6 @@ typedef int boolean_t; typedef struct vm_page *vm_page_t; #endif -/* - * This belongs in unistd.h, but is placed here to ensure that programs - * casting the second parameter of lseek to off_t will get the correct - * version of lseek. - */ -#ifndef KERNEL -__BEGIN_DECLS -off_t lseek __P((int, off_t, int)); -__END_DECLS -#endif - #ifndef _POSIX_SOURCE /* * minor() gives a cookie instead of an index since we don't want to @@ -155,6 +144,33 @@ typedef struct fd_set { #define FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) #define FD_ZERO(p) bzero(p, sizeof(*(p))) +/* + * These declarations belong elsewhere, but are repeated here and in + * <stdio.h> to give broken programs a better chance of working with + * 64-bit off_t's. + */ +#ifndef KERNEL +#include <sys/cdefs.h> +__BEGIN_DECLS +#ifndef _FTRUNCATE_DECLARED +#define _FTRUNCATE_DECLARED +int ftruncate __P((int, off_t)); +#endif +#ifndef _LSEEK_DECLARED +#define _LSEEK_DECLARED +off_t lseek __P((int, off_t, int)); +#endif +#ifndef _MMAP_DECLARED +#define _MMAP_DECLARED +caddr_t mmap __P((caddr_t, size_t, int, int, int, off_t)); +#endif +#ifndef _TRUNCATE_DECLARED +#define _TRUNCATE_DECLARED +int truncate __P((const char *, off_t)); +#endif +__END_DECLS +#endif /* !KERNEL */ + #if defined(__STDC__) && defined(KERNEL) /* * Forward structure declarations for function prototypes. We include the |