From 41cfadd63c6d28400f263460e3f2b15e74893b63 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 30 Sep 1995 17:10:48 +0000 Subject: Sat Sep 30 11:47:05 1995 Roland McGrath * posix/tstgetopt.c, posix/tstgetopt.args: Test long options too. * sysdeps/unix/sysv/linux/i386/init-first.c (init): Save, set, and restore %ebx by hand for personality syscall. GCC cannot deal with spilling the dedicated GOT register. * misc/Makefile (routines): Add mntent, which was somehow omitted. Fri Sep 29 15:07:10 1995 Ulrich Drepper * sysdeps/unix/sysv/linux/adjtime.c (__adjtime): Change name of field `mode' in `struct timex' to `modes'. Linux-1.3.28 updates this name according to RFC 1489. --- ChangeLog | 16 ++++++++ intl/Makefile | 22 ++++++++++- misc/Makefile | 6 +-- posix/tstgetopt.args | 3 +- posix/tstgetopt.c | 64 +++++++++++++++++++------------ sys/ipc.h | 1 + sys/msg.h | 1 + sys/sem.h | 1 + sys/shm.h | 1 + sysdeps/unix/sysv/linux/Implies | 6 +-- sysdeps/unix/sysv/linux/adjtime.c | 4 +- sysdeps/unix/sysv/linux/i386/init-first.c | 14 +++++-- 12 files changed, 102 insertions(+), 37 deletions(-) create mode 100644 sys/ipc.h create mode 100644 sys/msg.h create mode 100644 sys/sem.h create mode 100644 sys/shm.h diff --git a/ChangeLog b/ChangeLog index 10911a9c43..406263271e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Sat Sep 30 11:47:05 1995 Roland McGrath + + * posix/tstgetopt.c, posix/tstgetopt.args: Test long options too. + + * sysdeps/unix/sysv/linux/i386/init-first.c (init): Save, set, and + restore %ebx by hand for personality syscall. + GCC cannot deal with spilling the dedicated GOT register. + + * misc/Makefile (routines): Add mntent, which was somehow omitted. + +Fri Sep 29 15:07:10 1995 Ulrich Drepper + + * sysdeps/unix/sysv/linux/adjtime.c (__adjtime): + Change name of field `mode' in `struct timex' to `modes'. + Linux-1.3.28 updates this name according to RFC 1489. + Thu Sep 28 13:05:54 1995 Roland McGrath Merge new message handling code from GNU gettext, by Drepper. diff --git a/intl/Makefile b/intl/Makefile index 544daae8a2..f7ef998fca 100644 --- a/intl/Makefile +++ b/intl/Makefile @@ -1,7 +1,27 @@ +# Makefile for intl subdirectory: message handling code from GNU gettext. + +# Copyright (C) 1995 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. + +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If +# not, write to the Free Software Foundation, Inc., 675 Mass Ave, +# Cambridge, MA 02139, USA. + subdir = intl routines = bindtextdom dcgettext dgettext gettext \ finddomain loadmsgcat localealias textdomain -distribute = gettext.h gettextP.h hash-string.h libgettext.h +distribute = gettext.h gettextP.h hash-string.h include ../Rules diff --git a/misc/Makefile b/misc/Makefile index 213ca9fbfd..173413c9ed 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -25,7 +25,7 @@ subdir := misc headers := sys/uio.h sys/ioctl.h sys/ptrace.h ioctls.h sys/file.h \ a.out.h nlist.h stab.h stab.def sgtty.h sys/dir.h sys/cdefs.h \ ttyent.h syscall.h syslog.h sys/syslog.h paths.h sys/reboot.h \ - sys/mman.h sys/param.h fstab.h search.h utmp.h + sys/mman.h sys/param.h fstab.h mntent.h search.h utmp.h routines := brk sbrk sstk ioctl \ readv writev \ @@ -41,8 +41,8 @@ routines := brk sbrk sstk ioctl \ swapon mktemp mkstemp \ ualarm usleep \ gtty stty \ - ptrace \ - nlist fstab \ + ptrace nlist \ + fstab mntent \ utimes \ truncate ftruncate \ chflags fchflags \ diff --git a/posix/tstgetopt.args b/posix/tstgetopt.args index 023e102a24..c82c86560e 100644 --- a/posix/tstgetopt.args +++ b/posix/tstgetopt.args @@ -1 +1,2 @@ --a -b -cfoobar +-a -b -cfoobar --required foobar --optional=bazbug --none random + diff --git a/posix/tstgetopt.c b/posix/tstgetopt.c index fd2d4d0469..2258b20770 100644 --- a/posix/tstgetopt.c +++ b/posix/tstgetopt.c @@ -1,41 +1,57 @@ -#include #include #include +#include -int main (int argc, char **argv) +int +main (int argc, char **argv) { + static const struct option options[] = + { + {"required", required_argument, NULL, 'r'}, + {"optional", optional_argument, NULL, 'o'}, + {"none", no_argument, NULL, 'n'} + }; + int aflag = 0; int bflag = 0; char *cvalue = NULL; int index; int c; - while ((c = getopt (argc, argv, "abc:")) >= 0) - switch (c) { - case 'a': - aflag = 1; - break; - case 'b': - bflag = 1; - break; - case 'c': - cvalue = optarg; - break; - case '?': -#if 0 - fprintf (stderr, "Unknown option %c.\n", optopt); -#else - fputs ("Unknown option.\n", stderr); -#endif - return -1; - default: - fprintf (stderr, "This should never happen!\n"); - return -1; - } + while ((c = getopt_long (argc, argv, "abc:", options, NULL)) >= 0) + switch (c) + { + case 'a': + aflag = 1; + break; + case 'b': + bflag = 1; + break; + case 'c': + cvalue = optarg; + break; + case '?': + fputs ("Unknown option.\n", stderr); + return 1; + default: + fprintf (stderr, "This should never happen!\n"); + return 1; + + case 'r': + printf ("--required %s\n", optarg); + break; + case 'o': + printf ("--optional %s\n", optarg); + break; + case 'n': + puts ("--none"); + break; + } printf ("aflag = %d, bflag = %d, cvalue = %s\n", aflag, bflag, cvalue); for (index = optind; index < argc; index++) printf ("Non-option argument %s\n", argv[index]); + return 0; } diff --git a/sys/ipc.h b/sys/ipc.h new file mode 100644 index 0000000000..7bd257684b --- /dev/null +++ b/sys/ipc.h @@ -0,0 +1 @@ +#include diff --git a/sys/msg.h b/sys/msg.h new file mode 100644 index 0000000000..0f8026dda1 --- /dev/null +++ b/sys/msg.h @@ -0,0 +1 @@ +#include diff --git a/sys/sem.h b/sys/sem.h new file mode 100644 index 0000000000..b0fb201bd0 --- /dev/null +++ b/sys/sem.h @@ -0,0 +1 @@ +#include diff --git a/sys/shm.h b/sys/shm.h new file mode 100644 index 0000000000..1878fcc5be --- /dev/null +++ b/sys/shm.h @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/sysv/linux/Implies b/sysdeps/unix/sysv/linux/Implies index 3f43b3ea82..41c26f20f9 100644 --- a/sysdeps/unix/sysv/linux/Implies +++ b/sysdeps/unix/sysv/linux/Implies @@ -1,9 +1,9 @@ # Linux shares most of the syscalls which are also common to BSD and SVR4. unix/common -# Linux has not yet (as of 1.3.18) the canonical set of -# system calls. msync() and madvice() are missing, so their stubs -# are found here. I think later version will have them ones. +# Linux as of version 1.3.29 has all functions of the mmap family +# which are described in POSIX.4. Missing is only madvise() so +# we define a stub here. unix/mman # Linux has network support in the kernel. diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c index 3673cd9164..8400e1b907 100644 --- a/sysdeps/unix/sysv/linux/adjtime.c +++ b/sysdeps/unix/sysv/linux/adjtime.c @@ -43,10 +43,10 @@ __adjtime (itv, otv) return -1; } tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L; - tntx.mode = ADJ_OFFSET_SINGLESHOT; + tntx.modes = ADJ_OFFSET_SINGLESHOT; } else - tntx.mode = 0; + tntx.modes = 0; if (__adjtimex (&tntx) < 0) return -1; diff --git a/sysdeps/unix/sysv/linux/i386/init-first.c b/sysdeps/unix/sysv/linux/i386/init-first.c index 0177daae24..84b5ff9f2c 100644 --- a/sysdeps/unix/sysv/linux/i386/init-first.c +++ b/sysdeps/unix/sysv/linux/i386/init-first.c @@ -18,6 +18,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include #include "fpu_control.h" extern void __libc_init (int, char **, char **); @@ -31,9 +32,16 @@ init (int *data) char **argv = (void *) (data + 1); char **envp = &argv[argc + 1]; - /* Make sure we are not using iBSC2 personality. */ - asm ("int $0x80 # syscall no %0, arg %1" - : : "a" (SYS_ify (personality)), "b" (0)); + /* Make sure we are not using the iBSC2 personality. The `personality' + syscall takes one argument; zero means the Linux personality. The + argument arrives in %ebx; we have to save and restore %ebx by hand + here, because GCC (as of 2.7.0) cannot handle saving and restoring it + for us when it is the dedicated GOT register for PIC. */ + asm ("pushl %%ebx\n" + "xorl %%ebx, %%ebx\n" + "int $0x80 # syscall no %0\n" + "popl %%ebx" + : : "a" (SYS_ify (personality))); /* Set the FPU control word to the proper default value. */ __setfpucw (___fpu_control); -- cgit v1.2.3