[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r17387 - in /fsf/trunk/libc: ./ include/sys/ manual/ manual/examples/ math/ stdlib/ sysdeps/i386/i486/bits/ sysdeps/sparc/sp...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r17387 - in /fsf/trunk/libc: ./ include/sys/ manual/ manual/examples/ math/ stdlib/ sysdeps/i386/i486/bits/ sysdeps/sparc/sp...
- From: eglibc@xxxxxxxxxx
- Date: Sun, 04 Mar 2012 00:01:58 -0000
Author: eglibc
Date: Sun Mar 4 00:01:57 2012
New Revision: 17387
Log:
Import glibc-mainline for 2012-03-04
Added:
fsf/trunk/libc/manual/examples/README
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S
fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S
fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S
fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/include/sys/cdefs.h
fsf/trunk/libc/manual/Makefile
fsf/trunk/libc/manual/examples/add.c
fsf/trunk/libc/manual/examples/argp-ex1.c
fsf/trunk/libc/manual/examples/argp-ex2.c
fsf/trunk/libc/manual/examples/argp-ex3.c
fsf/trunk/libc/manual/examples/argp-ex4.c
fsf/trunk/libc/manual/examples/atexit.c
fsf/trunk/libc/manual/examples/db.c
fsf/trunk/libc/manual/examples/dir.c
fsf/trunk/libc/manual/examples/dir2.c
fsf/trunk/libc/manual/examples/execinfo.c
fsf/trunk/libc/manual/examples/filecli.c
fsf/trunk/libc/manual/examples/filesrv.c
fsf/trunk/libc/manual/examples/fmtmsgexpl.c
fsf/trunk/libc/manual/examples/genpass.c
fsf/trunk/libc/manual/examples/inetcli.c
fsf/trunk/libc/manual/examples/inetsrv.c
fsf/trunk/libc/manual/examples/isockad.c
fsf/trunk/libc/manual/examples/longopt.c
fsf/trunk/libc/manual/examples/memopen.c
fsf/trunk/libc/manual/examples/memstrm.c
fsf/trunk/libc/manual/examples/mkfsock.c
fsf/trunk/libc/manual/examples/mkisock.c
fsf/trunk/libc/manual/examples/mygetpass.c
fsf/trunk/libc/manual/examples/pipe.c
fsf/trunk/libc/manual/examples/popen.c
fsf/trunk/libc/manual/examples/rprintf.c
fsf/trunk/libc/manual/examples/search.c
fsf/trunk/libc/manual/examples/select.c
fsf/trunk/libc/manual/examples/setjmp.c
fsf/trunk/libc/manual/examples/sigh1.c
fsf/trunk/libc/manual/examples/sigusr.c
fsf/trunk/libc/manual/examples/stpcpy.c
fsf/trunk/libc/manual/examples/strdupa.c
fsf/trunk/libc/manual/examples/strftim.c
fsf/trunk/libc/manual/examples/strncat.c
fsf/trunk/libc/manual/examples/subopt.c
fsf/trunk/libc/manual/examples/swapcontext.c
fsf/trunk/libc/manual/examples/termios.c
fsf/trunk/libc/manual/examples/testopt.c
fsf/trunk/libc/manual/examples/testpass.c
fsf/trunk/libc/manual/examples/timeval_subtract.c
fsf/trunk/libc/math/math_private.h
fsf/trunk/libc/stdlib/tst-strtod.c
fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h
fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Mar 4 00:01:57 2012
@@ -1,4 +1,70 @@
+2012-03-03 Marek Polacek <polacek@xxxxxxxxxx>
+
+ * include/sys/cdefs.h: Remove __GNUC_PREREQ macro.
+ * math/math_private.h: Likewise.
+ * stdlib/tst-strtod.c: Likewise.
+ * sysdeps/i386/i486/bits/atomic.h: Likewise.
+ * sysdeps/x86_64/bits/atomic.h: Likewise.
+
+2012-03-02 David S. Miller <davem@xxxxxxxxxxxxx>
+
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S: New file.
+ * sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_llrint.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_llrintf.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_lrint.S: New file.
+ * sysdeps/sparc/sparc64/fpu/s_lrintf.S: New file.
+
2012-03-02 Roland McGrath <roland@xxxxxxxxxxxxx>
+
+ [BZ #13792]
+ * manual/examples/README: New file, says the example source files
+ can be used under GPL>=2.
+ * manual/Makefile (%.c.texi): Eat the leading part of the file until a
+ line containing just "*/".
+ * manual/examples/add.c: Add copyright header (GPL>=2).
+ * manual/examples/argp-ex1.c: Likewise.
+ * manual/examples/argp-ex2.c: Likewise.
+ * manual/examples/argp-ex3.c: Likewise.
+ * manual/examples/argp-ex4.c: Likewise.
+ * manual/examples/atexit.c: Likewise.
+ * manual/examples/db.c: Likewise.
+ * manual/examples/dir.c: Likewise.
+ * manual/examples/dir2.c: Likewise.
+ * manual/examples/execinfo.c: Likewise.
+ * manual/examples/filecli.c: Likewise.
+ * manual/examples/filesrv.c: Likewise.
+ * manual/examples/fmtmsgexpl.c: Likewise.
+ * manual/examples/genpass.c: Likewise.
+ * manual/examples/inetcli.c: Likewise.
+ * manual/examples/inetsrv.c: Likewise.
+ * manual/examples/isockad.c: Likewise.
+ * manual/examples/longopt.c: Likewise.
+ * manual/examples/memopen.c: Likewise.
+ * manual/examples/memstrm.c: Likewise.
+ * manual/examples/mkfsock.c: Likewise.
+ * manual/examples/mkisock.c: Likewise.
+ * manual/examples/mygetpass.c: Likewise.
+ * manual/examples/pipe.c: Likewise.
+ * manual/examples/popen.c: Likewise.
+ * manual/examples/rprintf.c: Likewise.
+ * manual/examples/search.c: Likewise.
+ * manual/examples/select.c: Likewise.
+ * manual/examples/setjmp.c: Likewise.
+ * manual/examples/sigh1.c: Likewise.
+ * manual/examples/sigusr.c: Likewise.
+ * manual/examples/stpcpy.c: Likewise.
+ * manual/examples/strdupa.c: Likewise.
+ * manual/examples/strftim.c: Likewise.
+ * manual/examples/strncat.c: Likewise.
+ * manual/examples/subopt.c: Likewise.
+ * manual/examples/swapcontext.c: Likewise.
+ * manual/examples/termios.c: Likewise.
+ * manual/examples/testopt.c: Likewise.
+ * manual/examples/testpass.c: Likewise.
+ * manual/examples/timeval_subtract.c: Likewise.
[BZ #13792]
* manual/time.texi (Elapsed Time): Move timeval_subtract example
Modified: fsf/trunk/libc/include/sys/cdefs.h
==============================================================================
--- fsf/trunk/libc/include/sys/cdefs.h (original)
+++ fsf/trunk/libc/include/sys/cdefs.h Sun Mar 4 00:01:57 2012
@@ -14,11 +14,7 @@
rtld_hidden_proto (__chk_fail)
-# if __GNUC_PREREQ (4,3)
-# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
-# else
-# define __attribute_alloc_size(...)
-# endif
+# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
#endif
#endif
Modified: fsf/trunk/libc/manual/Makefile
==============================================================================
--- fsf/trunk/libc/manual/Makefile (original)
+++ fsf/trunk/libc/manual/Makefile Sun Mar 4 00:01:57 2012
@@ -122,7 +122,8 @@
# Generate Texinfo files from the C source for the example programs.
%.c.texi: examples/%.c
- sed -e 's,[{}],@&,g' \
+ sed -e '1,/^\*\/$$/d' \
+ -e 's,[{}],@&,g' \
-e 's,/\*\(@.*\)\*/,\1,g' \
-e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \
-e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\
Added: fsf/trunk/libc/manual/examples/README
==============================================================================
--- fsf/trunk/libc/manual/examples/README (added)
+++ fsf/trunk/libc/manual/examples/README Sun Mar 4 00:01:57 2012
@@ -1,0 +1,8 @@
+These are source files for example code that appears in The GNU C
+Library Reference Manual.
+
+While the manual itself is licensed under the terms of the GNU Free
+Documentation License, you can use these source files on their own
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License, or (at your
+option) any later version.
Modified: fsf/trunk/libc/manual/examples/add.c
==============================================================================
--- fsf/trunk/libc/manual/examples/add.c (original)
+++ fsf/trunk/libc/manual/examples/add.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Example of a Variadic Function
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdarg.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/argp-ex1.c
==============================================================================
--- fsf/trunk/libc/manual/examples/argp-ex1.c (original)
+++ fsf/trunk/libc/manual/examples/argp-ex1.c Sun Mar 4 00:01:57 2012
@@ -1,4 +1,19 @@
-/* Argp example #1 -- a minimal program using argp */
+/* Argp example #1 -- a minimal program using argp
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
/* This is (probably) the smallest possible program that
uses argp. It won't do much except give an error
Modified: fsf/trunk/libc/manual/examples/argp-ex2.c
==============================================================================
--- fsf/trunk/libc/manual/examples/argp-ex2.c (original)
+++ fsf/trunk/libc/manual/examples/argp-ex2.c Sun Mar 4 00:01:57 2012
@@ -1,4 +1,19 @@
-/* Argp example #2 -- a pretty minimal program using argp */
+/* Argp example #2 -- a pretty minimal program using argp
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
/* This program doesn't use any options or arguments, but uses
argp to be compliant with the GNU standard command line
Modified: fsf/trunk/libc/manual/examples/argp-ex3.c
==============================================================================
--- fsf/trunk/libc/manual/examples/argp-ex3.c (original)
+++ fsf/trunk/libc/manual/examples/argp-ex3.c Sun Mar 4 00:01:57 2012
@@ -1,4 +1,19 @@
-/* Argp example #3 -- a program with options and arguments using argp */
+/* Argp example #3 -- a program with options and arguments using argp
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
/* This program uses the same features as example 2, and uses options and
arguments.
Modified: fsf/trunk/libc/manual/examples/argp-ex4.c
==============================================================================
--- fsf/trunk/libc/manual/examples/argp-ex4.c (original)
+++ fsf/trunk/libc/manual/examples/argp-ex4.c Sun Mar 4 00:01:57 2012
@@ -1,4 +1,19 @@
-/* Argp example #4 -- a program with somewhat more complicated options */
+/* Argp example #4 -- a program with somewhat more complicated options
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
/* This program uses the same features as example 3, but has more
options, and somewhat more structure in the -help output. It
Modified: fsf/trunk/libc/manual/examples/atexit.c
==============================================================================
--- fsf/trunk/libc/manual/examples/atexit.c (original)
+++ fsf/trunk/libc/manual/examples/atexit.c Sun Mar 4 00:01:57 2012
@@ -1,7 +1,24 @@
+/* Cleanups on Exit
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
-void
+void
bye (void)
{
puts ("Goodbye, cruel world....");
Modified: fsf/trunk/libc/manual/examples/db.c
==============================================================================
--- fsf/trunk/libc/manual/examples/db.c (original)
+++ fsf/trunk/libc/manual/examples/db.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* User and Group Database Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <grp.h>
#include <pwd.h>
#include <sys/types.h>
Modified: fsf/trunk/libc/manual/examples/dir.c
==============================================================================
--- fsf/trunk/libc/manual/examples/dir.c (original)
+++ fsf/trunk/libc/manual/examples/dir.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Simple Program to List a Directory
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/*@group*/
#include <stdio.h>
#include <sys/types.h>
Modified: fsf/trunk/libc/manual/examples/dir2.c
==============================================================================
--- fsf/trunk/libc/manual/examples/dir2.c (original)
+++ fsf/trunk/libc/manual/examples/dir2.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Simple Program to List a Directory, Mark II
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/*@group*/
#include <stdio.h>
#include <dirent.h>
Modified: fsf/trunk/libc/manual/examples/execinfo.c
==============================================================================
--- fsf/trunk/libc/manual/examples/execinfo.c (original)
+++ fsf/trunk/libc/manual/examples/execinfo.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Obtain a backtrace and print it.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
Modified: fsf/trunk/libc/manual/examples/filecli.c
==============================================================================
--- fsf/trunk/libc/manual/examples/filecli.c (original)
+++ fsf/trunk/libc/manual/examples/filecli.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Example of Reading Datagrams
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
Modified: fsf/trunk/libc/manual/examples/filesrv.c
==============================================================================
--- fsf/trunk/libc/manual/examples/filesrv.c (original)
+++ fsf/trunk/libc/manual/examples/filesrv.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Datagram Socket Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
Modified: fsf/trunk/libc/manual/examples/fmtmsgexpl.c
==============================================================================
--- fsf/trunk/libc/manual/examples/fmtmsgexpl.c (original)
+++ fsf/trunk/libc/manual/examples/fmtmsgexpl.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* How to use fmtmsg and addseverity.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <fmtmsg.h>
int
Modified: fsf/trunk/libc/manual/examples/genpass.c
==============================================================================
--- fsf/trunk/libc/manual/examples/genpass.c (original)
+++ fsf/trunk/libc/manual/examples/genpass.c Sun Mar 4 00:01:57 2012
@@ -1,31 +1,48 @@
+/* Encrypting Passwords
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <crypt.h>
-int
+int
main(void)
{
unsigned long seed[2];
char salt[] = "$1$........";
- const char *const seedchars =
+ const char *const seedchars =
"./0123456789ABCDEFGHIJKLMNOPQRST"
"UVWXYZabcdefghijklmnopqrstuvwxyz";
char *password;
int i;
-
- /* Generate a (not very) random seed.
+
+ /* Generate a (not very) random seed.
You should do it better than this... */
seed[0] = time(NULL);
seed[1] = getpid() ^ (seed[0] >> 14 & 0x30000);
-
+
/* Turn it into printable characters from `seedchars'. */
for (i = 0; i < 8; i++)
salt[3+i] = seedchars[(seed[i/5] >> (i%5)*6) & 0x3f];
-
+
/* Read in the user's password and encrypt it. */
password = crypt(getpass("Password:"), salt);
-
+
/* Print the results. */
puts(password);
return 0;
Modified: fsf/trunk/libc/manual/examples/inetcli.c
==============================================================================
--- fsf/trunk/libc/manual/examples/inetcli.c (original)
+++ fsf/trunk/libc/manual/examples/inetcli.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Byte Stream Socket Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
@@ -11,7 +28,7 @@
#define MESSAGE "Yow!!! Are we having fun yet?!?"
#define SERVERHOST "mescaline.gnu.org"
-void
+void
write_to_server (int filedes)
{
int nbytes;
Modified: fsf/trunk/libc/manual/examples/inetsrv.c
==============================================================================
--- fsf/trunk/libc/manual/examples/inetsrv.c (original)
+++ fsf/trunk/libc/manual/examples/inetsrv.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Byte Stream Connection Server Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
Modified: fsf/trunk/libc/manual/examples/isockad.c
==============================================================================
--- fsf/trunk/libc/manual/examples/isockad.c (original)
+++ fsf/trunk/libc/manual/examples/isockad.c Sun Mar 4 00:01:57 2012
@@ -1,10 +1,27 @@
+/* Internet Socket Example using sockaddr_in.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
-void
+void
init_sockaddr (struct sockaddr_in *name,
const char *hostname,
uint16_t port)
@@ -14,7 +31,7 @@
name->sin_family = AF_INET;
name->sin_port = htons (port);
hostinfo = gethostbyname (hostname);
- if (hostinfo == NULL)
+ if (hostinfo == NULL)
{
fprintf (stderr, "Unknown host %s.\n", hostname);
exit (EXIT_FAILURE);
Modified: fsf/trunk/libc/manual/examples/longopt.c
==============================================================================
--- fsf/trunk/libc/manual/examples/longopt.c (original)
+++ fsf/trunk/libc/manual/examples/longopt.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Example of Parsing Long Options with getopt_long.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
Modified: fsf/trunk/libc/manual/examples/memopen.c
==============================================================================
--- fsf/trunk/libc/manual/examples/memopen.c (original)
+++ fsf/trunk/libc/manual/examples/memopen.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* String Streams
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
static char buffer[] = "foobar";
Modified: fsf/trunk/libc/manual/examples/memstrm.c
==============================================================================
--- fsf/trunk/libc/manual/examples/memstrm.c (original)
+++ fsf/trunk/libc/manual/examples/memstrm.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* open_memstream example.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
int
Modified: fsf/trunk/libc/manual/examples/mkfsock.c
==============================================================================
--- fsf/trunk/libc/manual/examples/mkfsock.c (original)
+++ fsf/trunk/libc/manual/examples/mkfsock.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Example of Local-Namespace Sockets
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stddef.h>
#include <stdio.h>
#include <errno.h>
Modified: fsf/trunk/libc/manual/examples/mkisock.c
==============================================================================
--- fsf/trunk/libc/manual/examples/mkisock.c (original)
+++ fsf/trunk/libc/manual/examples/mkisock.c Sun Mar 4 00:01:57 2012
@@ -1,9 +1,26 @@
+/* Internet Socket Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
-int
+int
make_socket (uint16_t port)
{
int sock;
Modified: fsf/trunk/libc/manual/examples/mygetpass.c
==============================================================================
--- fsf/trunk/libc/manual/examples/mygetpass.c (original)
+++ fsf/trunk/libc/manual/examples/mygetpass.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Reading Passwords
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <termios.h>
#include <stdio.h>
@@ -14,12 +31,12 @@
new.c_lflag &= ~ECHO;
if (tcsetattr (fileno (stream), TCSAFLUSH, &new) != 0)
return -1;
-
+
/* Read the password. */
nread = getline (lineptr, n, stream);
/* Restore terminal. */
(void) tcsetattr (fileno (stream), TCSAFLUSH, &old);
-
+
return nread;
}
Modified: fsf/trunk/libc/manual/examples/pipe.c
==============================================================================
--- fsf/trunk/libc/manual/examples/pipe.c (original)
+++ fsf/trunk/libc/manual/examples/pipe.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Creating a Pipe
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/popen.c
==============================================================================
--- fsf/trunk/libc/manual/examples/popen.c (original)
+++ fsf/trunk/libc/manual/examples/popen.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Pipe to a Subprocess
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
Modified: fsf/trunk/libc/manual/examples/rprintf.c
==============================================================================
--- fsf/trunk/libc/manual/examples/rprintf.c (original)
+++ fsf/trunk/libc/manual/examples/rprintf.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Printf Extension Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <printf.h>
Modified: fsf/trunk/libc/manual/examples/search.c
==============================================================================
--- fsf/trunk/libc/manual/examples/search.c (original)
+++ fsf/trunk/libc/manual/examples/search.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Searching and Sorting Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -35,7 +52,7 @@
/* This is the comparison function used for sorting and searching. */
-int
+int
critter_cmp (const struct critter *c1, const struct critter *c2)
{
return strcmp (c1->name, c2->name);
@@ -44,7 +61,7 @@
/* Print information about a critter. */
-void
+void
print_critter (const struct critter *c)
{
printf ("%s, the %s\n", c->name, c->species);
@@ -54,7 +71,7 @@
/*@group*/
/* Do the lookup into the sorted array. */
-void
+void
find_critter (const char *name)
{
struct critter target, *result;
Modified: fsf/trunk/libc/manual/examples/select.c
==============================================================================
--- fsf/trunk/libc/manual/examples/select.c (original)
+++ fsf/trunk/libc/manual/examples/select.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Waiting for Input or Output
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/*@group*/
#include <errno.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/setjmp.c
==============================================================================
--- fsf/trunk/libc/manual/examples/setjmp.c (original)
+++ fsf/trunk/libc/manual/examples/setjmp.c Sun Mar 4 00:01:57 2012
@@ -1,10 +1,27 @@
+/* Introduction to Non-Local Exits
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <setjmp.h>
#include <stdlib.h>
#include <stdio.h>
jmp_buf main_loop;
-void
+void
abort_to_main_loop (int status)
{
longjmp (main_loop, status);
@@ -21,7 +38,7 @@
}
-void
+void
do_command (void)
{
char buffer[128];
Modified: fsf/trunk/libc/manual/examples/sigh1.c
==============================================================================
--- fsf/trunk/libc/manual/examples/sigh1.c (original)
+++ fsf/trunk/libc/manual/examples/sigh1.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Signal Handlers that Return
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -6,14 +23,14 @@
volatile sig_atomic_t keep_going = 1;
/* The signal handler just clears the flag and re-enables itself. */
-void
+void
catch_alarm (int sig)
{
keep_going = 0;
signal (sig, catch_alarm);
}
-void
+void
do_stuff (void)
{
puts ("Doing stuff while waiting for alarm....");
Modified: fsf/trunk/libc/manual/examples/sigusr.c
==============================================================================
--- fsf/trunk/libc/manual/examples/sigusr.c (original)
+++ fsf/trunk/libc/manual/examples/sigusr.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Using kill for Communication
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/*@group*/
#include <signal.h>
#include <stdio.h>
@@ -8,14 +25,14 @@
/* When a @code{SIGUSR1} signal arrives, set this variable. */
volatile sig_atomic_t usr_interrupt = 0;
-void
+void
synch_signal (int sig)
{
usr_interrupt = 1;
}
/* The child process executes this function. */
-void
+void
child_function (void)
{
/* Perform initialization. */
Modified: fsf/trunk/libc/manual/examples/stpcpy.c
==============================================================================
--- fsf/trunk/libc/manual/examples/stpcpy.c (original)
+++ fsf/trunk/libc/manual/examples/stpcpy.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* stpcpy example.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <string.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/strdupa.c
==============================================================================
--- fsf/trunk/libc/manual/examples/strdupa.c (original)
+++ fsf/trunk/libc/manual/examples/strdupa.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* strdupa example.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <paths.h>
#include <string.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/strftim.c
==============================================================================
--- fsf/trunk/libc/manual/examples/strftim.c (original)
+++ fsf/trunk/libc/manual/examples/strftim.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Time Functions Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <time.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/strncat.c
==============================================================================
--- fsf/trunk/libc/manual/examples/strncat.c (original)
+++ fsf/trunk/libc/manual/examples/strncat.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* strncat example.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <string.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/subopt.c
==============================================================================
--- fsf/trunk/libc/manual/examples/subopt.c (original)
+++ fsf/trunk/libc/manual/examples/subopt.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Parsing of Suboptions Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Modified: fsf/trunk/libc/manual/examples/swapcontext.c
==============================================================================
--- fsf/trunk/libc/manual/examples/swapcontext.c (original)
+++ fsf/trunk/libc/manual/examples/swapcontext.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Complete Context Control
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Modified: fsf/trunk/libc/manual/examples/termios.c
==============================================================================
--- fsf/trunk/libc/manual/examples/termios.c (original)
+++ fsf/trunk/libc/manual/examples/termios.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Noncanonical Mode Example
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -7,13 +24,13 @@
struct termios saved_attributes;
-void
+void
reset_input_mode (void)
{
tcsetattr (STDIN_FILENO, TCSANOW, &saved_attributes);
}
-void
+void
set_input_mode (void)
{
struct termios tattr;
Modified: fsf/trunk/libc/manual/examples/testopt.c
==============================================================================
--- fsf/trunk/libc/manual/examples/testopt.c (original)
+++ fsf/trunk/libc/manual/examples/testopt.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* Example of Parsing Arguments with getopt.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/*@group*/
#include <ctype.h>
#include <stdio.h>
Modified: fsf/trunk/libc/manual/examples/testpass.c
==============================================================================
--- fsf/trunk/libc/manual/examples/testpass.c (original)
+++ fsf/trunk/libc/manual/examples/testpass.c Sun Mar 4 00:01:57 2012
@@ -1,9 +1,26 @@
+/* Verify a password.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <crypt.h>
-int
+int
main(void)
{
/* Hashed form of "GNU libc manual". */
@@ -11,7 +28,7 @@
char *result;
int ok;
-
+
/*@group*/
/* Read in the user's password and encrypt it,
passing the expected password in as the salt. */
Modified: fsf/trunk/libc/manual/examples/timeval_subtract.c
==============================================================================
--- fsf/trunk/libc/manual/examples/timeval_subtract.c (original)
+++ fsf/trunk/libc/manual/examples/timeval_subtract.c Sun Mar 4 00:01:57 2012
@@ -1,3 +1,20 @@
+/* struct timeval subtraction.
+ Copyright (C) 1991-2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
+*/
+
/* Subtract the `struct timeval' values X and Y,
storing the result in RESULT.
Return 1 if the difference is negative, otherwise 0. */
Modified: fsf/trunk/libc/math/math_private.h
==============================================================================
--- fsf/trunk/libc/math/math_private.h (original)
+++ fsf/trunk/libc/math/math_private.h Sun Mar 4 00:01:57 2012
@@ -211,10 +211,8 @@
/* internal functions. */
extern double __copysign (double x, double __y);
-#if __GNUC_PREREQ (4, 0)
extern inline double __copysign (double x, double y)
{ return __builtin_copysign (x, y); }
-#endif
/* ieee style elementary float functions */
extern float __ieee754_sqrtf (float);
@@ -258,10 +256,8 @@
/* internal functions. */
extern float __copysignf (float x, float __y);
-#if __GNUC_PREREQ (4, 0)
extern inline float __copysignf (float x, float y)
{ return __builtin_copysignf (x, y); }
-#endif
/* ieee style elementary long double functions */
extern long double __ieee754_sqrtl (long double);
@@ -326,10 +322,8 @@
extern long double __logbl (long double x);
extern long double __significandl (long double x);
-#if __GNUC_PREREQ (4, 0)
extern inline long double __copysignl (long double x, long double y)
{ return __builtin_copysignl (x, y); }
-#endif
#endif
Modified: fsf/trunk/libc/stdlib/tst-strtod.c
==============================================================================
--- fsf/trunk/libc/stdlib/tst-strtod.c (original)
+++ fsf/trunk/libc/stdlib/tst-strtod.c Sun Mar 4 00:01:57 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1996-2001,2003,2009,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -64,12 +64,9 @@
{ "0x0.8p-1022",
1.11253692925360069154511635866620203210960799023116591527666e-308,
'\0', ERANGE },
-#if __GNUC_PREREQ(2,96)
- /* For older GCC release HUGE_VAL is not a constant. */
{ "Inf", HUGE_VAL, '\0', 0 },
{ "-Inf", -HUGE_VAL, '\0', 0 },
{ "+InFiNiTy", HUGE_VAL, '\0', 0 },
-#endif
{ "0x80000Ap-23", 0x80000Ap-23, '\0', 0 },
{ "1e-324", 0, '\0', ERANGE },
{ NULL, 0, '\0', 0 }
Modified: fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h (original)
+++ fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h Sun Mar 4 00:01:57 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004,2006,2007,2009,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -55,33 +55,10 @@
#endif
-#if __GNUC_PREREQ (4, 1)
-# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
__sync_val_compare_and_swap (mem, oldval, newval)
-# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
(! __sync_bool_compare_and_swap (mem, oldval, newval))
-#else
-# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "q" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-
-# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "r" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-
-# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "r" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-#endif
#define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \
@@ -254,13 +231,8 @@
} \
__result; })
-#if __GNUC_PREREQ (4, 1)
-# define atomic_exchange_and_add(mem, value) \
+#define atomic_exchange_and_add(mem, value) \
__sync_fetch_and_add (mem, value)
-#else
-# define atomic_exchange_and_add(mem, value) \
- __arch_exchange_and_add_body (LOCK_PREFIX, __arch, mem, value)
-#endif
#define __arch_exchange_and_add_cprefix \
"cmpl $0, %%gs:%P4\n\tje 0f\n\tlock\n0:\t"
Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,67 @@
+/* llrint(), sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__llrint)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+
+ or %o0, %o1, %o0
+ fzero ZERO
+
+ stx %o0, [%sp + 72]
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ ldd [%sp + 72], %f0
+
+ stx %o2, [%sp + 72]
+ fabsd %f0, %f14
+
+ ldd [%sp + 72], %f16
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ for %f0, SIGN_BIT, %f0
+ fdtox %f0, %f4
+ std %f4, [%sp + 72]
+ retl
+ ldd [%sp + 72], %o0
+END (__llrint)
+weak_alias (__llrint, llrint)
Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,62 @@
+/* llrintf(), sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__llrintf)
+ st %o0, [%sp + 68]
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ ld [%sp + 68], %f1
+ fnegs ZERO, SIGN_BIT
+
+ st %o2, [%sp + 68]
+ fabss %f1, %f14
+
+ ld [%sp + 68], %f16
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstox %f0, %f4
+ std %f4, [%sp + 72]
+ retl
+ ldd [%sp + 72], %o0
+END (__llrintf)
+weak_alias (__llrintf, llrintf)
Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrint.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,67 @@
+/* lrint(), sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrint)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o0, 32, %o0
+
+ or %o0, %o1, %o0
+ fzero ZERO
+
+ stx %o0, [%sp + 72]
+ sllx %o2, 32, %o2
+ fnegd ZERO, SIGN_BIT
+
+ ldd [%sp + 72], %f0
+
+ stx %o2, [%sp + 72]
+ fabsd %f0, %f14
+
+ ldd [%sp + 72], %f16
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ for %f0, SIGN_BIT, %f0
+ fdtoi %f0, %f3
+ st %f3, [%sp + 72]
+ retl
+ ld [%sp + 72], %o0
+END (__lrint)
+weak_alias (__lrint, lrint)
Added: fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,62 @@
+/* lrintf(), sparc32 v9 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrintf)
+ st %o0, [%sp + 68]
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ ld [%sp + 68], %f1
+ fnegs ZERO, SIGN_BIT
+
+ st %o2, [%sp + 68]
+ fabss %f1, %f14
+
+ ld [%sp + 68], %f16
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstoi %f0, %f3
+ st %f3, [%sp + 68]
+ retl
+ ld [%sp + 68], %o0
+END (__lrintf)
+weak_alias (__lrintf, lrintf)
Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrint.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,1 @@
+/* llrint is implemented in s_lrint.S */
Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_llrintf.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,1 @@
+/* llrintf is implemented in s_lrint.S */
Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrint.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,63 @@
+/* lrint(), sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_FIFTYTWO 0x43300000 /* 2**52 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrint)
+ sethi %hi(TWO_FIFTYTWO), %o2
+ sllx %o2, 32, %o2
+ fzero ZERO
+
+ fnegd ZERO, SIGN_BIT
+ stx %o2, [%sp + STACK_BIAS + 128]
+ fabsd %f0, %f14
+
+ ldd [%sp + STACK_BIAS + 128], %f16
+ fcmpd %fcc3, %f14, %f16
+
+ fmovduge %fcc3, ZERO, %f16
+ fand %f0, SIGN_BIT, SIGN_BIT
+
+ for %f16, SIGN_BIT, %f16
+ faddd %f0, %f16, %f6
+ fsubd %f6, %f16, %f0
+ fabsd %f0, %f0
+ for %f0, SIGN_BIT, %f0
+ fdtox %f0, %f4
+ std %f4, [%sp + STACK_BIAS + 128]
+ retl
+ ldx [%sp + STACK_BIAS + 128], %o0
+END (__lrint)
+weak_alias (__lrint, lrint)
+
+strong_alias (__lrint, __llrint)
+weak_alias (__llrint, llrint)
Added: fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S (added)
+++ fsf/trunk/libc/sysdeps/sparc/sparc64/fpu/s_lrintf.S Sun Mar 4 00:01:57 2012
@@ -1,0 +1,62 @@
+/* lrintf(), sparc64 version.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David S. Miller <davem@xxxxxxxxxxxxx>, 2012.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ /* We pop constants into the FPU registers using the incoming
+ argument stack slots, since this avoid having to use any PIC
+ references. We also thus avoid having to allocate a register
+ window.
+
+ VIS instructions are used to facilitate the formation of
+ easier constants, and the propagation of the sign bit. */
+
+#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */
+
+#define ZERO %f10 /* 0.0 */
+#define SIGN_BIT %f12 /* -0.0 */
+
+ENTRY (__lrintf)
+ sethi %hi(TWO_TWENTYTHREE), %o2
+ fzeros ZERO
+
+ fnegs ZERO, SIGN_BIT
+ st %o2, [%sp + STACK_BIAS + 128]
+ fabss %f1, %f14
+
+ ld [%sp + STACK_BIAS + 128], %f16
+ fcmps %fcc3, %f14, %f16
+
+ fmovsuge %fcc3, ZERO, %f16
+ fands %f1, SIGN_BIT, SIGN_BIT
+
+ fors %f16, SIGN_BIT, %f16
+ fadds %f1, %f16, %f5
+ fsubs %f5, %f16, %f0
+ fabss %f0, %f0
+ fors %f0, SIGN_BIT, %f0
+ fstox %f0, %f4
+ std %f4, [%sp + STACK_BIAS + 128]
+ retl
+ ldx [%sp + STACK_BIAS + 128], %o0
+END (__lrintf)
+weak_alias (__lrintf, lrintf)
+
+strong_alias (__lrintf, __llrintf)
+weak_alias (__llrintf, llrintf)
Modified: fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h Sun Mar 4 00:01:57 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -55,41 +55,10 @@
#endif
-#if __GNUC_PREREQ (4, 1)
-# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
__sync_val_compare_and_swap (mem, oldval, newval)
-# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
(! __sync_bool_compare_and_swap (mem, oldval, newval))
-#else
-# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "q" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-
-# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "r" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-
-# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "r" (newval), "m" (*mem), "0" (oldval)); \
- ret; })
-
-# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- ({ __typeof (*mem) ret; \
- __asm __volatile (LOCK_PREFIX "cmpxchgq %q2, %1" \
- : "=a" (ret), "=m" (*mem) \
- : "r" ((long int) (newval)), "m" (*mem), \
- "0" ((long int) (oldval))); \
- ret; })
-#endif
#define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \
@@ -184,13 +153,8 @@
"i" (offsetof (tcbhead_t, multiple_threads))); \
result; })
-#if __GNUC_PREREQ (4, 1)
-# define atomic_exchange_and_add(mem, value) \
+#define atomic_exchange_and_add(mem, value) \
__sync_fetch_and_add (mem, value)
-#else
-# define atomic_exchange_and_add(mem, value) \
- __arch_exchange_and_add_body (LOCK_PREFIX, mem, value)
-#endif
#define __arch_exchange_and_add_cprefix \
"cmpl $0, %%fs:%P4\n\tje 0f\n\tlock\n0:\t"
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits