Print this page
remove support for non-ANSI compilation

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 
 /*
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  * Copyright (c) 2013 Gary Mills
  *
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 

@@ -239,12 +240,10 @@
 #define lockf64                         lockf
 #define tell64                          tell
 #endif  /* __PRAGMA_REDEFINE_EXTNAME */
 #endif  /* _LP64 && _LARGEFILE64_SOURCE */
 
-#if defined(__STDC__)
-
 extern int access(const char *, int);
 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 extern int acct(const char *);
 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 extern unsigned alarm(unsigned);

@@ -600,328 +599,11 @@
 extern off64_t  tell64(int);
 extern int      truncate64(const char *, off64_t);
 extern int      lockf64(int, int, off64_t);
 #endif  /* _LARGEFILE64_SOURCE */
 
-#else  /* __STDC__ */
-
-extern int access();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int acct();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern unsigned alarm();
-#if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
-        defined(__EXTENSIONS__)
-extern int brk();
-#endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
-extern int chdir();
-extern int chown();
-#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
-        defined(__EXTENSIONS__)
-extern int chroot();
-#endif /* (!defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
-extern int close();
-#if defined(_XPG4) || defined(__EXTENSIONS__)
-extern size_t confstr();
-extern char *crypt();
-#endif /* defined(XPG4) || defined(__EXTENSIONS__) */
-#if !defined(_POSIX_C_SOURCE) || defined(_XPG3) || defined(__EXTENSIONS__)
-extern char *ctermid();
-#endif /* (!defined(_POSIX_C_SOURCE) || defined(_XPG3)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) || defined(__EXTENSIONS__)
-extern char *ctermid_r();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) ... */
-#if !defined(_XPG6) || defined(__EXTENSIONS__)
-extern char *cuserid();
-#endif
-extern int dup();
-extern int dup2();
-extern int dup3();
-#if defined(_XPG4) || defined(__EXTENSIONS__)
-extern void encrypt();
-#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern void endusershell();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern int execl();
-extern int execle();
-extern int execlp();
-extern int execv();
-extern int execve();
-extern int execvp();
-extern void _exit();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int fattach();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int fchdir();
-extern int fchown();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int fchroot();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
-        defined(__EXTENSIONS__)
-extern int fdatasync();
-#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
-#if !defined(__XOPEN_OR_POSIX)
-extern int fdetach();
-#endif /* !defined(__XOPEN_OR_POSIX) */
-extern pid_t fork();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern pid_t fork1();
-extern pid_t forkall();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern long fpathconf();
-#if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
-        defined(__EXTENSIONS__)
-extern int fsync();
-#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
-#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern int ftruncate();
-#endif /* !defined(__XOPEN_OR_POSIX) (_POSIX_C_SOURCE > 2)... */
-extern char *getcwd();
-#if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
-        defined(__EXTENSIONS__)
-extern int getdtablesize();
-#endif
-extern gid_t getegid();
-extern uid_t geteuid();
-extern gid_t getgid();
-extern int getgroups();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern long gethostid();
-#endif
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int gethostname();
-#endif
-
-#ifndef __GETLOGIN_DEFINED      /* Avoid duplicate in stdlib.h */
-#define __GETLOGIN_DEFINED
-#ifndef __USE_LEGACY_LOGNAME__
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname getlogin       getloginx
-#else   /* __PRAGMA_REDEFINE_EXTNAME */
-extern char *getloginx();
-#define getlogin        getloginx
-#endif  /* __PRAGMA_REDEFINE_EXTNAME */
-#endif  /* __USE_LEGACY_LOGNAME__ */
-extern char *getlogin();
-#endif  /* __GETLOGIN_DEFINED */
-
-#if defined(_XPG4) || defined(__EXTENSIONS__)
-extern int  getopt();
-extern char *optarg;
-extern int  opterr, optind, optopt;
-#if !defined(_XPG6) || defined(__EXTENSIONS__)
-extern char *getpass();
-#endif
-#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-#if !defined(_XPG6) || defined(__EXTENSIONS__)
-extern int getpagesize();
-#endif
-extern pid_t getpgid();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-extern pid_t getpid();
-extern pid_t getppid();
-extern pid_t getpgrp();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-char *gettxt();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern pid_t getsid();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
-extern uid_t getuid();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern char *getusershell();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern char *getwd();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int ioctl();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int isaexec();
-extern int issetugid();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern int isatty();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int lchown();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
-extern int link();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern offset_t llseek();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern int lockf();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-extern off_t lseek();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int mincore();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
-        defined(__EXTENSIONS__)
-extern int nice();
-#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
-extern long pathconf();
-extern int pause();
-extern int pipe();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern ssize_t pread();
-#endif
-#if !defined(_LP64) && \
-        (!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
-extern void profil();
-extern int ptrace();
-#endif
-#if !defined(__XOPEN_OR_POSIX) || \
-        ((_POSIX_C_SOURCE > 2) && !defined(_XPG6)) || \
-        defined(__EXTENSIONS__)
-extern int pthread_atfork();
-#endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ...  */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern ssize_t pwrite();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG5) */
-extern ssize_t read();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-/* per RFC 3542; This is also defined in netdb.h */
-extern int rcmd_af();
-#endif
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern ssize_t readlink();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3) && !defined(_XPG4))) || \
-        defined(__EXTENSIONS__)
-extern int rename();
-#endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int resolvepath();
-/* per RFC 3542; This is also defined in netdb.h */
-extern int rexec_af();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern int rmdir();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-/* per RFC 3542; This is also defined in netdb.h */
-extern int rresvport_af();
-#endif
-#if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
-        defined(__EXTENSIONS__)
-extern void *sbrk();
-#endif /* !defined(__XOPEN_OR_POSIX)|| (defined(_XPG4_2)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
-extern int setegid();
-extern int seteuid();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
-extern int setgid();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int setgroups();
-extern int sethostname();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern int setpgid();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern pid_t setpgrp();
-extern int setregid();
-extern int setreuid();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-extern pid_t setsid();
-extern int setuid();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern void setusershell();
-#endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
-extern unsigned sleep();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int stime();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-#if defined(_XPG4)
-/* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
-extern void swab();
-#endif /* defined(_XPG4) */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int symlink();
-extern void sync();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if defined(_XPG5)
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname sysconf __sysconf_xpg5
-extern long sysconf();
-#else /* __PRAGMA_REDEFINE_EXTNAME */
-extern long __sysconf_xpg5();
-#define sysconf __sysconf_xpg5
-#endif  /* __PRAGMA_REDEFINE_EXTNAME */
-#endif  /* defined(_XPG5) */
-extern pid_t tcgetpgrp();
-extern int tcsetpgrp();
-#if !defined(__XOPEN_OR_POSIX) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern off_t tell();
-#endif /* !defined(__XOPEN_OR_POSIX)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
-        (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
-        defined(__EXTENSIONS__)
-extern int truncate();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-extern char *ttyname();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern useconds_t ualarm();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-extern int unlink();
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern int usleep();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
-extern pid_t vfork();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern void vhangup();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-extern ssize_t write();
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern void yield();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-
-#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
-        defined(__EXTENSIONS__)
-        /* || defined(_XPG7) */
-extern int faccessat();
-extern int fchownat();
-extern int linkat();
-extern ssize_t readlinkat();
-extern int renameat();
-extern int symlinkat();
-extern int unlinkat();
-#endif  /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
-#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-extern int get_nprocs();
-extern int get_nprocs_conf();
-#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
-
-/* transitional large file interface versions */
-#if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
-            !defined(__PRAGMA_REDEFINE_EXTNAME))
-extern int ftruncate64();
-extern off64_t lseek64();
-extern ssize_t pread64();
-extern ssize_t pwrite64();
-extern off64_t tell64();
-extern int truncate64();
-extern int lockf64();
-#endif  /* _LARGEFILE64_SOURCE */
-
-#endif /* __STDC__ */
-
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 #pragma unknown_control_flow(vfork)
 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
 
 /*
  * getlogin_r() & ttyname_r() prototypes are defined here.

@@ -961,12 +643,10 @@
 
 #if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
         !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
         defined(_POSIX_PTHREAD_SEMANTICS)
 
-#if     defined(__STDC__)
-
 #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 
 #ifndef __USE_LEGACY_LOGNAME__
 #ifdef  __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname getlogin_r __posix_getloginx_r

@@ -1033,87 +713,10 @@
 
 extern char *ttyname_r(int, char *, int);
 
 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 
-#else  /* __STDC__ */
-
-#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
-
-#ifndef __USE_LEGACY_LOGNAME__
-#ifdef  __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname getlogin_r __posix_getloginx_r
-extern int getlogin_r();
-#else   /* __PRAGMA_REDEFINE_EXTNAME */
-extern int __posix_getloginx_r();
-#define getlogin_r      __posix_getloginx_r
-#endif  /* __PRAGMA_REDEFINE_EXTNAME */
-#else   /* __USE_LEGACY_LOGNAME__ */
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname getlogin_r __posix_getlogin_r
-extern int getlogin_r();
-#else  /* __PRAGMA_REDEFINE_EXTNAME */
-extern int __posix_getlogin_r();
-
-#ifdef  __lint
-
-#define getlogin_r      __posix_getlogin_r
-
-#else /* !__lint */
-
-static int
-getlogin_r(__name, __len)
-        char *__name;
-        int __len;
-{
-        return (__posix_getlogin_r(__name, __len));
-}
-#endif /* !__lint */
-#endif /* __PRAGMA_REDEFINE_EXTNAME */
-#endif  /* __USE_LEGACY_LOGNAME__ */
-
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname ttyname_r __posix_ttyname_r
-extern int ttyname_r();
-#else  /* __PRAGMA_REDEFINE_EXTNAME */
-
-extern int __posix_ttyname_r();
-
-#ifdef  __lint
-
-#define ttyname_r       __posix_ttyname_r
-
-#else /* !__lint */
-
-ttyname_r(__fildes, __buf, __size)
-        int __fildes;
-        char *__buf;
-        size_t __size;
-{
-        return (__posix_ttyname_r(__fildes, __buf, __size));
-}
-#endif /* !__lint */
-#endif /* __PRAGMA_REDEFINE_EXTNAME */
-
-#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
-#ifndef __USE_LEGACY_LOGNAME__
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname getlogin_r     getloginx_r
-#else   /* __PRAGMA_REDEFINE_EXTNAME */
-extern char *getloginx_r();
-#define getlogin_r      getloginx_r
-#endif  /* __PRAGMA_REDEFINE_EXTNAME */
-#endif  /* __USE_LEGACY_LOGNAME__ */
-extern char *getlogin_r();
-
-extern char *ttyname_r();
-
-#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
-#endif /* __STDC__ */
-
 #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
 
 #ifdef  __cplusplus
 }
 #endif