about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/getopt.c7
-rw-r--r--posix/unistd.h14
2 files changed, 19 insertions, 2 deletions
diff --git a/posix/getopt.c b/posix/getopt.c
index 7fef53a0b3..85647e2d36 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -3,7 +3,7 @@
    "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
    before changing it!
 
-   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
    	Free Software Foundation, Inc.
 
 This file is part of the GNU C Library.  Its master source is NOT part of
@@ -387,7 +387,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
   optarg = NULL;
 
   if (optind == 0)
-    optstring = _getopt_initialize (optstring);
+    {
+      optstring = _getopt_initialize (optstring);
+      optind = 1;		/* Don't scan ARGV[0], the program name.  */
+    }
 
   if (nextchar == NULL || *nextchar == '\0')
     {
diff --git a/posix/unistd.h b/posix/unistd.h
index f0254b44bc..4468541e3a 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -125,6 +125,14 @@ extern int euidaccess __P ((__const char *__name, int __type));
 #define	SEEK_END	2	/* Seek from end of file.  */
 #endif
 
+#if defined (__USE_BSD) && !defined (L_SET)
+/* Old BSD names for the same constants; just for compatibility.  */
+#define	L_SET		SEEK_SET
+#define	L_INCR		SEEK_CUR
+#define	L_XTND		SEEK_END
+#endif
+
+
 /* Move FD's file position to OFFSET bytes from the
    beginning of the file (if WHENCE is SEEK_SET),
    the current position (if WHENCE is SEEK_CUR),
@@ -417,6 +425,12 @@ extern char *ttyname __P ((int __fd));
 extern int __isatty __P ((int __fd));
 extern int isatty __P ((int __fd));
 
+#ifdef __USE_BSD
+/* Return the index into the active-logins file (utmp) for
+   the terminal FD is open on.  */
+extern int ttyslot ((int __fd));
+#endif
+
 
 /* Make a link to FROM named TO.  */
 extern int __link __P ((__const char *__from, __const char *__to));