POSIX introduced optreset to deal with multiple invocations

of getopt (as in, multiple input lines :). This is documented in the
man page and is used in the code, but unistd.h and stand.h do not
declare it. Incidentally, it prevents me fixing a bug in loader's
code... :-)

PR:		misc/9373
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
This commit is contained in:
Mike Smith 1999-01-11 06:01:29 +00:00
parent ba536e2ae8
commit a79658408c
2 changed files with 3 additions and 2 deletions

View File

@ -199,6 +199,7 @@ int usleep __P((unsigned int));
void *valloc __P((size_t)); /* obsoleted by malloc() */
pid_t vfork __P((void));
extern optreset; /* getopt(3) external variable */
extern char *suboptarg; /* getsubopt(3) external variable */
int getsubopt __P((char **, char * const *, char **));
#endif /* !_POSIX_SOURCE */

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: stand.h,v 1.11 1998/11/04 07:04:00 msmith Exp $
* $Id: stand.h,v 1.12 1998/11/04 07:39:53 msmith Exp $
* From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $
*/
@ -220,7 +220,7 @@ extern u_long random(void);
extern long strtol(const char *, char **, int);
extern char * strerror(int err);
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
extern int optind, opterr, optopt, optreset;
extern int getopt(int, char * const [], const char *);
/* pager.c */