aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoakim Verona2011-09-07 01:42:17 +0200
committerJoakim Verona2011-09-07 01:42:17 +0200
commitbe81ea9a3709c042369aa6ffc6fee83448677251 (patch)
tree2f74495859302056045b03a2284ff6110951d2a3 /lib
parent1b07d72dd2687ebddf2f5d8c5538a2b43bc6d13a (diff)
parentc8199d0f9eb45a99de074ec10b893f737f738cd8 (diff)
downloademacs-be81ea9a3709c042369aa6ffc6fee83448677251.tar.gz
emacs-be81ea9a3709c042369aa6ffc6fee83448677251.zip
upstream
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk154
-rw-r--r--lib/lstat.c5
-rw-r--r--lib/makefile.w32-in2
-rw-r--r--lib/pthread_sigmask.c40
-rw-r--r--lib/stat.c5
-rw-r--r--lib/stdlib.in.h8
-rw-r--r--lib/unistd.in.h3
7 files changed, 138 insertions, 79 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 4341a5d184d..5163269db41 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
9# the same distribution terms as the rest of that program. 9# the same distribution terms as the rest of that program.
10# 10#
11# Generated by gnulib-tool. 11# Generated by gnulib-tool.
12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat 12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
13 13
14 14
15MOSTLYCLEANFILES += core *.stackdump 15MOSTLYCLEANFILES += core *.stackdump
@@ -52,54 +52,6 @@ EXTRA_DIST += allocator.h
52 52
53## end gnulib module allocator 53## end gnulib module allocator
54 54
55## begin gnulib module arg-nonnull
56
57# The BUILT_SOURCES created by this Makefile snippet are not used via #include
58# statements but through direct file reference. Therefore this snippet must be
59# present in all Makefile.am that need it. This is ensured by the applicability
60# 'all' defined above.
61
62BUILT_SOURCES += arg-nonnull.h
63# The arg-nonnull.h that gets inserted into generated .h files is the same as
64# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
65arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h
66 $(AM_V_GEN)rm -f $@-t $@ && \
67 sed -n -e '/GL_ARG_NONNULL/,$$p' \
68 < $(top_srcdir)/./arg-nonnull.h \
69 > $@-t && \
70 mv $@-t $@
71MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
72
73ARG_NONNULL_H=arg-nonnull.h
74
75EXTRA_DIST += $(top_srcdir)/./arg-nonnull.h
76
77## end gnulib module arg-nonnull
78
79## begin gnulib module c++defs
80
81# The BUILT_SOURCES created by this Makefile snippet are not used via #include
82# statements but through direct file reference. Therefore this snippet must be
83# present in all Makefile.am that need it. This is ensured by the applicability
84# 'all' defined above.
85
86BUILT_SOURCES += c++defs.h
87# The c++defs.h that gets inserted into generated .h files is the same as
88# build-aux/c++defs.h, except that it has the copyright header cut off.
89c++defs.h: $(top_srcdir)/./c++defs.h
90 $(AM_V_GEN)rm -f $@-t $@ && \
91 sed -n -e '/_GL_CXXDEFS/,$$p' \
92 < $(top_srcdir)/./c++defs.h \
93 > $@-t && \
94 mv $@-t $@
95MOSTLYCLEANFILES += c++defs.h c++defs.h-t
96
97CXXDEFS_H=c++defs.h
98
99EXTRA_DIST += $(top_srcdir)/./c++defs.h
100
101## end gnulib module c++defs
102
103## begin gnulib module careadlinkat 55## begin gnulib module careadlinkat
104 56
105libgnu_a_SOURCES += careadlinkat.c 57libgnu_a_SOURCES += careadlinkat.c
@@ -362,6 +314,87 @@ EXTRA_libgnu_a_SOURCES += sigprocmask.c
362 314
363## end gnulib module sigprocmask 315## end gnulib module sigprocmask
364 316
317## begin gnulib module snippet/_Noreturn
318
319# Because this Makefile snippet defines a variable used by other
320# gnulib Makefile snippets, it must be present in all Makefile.am that
321# need it. This is ensured by the applicability 'all' defined above.
322
323_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
324
325EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
326
327## end gnulib module snippet/_Noreturn
328
329## begin gnulib module snippet/arg-nonnull
330
331# The BUILT_SOURCES created by this Makefile snippet are not used via #include
332# statements but through direct file reference. Therefore this snippet must be
333# present in all Makefile.am that need it. This is ensured by the applicability
334# 'all' defined above.
335
336BUILT_SOURCES += arg-nonnull.h
337# The arg-nonnull.h that gets inserted into generated .h files is the same as
338# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
339# off.
340arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
341 $(AM_V_GEN)rm -f $@-t $@ && \
342 sed -n -e '/GL_ARG_NONNULL/,$$p' \
343 < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
344 > $@-t && \
345 mv $@-t $@
346MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
347
348ARG_NONNULL_H=arg-nonnull.h
349
350EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
351
352## end gnulib module snippet/arg-nonnull
353
354## begin gnulib module snippet/c++defs
355
356# The BUILT_SOURCES created by this Makefile snippet are not used via #include
357# statements but through direct file reference. Therefore this snippet must be
358# present in all Makefile.am that need it. This is ensured by the applicability
359# 'all' defined above.
360
361BUILT_SOURCES += c++defs.h
362# The c++defs.h that gets inserted into generated .h files is the same as
363# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
364c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
365 $(AM_V_GEN)rm -f $@-t $@ && \
366 sed -n -e '/_GL_CXXDEFS/,$$p' \
367 < $(top_srcdir)/build-aux/snippet/c++defs.h \
368 > $@-t && \
369 mv $@-t $@
370MOSTLYCLEANFILES += c++defs.h c++defs.h-t
371
372CXXDEFS_H=c++defs.h
373
374EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
375
376## end gnulib module snippet/c++defs
377
378## begin gnulib module snippet/warn-on-use
379
380BUILT_SOURCES += warn-on-use.h
381# The warn-on-use.h that gets inserted into generated .h files is the same as
382# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
383# off.
384warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
385 $(AM_V_GEN)rm -f $@-t $@ && \
386 sed -n -e '/^.ifndef/,$$p' \
387 < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
388 > $@-t && \
389 mv $@-t $@
390MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
391
392WARN_ON_USE_H=warn-on-use.h
393
394EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
395
396## end gnulib module snippet/warn-on-use
397
365## begin gnulib module stat 398## begin gnulib module stat
366 399
367if gl_GNULIB_ENABLED_stat 400if gl_GNULIB_ENABLED_stat
@@ -634,7 +667,8 @@ BUILT_SOURCES += stdlib.h
634 667
635# We need the following in order to create <stdlib.h> when the system 668# We need the following in order to create <stdlib.h> when the system
636# doesn't have one that works with the given compiler. 669# doesn't have one that works with the given compiler.
637stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) 670stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
671 $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
638 $(AM_V_GEN)rm -f $@-t $@ && \ 672 $(AM_V_GEN)rm -f $@-t $@ && \
639 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ 673 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
640 sed -e 's|@''GUARD_PREFIX''@|GL|g' \ 674 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@@ -708,6 +742,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
708 -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ 742 -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
709 -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ 743 -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
710 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ 744 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
745 -e '/definition of _Noreturn/r $(_NORETURN_H)' \
711 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ 746 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
712 -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ 747 -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
713 } > $@-t && \ 748 } > $@-t && \
@@ -1040,25 +1075,6 @@ EXTRA_DIST += verify.h
1040 1075
1041## end gnulib module verify 1076## end gnulib module verify
1042 1077
1043## begin gnulib module warn-on-use
1044
1045BUILT_SOURCES += warn-on-use.h
1046# The warn-on-use.h that gets inserted into generated .h files is the same as
1047# build-aux/warn-on-use.h, except that it has the copyright header cut off.
1048warn-on-use.h: $(top_srcdir)/./warn-on-use.h
1049 $(AM_V_GEN)rm -f $@-t $@ && \
1050 sed -n -e '/^.ifndef/,$$p' \
1051 < $(top_srcdir)/./warn-on-use.h \
1052 > $@-t && \
1053 mv $@-t $@
1054MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
1055
1056WARN_ON_USE_H=warn-on-use.h
1057
1058EXTRA_DIST += $(top_srcdir)/./warn-on-use.h
1059
1060## end gnulib module warn-on-use
1061
1062 1078
1063mostlyclean-local: mostlyclean-generic 1079mostlyclean-local: mostlyclean-generic
1064 @for dir in '' $(MOSTLYCLEANDIRS); do \ 1080 @for dir in '' $(MOSTLYCLEANDIRS); do \
diff --git a/lib/lstat.c b/lib/lstat.c
index b26065ede28..29fc6d25f90 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -17,6 +17,10 @@
17 17
18/* written by Jim Meyering */ 18/* written by Jim Meyering */
19 19
20/* If the user's config.h happens to include <sys/stat.h>, let it include only
21 the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to
22 rpl_lstat. */
23#define __need_system_sys_stat_h
20#include <config.h> 24#include <config.h>
21 25
22#if !HAVE_LSTAT 26#if !HAVE_LSTAT
@@ -27,7 +31,6 @@ typedef int dummy;
27#else /* HAVE_LSTAT */ 31#else /* HAVE_LSTAT */
28 32
29/* Get the original definition of lstat. It might be defined as a macro. */ 33/* Get the original definition of lstat. It might be defined as a macro. */
30# define __need_system_sys_stat_h
31# include <sys/types.h> 34# include <sys/types.h>
32# include <sys/stat.h> 35# include <sys/stat.h>
33# undef __need_system_sys_stat_h 36# undef __need_system_sys_stat_h
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in
index df7f8e274f0..6b451dd14e1 100644
--- a/lib/makefile.w32-in
+++ b/lib/makefile.w32-in
@@ -213,7 +213,7 @@ INCLUDE_NEXT = include_next
213PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header 213PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header
214PRAGMA_COLUMNS = 214PRAGMA_COLUMNS =
215NEXT_GETOPT_H = <getopt.h> 215NEXT_GETOPT_H = <getopt.h>
216ARG_NONNULL_H = ../arg-nonnull.h 216ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
217 217
218getopt_h: 218getopt_h:
219 - $(DEL) getopt_.h-t getopt_.h 219 - $(DEL) getopt_.h-t getopt_.h
diff --git a/lib/pthread_sigmask.c b/lib/pthread_sigmask.c
index 1f460f13c48..11d549cad41 100644
--- a/lib/pthread_sigmask.c
+++ b/lib/pthread_sigmask.c
@@ -20,10 +20,50 @@
20#include <signal.h> 20#include <signal.h>
21 21
22#include <errno.h> 22#include <errno.h>
23#include <stddef.h>
24
25#if PTHREAD_SIGMASK_UNBLOCK_BUG
26# include <unistd.h>
27#endif
23 28
24int 29int
25pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask) 30pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
31#undef pthread_sigmask
26{ 32{
33#if HAVE_PTHREAD_SIGMASK
34 int ret = pthread_sigmask (how, new_mask, old_mask);
35# if PTHREAD_SIGMASK_INEFFECTIVE
36 if (ret == 0)
37 {
38 /* Detect whether pthread_sigmask is currently ineffective.
39 Don't cache the information: libpthread.so could be dynamically
40 loaded after the program started and after pthread_sigmask was
41 called for the first time. */
42 if (pthread_sigmask (1729, NULL, NULL) == 0)
43 {
44 /* pthread_sigmask is currently ineffective. The program is not
45 linked to -lpthread. So use sigprocmask instead. */
46 return (sigprocmask (how, new_mask, old_mask) < 0 ? errno : 0);
47 }
48 }
49# endif
50# if PTHREAD_SIGMASK_FAILS_WITH_ERRNO
51 if (ret == -1)
52 return errno;
53# endif
54# if PTHREAD_SIGMASK_UNBLOCK_BUG
55 if (ret == 0
56 && new_mask != NULL
57 && (how == SIG_UNBLOCK || how == SIG_SETMASK))
58 {
59 /* Give the OS the opportunity to raise signals that were pending before
60 the pthread_sigmask call and have now been unblocked. */
61 usleep (1);
62 }
63# endif
64 return ret;
65#else
27 int ret = sigprocmask (how, new_mask, old_mask); 66 int ret = sigprocmask (how, new_mask, old_mask);
28 return (ret < 0 ? errno : 0); 67 return (ret < 0 ? errno : 0);
68#endif
29} 69}
diff --git a/lib/stat.c b/lib/stat.c
index f07370dd06b..6c354d1d357 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -16,10 +16,13 @@
16 16
17/* written by Eric Blake */ 17/* written by Eric Blake */
18 18
19/* If the user's config.h happens to include <sys/stat.h>, let it include only
20 the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
21 rpl_stat. */
22#define __need_system_sys_stat_h
19#include <config.h> 23#include <config.h>
20 24
21/* Get the original definition of stat. It might be defined as a macro. */ 25/* Get the original definition of stat. It might be defined as a macro. */
22#define __need_system_sys_stat_h
23#include <sys/types.h> 26#include <sys/types.h>
24#include <sys/stat.h> 27#include <sys/stat.h>
25#undef __need_system_sys_stat_h 28#undef __need_system_sys_stat_h
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 62a2ce920e6..047fac18b83 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -89,11 +89,7 @@ struct random_data
89# include <unistd.h> 89# include <unistd.h>
90#endif 90#endif
91 91
92#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__ 92/* The definition of _Noreturn is copied here. */
93# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
94#else
95# define _GL_ATTRIBUTE_NORETURN
96#endif
97 93
98/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 94/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
99 95
@@ -120,7 +116,7 @@ struct random_data
120/* Terminate the current process with the given return code, without running 116/* Terminate the current process with the given return code, without running
121 the 'atexit' handlers. */ 117 the 'atexit' handlers. */
122# if !@HAVE__EXIT@ 118# if !@HAVE__EXIT@
123_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN); 119_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
124# endif 120# endif
125_GL_CXXALIAS_SYS (_Exit, void, (int status)); 121_GL_CXXALIAS_SYS (_Exit, void, (int status));
126_GL_CXXALIASWARN (_Exit); 122_GL_CXXALIASWARN (_Exit);
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 769ecf0d43f..119cd142f43 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -85,7 +85,8 @@
85/* mingw declares getcwd in <io.h>, not in <unistd.h>. */ 85/* mingw declares getcwd in <io.h>, not in <unistd.h>. */
86#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \ 86#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
87 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) 87 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
88# include <io.h> 88# include <io.h> /* mingw32, mingw64 */
89# include <direct.h> /* mingw64 */
89#endif 90#endif
90 91
91/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. 92/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.