summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2013-11-22 21:32:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2013-11-22 21:32:50 +0000
commit28b12a9b2b60782a6f9cb5795aa4b175b022e6d4 (patch)
tree7280681857731a0ab5ef220e0c047ff56df5ad98 /include/stdlib.h
parentf45b9df3dc50eef15e5c5375152b0e8136d8e02b (diff)
The getopt() prototype and externs don't belong in stdlib.h. Berkeley
moved them to unistd.h to match POSIX in 1995 but we never did. The exception to this is getsubopt() which POSIX says should be in stdlib.h. The non-standard suboptarg extern remains in the BSD-only section of stdlib.h. Neither getsubopt() nor suboptarg belong in unistd.h or getopt.h. They were only there to allow us to protect all the getopt() bits from being multiply defined. OK guenther@
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index be7b137fd60..971388aadb1 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdlib.h,v 1.53 2013/10/21 20:33:24 deraadt Exp $ */
+/* $OpenBSD: stdlib.h,v 1.54 2013/11/22 21:32:49 millert Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@@ -248,6 +248,10 @@ int posix_openpt(int);
char *mkdtemp(char *);
#endif
+#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 20080
+int getsubopt(char **, char * const *, char **);
+#endif
+
#if __BSD_VISIBLE
void *alloca(size_t);
@@ -274,14 +278,7 @@ const char *
getprogname(void);
void setprogname(const char *);
-#ifndef _GETOPT_DEFINED_
-#define _GETOPT_DEFINED_
-int getopt(int, char * const *, const char *);
-extern char *optarg; /* getopt(3) external variables */
-extern int opterr, optind, optopt, optreset;
-int getsubopt(char **, char * const *, char **);
extern char *suboptarg; /* getsubopt(3) external variable */
-#endif /* _GETOPT_DEFINED_ */
int mkstemps(char *, int);