#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.
This commit is contained in:
bde 1997-04-13 15:38:10 +00:00
parent b9d8e9106d
commit 1c9db9a173
3 changed files with 42 additions and 13 deletions

View File

@ -77,7 +77,10 @@ pid_t getppid __P((void));
uid_t getuid __P((void));
int isatty __P((int));
int link __P((const char *, const char *));
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek __P((int, off_t, int));
#endif
long pathconf __P((const char *, int));
int pause __P((void));
int pipe __P((int *));
@ -117,7 +120,10 @@ int exect __P((const char *, char * const *, char * const *));
int fchdir __P((int));
int fchown __P((int, uid_t, gid_t));
int fsync __P((int));
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate __P((int, off_t));
#endif
int getdomainname __P((char *, int));
int getdtablesize __P((void));
int getgrouplist __P((const char *, int, int *, int *));
@ -172,9 +178,13 @@ int symlink __P((const char *, const char *));
void sync __P((void));
int syscall __P((int, ...));
off_t __syscall __P((quad_t, ...));
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate __P((const char *, off_t));
#endif
int ttyslot __P((void));
unsigned int ualarm __P((unsigned int, unsigned int));
int undelete __P((const char *));
int unwhiteout __P((const char *));
void usleep __P((unsigned int));
void *valloc __P((size_t)); /* obsoleted by malloc() */

View File

@ -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));

View File

@ -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