aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-03-27 10:00:09 +0000
committerRoland McGrath <roland@gnu.org>1995-03-27 10:00:09 +0000
commit1474b80f017c2fcc18b1de5bbc51884650d30582 (patch)
tree1baa3c89ef3802cda051fa7f8f9c9bb8c0bf6abd /posix
parentd365fd2cfa4248fcce18fc60d3d90598aa1f534b (diff)
downloadglibc-1474b80f017c2fcc18b1de5bbc51884650d30582.zip
glibc-1474b80f017c2fcc18b1de5bbc51884650d30582.tar.gz
glibc-1474b80f017c2fcc18b1de5bbc51884650d30582.tar.bz2
Mon Mar 27 02:23:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* posix/unistd.h [__USE_BSD] (ttyslot): Declare it. * posix/unistd.h [__USE_BSD] (L_SET, L_INCR, L_XTND): Define unless L_SET already defined. * misc/sys/file.h (L_SET, L_INCR, L_XTND): Don't define if L_SET already defined. Incorporated -lutil library from 4.4-Lite. * misc/Makefile (extra-libs, libutil-routines): New variables. * misc/login.c, misc/login_tty.c, misc/logout.c, misc/logwtmp.c, sysdeps/generic/pty.c: New files for -lutil incorporated from 4.4-Lite. Support simple, light-weight unwind-protect mechanism for longjmp. * setjmp/longjmp.c: Call _longjmp_unwind first thing. * sysdeps/mach/hurd/jmp-unwind.c: New file. * sysdeps/stub/jmp-unwind.c: New file. * sysdeps/i386/jmp_buf.h (_JMPBUF_UNWINDS): New macro. * sysdeps/mips/jmp_buf.h (_JMPBUF_UNWINDS): New macro. * setjmp/Makefile (routines): Add jmp-unwind. * hurd/hurd/userlink.h (struct hurd_userlink): Move `next' and `prevp' members into new substructure `resource'; add another such substructure `thread' and members `cleanup' (function ptr) and `cleanup_data' (generic ptr). (_hurd_userlink_link, _hurd_userlink_unlink): Insert/remove LINK into the `_hurd_self_sigstate ()->active_resources' list via the `thread' substructure. * hurd/hurd/port.h (_hurd_port_cleanup): Declare it. (_hurd_port_locked_get): Set LINK->cleanup to _hurd_port_cleanup and LINK->cleanup_data' to the port extracted. * hurd/hurd/signal.h (struct hurd_sigstate): New member `active_resources'. * hurd/port-cleanup.c: New file. * hurd/Makefile (routines): Add port-cleanup. * malloc/malloc.c: Include errno.h. Sat Mar 25 18:24:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * locale/loadlocale.c (_nl_load_locale): Avoid */ inside comment.
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 7fef53a..85647e2 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 f0254b4..4468541 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));