From a882841baf42e6a8b74cc33a239b84a9a79493db Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 30 Aug 2019 17:48:47 -0400 Subject: [PATCH] add public declaration for optreset under appropriate feature profiles commit 030e52639248ac8417a4934298caa78c21a228d1 added optreset, a BSD extension to getopt duplicating the functionality (also an extension) of setting optind to 0, but failed to provide a public declaration for it. according to the BSD documentation and headers, the application is not supposed to need to provide its own declaration. --- include/unistd.h | 1 + src/misc/getopt.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/unistd.h b/include/unistd.h index b9b23a16..7bcbff94 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -176,6 +176,7 @@ long syscall(long, ...); int execvpe(const char *, char *const [], char *const []); int issetugid(void); int getentropy(void *, size_t); +extern int optreset; #endif #ifdef _GNU_SOURCE diff --git a/src/misc/getopt.c b/src/misc/getopt.c index 864d52cd..c3f66995 100644 --- a/src/misc/getopt.c +++ b/src/misc/getopt.c @@ -1,3 +1,4 @@ +#define _BSD_SOURCE #include #include #include -- 2.25.1