commit bash-20120309 snapshot

This commit is contained in:
Chet Ramey
2012-04-09 09:59:49 -04:00
parent e73012f12c
commit 278286c99a
61 changed files with 29463 additions and 26748 deletions
+90
View File
@@ -13491,3 +13491,93 @@ bashline.c
isn't changed by canonicalization or spell checking after being
appended to $PWD, then don't change what the user typed. Controlled
by dircomplete_expand_relpath
3/7
---
m4/timespec.m4
- new macros, cribbed from gnulib and coreutils: find out whether we
have `struct timespec' and what file includes it
m4/stat-time.m4
- new macros, cribbed from gnulib and coreutils: find out whether the
mtime/atime/ctime/etctime fields of struct stat are of type
struct timespec, and what the name is
include/stat-time.h
- new file, cribbed from gnulib, with additions from coreutils: include
the right file to get the struct timespec define, or provide our own
replacement. Provides a bunch of inline functions to turn the
appropriate members of struct stat into `struct timespec' values,
zeroing out the tv_nsec field if necessary
test.c
- include "stat-time.h" for the nanosecond timestamp resolution stuff
- stat_mtime: new function, returns struct stat and the mod time
normalized into a `struct timespec' for the filename passed as the
first argument
- filecomp: call stat_mtime instead of sh_stat for each filename
argument to get the mtime as a struct timespec
- filecomp: call timespec_cmp instead of using a straight arithmetic
comparison for the -nt and -ot operators, using timespec returned by
stat_mtime. Added functionality requested by by Werner Fink
<werner@suse.de> for systems that can support it
3/10
----
include/posixdir.h
- REAL_DIR_ENTRY: remove dependency on _POSIX_SOURCE, only use feature
test macros to decide whether dirent.d_ino is present and usable;
define D_INO_AVAILABLE. Report and fix from Fabrizion Gennari
<fabrizio.ge@tiscali.it>
- D_FILENO_AVAILABLE: define if we can use dirent.d_fileno
lib/sh/getcwd.c
- use D_FILENO_AVAILABLE to decide whether or not to compile in
_path_checkino and whether or not to call it. Report and initial
fix from Fabrizion Gennari <fabrizio.ge@tiscali.it>
lib/readline/signals.c
- make sure all occurrences of SIGWINCH are protected by #ifdef
sig.c
- make sure all occurrences of SIGCHLD are protected by #ifdef
nojobs.c
- make sure SA_RESTART is defined to 0 if the OS doesn't define it
version.c
- show_shell_version: don't use string literals in printf, use %s.
Has added benefit of removing newline from string to be translated
trap.c
- queue_sigchld_trap: new function, increments the number of pending
SIGCHLD signals by the argument, which is by convention the number
of children reaped in a call to waitchld()
trap.h
- queue_sigchld_trap: new extern declaration
jobs.c
- waitchld: if called from the SIGCHLD signal handler (sigchld > 0),
then call queue_sigchld_trap to avoid running the trap in a signal
handler context. Report and original fix from Siddhesh Poyarekar
<siddhesh@redhat.com>
lib/sh/unicode.c
- u32tocesc: take an unsigned 32-bit quantity and encode it using
ISO C99 string notation (\u/\U)
- u32cconv: call u32tocesc as a fallback instead of u32cchar
- u32cconv: call u32tocesc if iconv cannot convert the character.
Maybe do the same thing if iconv_open fails
- u32reset: call iconv_close on localconv if u32init == 1
3/11
----
config-top.h
- CHECKWINSIZE_DEFAULT: new define, set to initial value of
check_window_size (shopt checkwinsize): 0 for off, 1 for on.
Default is 0
{jobs,nojobs}.c
- check_window_size: default initial value to CHECKWINSIZE_DEFAULT
+91 -1
View File
@@ -13487,4 +13487,94 @@ bashline.c
- dircomplete_expand_relpath: new variable, if non-zero, means that
`shopt -s direxpand' should expand relative pathnames. Zero by
default, not user-settable yet
- bash_directory_completion_hook:
- bash_directory_completion_hook: if we have a relative pathname that
isn't changed by canonicalization or spell checking after being
appended to $PWD, then don't change what the user typed. Controlled
by dircomplete_expand_relpath
3/7
---
m4/timespec.m4
- new macros, cribbed from gnulib and coreutils: find out whether we
have `struct timespec' and what file includes it
m4/stat-time.m4
- new macros, cribbed from gnulib and coreutils: find out whether the
mtime/atime/ctime/etctime fields of struct stat are of type
struct timespec, and what the name is
include/stat-time.h
- new file, cribbed from gnulib, with additions from coreutils: include
the right file to get the struct timespec define, or provide our own
replacement. Provides a bunch of inline functions to turn the
appropriate members of struct stat into `struct timespec' values,
zeroing out the tv_nsec field if necessary
test.c
- include "stat-time.h" for the nanosecond timestamp resolution stuff
- stat_mtime: new function, returns struct stat and the mod time
normalized into a `struct timespec' for the filename passed as the
first argument
- filecomp: call stat_mtime instead of sh_stat for each filename
argument to get the mtime as a struct timespec
- filecomp: call timespec_cmp instead of using a straight arithmetic
comparison for the -nt and -ot operators, using timespec returned by
stat_mtime. Added functionality requested by by Werner Fink
<werner@suse.de> for systems that can support it
3/10
----
include/posixdir.h
- REAL_DIR_ENTRY: remove dependency on _POSIX_SOURCE, only use feature
test macros to decide whether dirent.d_ino is present and usable;
define D_INO_AVAILABLE. Report and fix from Fabrizion Gennari
<fabrizio.ge@tiscali.it>
- D_FILENO_AVAILABLE: define if we can use dirent.d_fileno
lib/sh/getcwd.c
- use D_FILENO_AVAILABLE to decide whether or not to compile in
_path_checkino and whether or not to call it. Report and initial
fix from Fabrizion Gennari <fabrizio.ge@tiscali.it>
lib/readline/signals.c
- make sure all occurrences of SIGWINCH are protected by #ifdef
sig.c
- make sure all occurrences of SIGCHLD are protected by #ifdef
nojobs.c
- make sure SA_RESTART is defined to 0 if the OS doesn't define it
version.c
- show_shell_version: don't use string literals in printf, use %s.
Has added benefit of removing newline from string to be translated
trap.c
- queue_sigchld_trap: new function, increments the number of pending
SIGCHLD signals by the argument, which is by convention the number
of children reaped in a call to waitchld()
trap.h
- queue_sigchld_trap: new extern declaration
jobs.c
- waitchld: if called from the SIGCHLD signal handler (sigchld > 0),
then call queue_sigchld_trap to avoid running the trap in a signal
handler context. Report and original fix from Siddhesh Poyarekar
<siddhesh@redhat.com>
lib/sh/unicode.c
- u32tocesc: take an unsigned 32-bit quantity and encode it using
ISO C99 string notation (\u/\U)
- u32cconv: call u32tocesc as a fallback instead of u32cchar
- u32cconv: call u32tocesc if iconv cannot convert the character.
Maybe do the same thing if iconv_open fails
- u32reset: call iconv_close on localconv if u32init == 1
3/11
----
config-top.h
- CHECKWINSIZE_DEFAULT: new define, set to initial value of
check_window_size (shopt checkwinsize): 0 for off, 1 for on.
Default is 0
+4
View File
@@ -33,6 +33,7 @@ lib/readline/examples d
lib/sh d
lib/termcap d
lib/tilde d
m4 d
po d
support d
tests d
@@ -224,6 +225,7 @@ include/posixwait.h f
include/shmbchar.h f
include/shmbutil.h f
include/shtty.h f
include/stat-time.h f
include/stdc.h f
include/systimes.h f
include/typemax.h f
@@ -466,6 +468,8 @@ lib/tilde/Makefile.in f
lib/tilde/tilde.c f
lib/tilde/tilde.h f
lib/tilde/shell.c f
m4/stat-time.m4 f
m4/timespec.m4 f
po/LINGUAS f
po/Makefile.in.in f
po/Makevars f
+7445 -20941
View File
File diff suppressed because it is too large Load Diff
+69
View File
@@ -71,6 +71,75 @@
'_AM_COND_ELSE' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' ),
bless( [
'1',
1,
[
'/sw/share/autoconf'
],
[
'/sw/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.in'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'LT_INIT' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
'm4_include' => 1,
'_AM_COND_ELSE' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' )
);
+2530 -1745
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -51,7 +51,7 @@ Options:
-r do not allow backslashes to escape any characters
-s do not echo input coming from a terminal
-t timeout time out and return failure if a complete line of input is
not read withint TIMEOUT seconds. The value of the TMOUT
not read within TIMEOUT seconds. The value of the TMOUT
variable is the default timeout. TIMEOUT may be a
fractional number. If TIMEOUT is 0, read returns immediately,
without trying to read any data, returning success only if
+4
View File
@@ -119,3 +119,7 @@
#ifndef MULTIPLE_COPROCS
# define MULTIPLE_COPROCS 0
#endif
/* Define to 0 if you want the checkwinsize option off by default, 1 if you
want it on. */
#define CHECKWINSIZE_DEFAULT 0
+121
View File
@@ -0,0 +1,121 @@
/* config-top.h - various user-settable options not under the control of autoconf. */
/* Copyright (C) 2002-2009 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
/* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to
continue processing arguments after one of them fails. This is
what POSIX.2 specifies. */
#define CONTINUE_AFTER_KILL_ERROR
/* Define BREAK_COMPLAINS if you want the non-standard, but useful
error messages about `break' and `continue' out of context. */
#define BREAK_COMPLAINS
/* Define BUFFERED_INPUT if you want the shell to do its own input
buffering, rather than using stdio. Do not undefine this; it's
required to preserve semantics required by POSIX. */
#define BUFFERED_INPUT
/* Define ONESHOT if you want sh -c 'command' to avoid forking to execute
`command' whenever possible. This is a big efficiency improvement. */
#define ONESHOT
/* Define V9_ECHO if you want to give the echo builtin backslash-escape
interpretation using the -e option, in the style of the Bell Labs 9th
Edition version of echo. You cannot emulate the System V echo behavior
without this option. */
#define V9_ECHO
/* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages
when a job like `cat jobs.c | exit 1' terminates due to a SIGPIPE. */
#define DONT_REPORT_SIGPIPE
/* Define DONT_REPORT_SIGTERM if you don't want to see `Terminates' message
when a job exits due to SIGTERM, since that's the default signal sent
by the kill builtin. */
/* #define DONT_REPORT_SIGTERM */
/* Define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS if you don't want builtins
like `echo' and `printf' to report errors when output does not succeed
due to EPIPE. */
/* #define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS */
/* The default value of the PATH variable. */
#ifndef DEFAULT_PATH_VALUE
#define DEFAULT_PATH_VALUE \
"/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:."
#endif
/* The value for PATH when invoking `command -p'. This is only used when
the Posix.2 confstr () function, or CS_PATH define are not present. */
#ifndef STANDARD_UTILS_PATH
#define STANDARD_UTILS_PATH \
"/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
#endif
/* Default primary and secondary prompt strings. */
#define PPROMPT "\\s-\\v\\$ "
#define SPROMPT "> "
/* Undefine this if you don't want the ksh-compatible behavior of reprinting
the select menu after a valid choice is made only if REPLY is set to NULL
in the body of the select command. The menu is always reprinted if the
reply to the select query is an empty line. */
#define KSH_COMPATIBLE_SELECT
/* System-wide .bashrc file for interactive shells. */
/* #define SYS_BASHRC "/etc/bash.bashrc" */
/* System-wide .bash_logout for login shells. */
/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
run the startup files when not in posix mode. */
/* #define NON_INTERACTIVE_LOGIN_SHELLS */
/* Define this if you want bash to try to check whether it's being run by
sshd and source the .bashrc if so (like the rshd behavior). This checks
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
which can be fooled under certain not-uncommon circumstances. */
/* #define SSH_SOURCE_BASHRC */
/* Define if you want the case-capitalizing operators (~[~]) and the
`capcase' variable attribute (declare -c). */
#define CASEMOD_CAPCASE
/* This is used as the name of a shell function to call when a command
name is not found. If you want to name it something other than the
default ("command_not_found_handle"), change it here. */
/* #define NOTFOUND_HOOK "command_not_found_handle" */
/* Define if you want each line saved to the history list in bashhist.c:
bash_add_history() to be sent to syslog(). */
/* #define SYSLOG_HISTORY */
#if defined (SYSLOG_HISTORY)
# define SYSLOG_FACILITY LOG_USER
# define SYSLOG_LEVEL LOG_INFO
#endif
/* Define if you want to include code in shell.c to support wordexp(3) */
/* #define WORDEXP_OPTION */
/* Define as 1 if you want to enable code that implements multiple coprocs */
#ifndef MULTIPLE_COPROCS
# define MULTIPLE_COPROCS 0
#endif
+11 -1
View File
@@ -1,6 +1,6 @@
/* config.h -- Configuration file for bash. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2009,2011-2012 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -420,6 +420,16 @@
#undef WEXITSTATUS_OFFSET
#undef HAVE_STRUCT_TIMESPEC
#undef TIME_H_DEFINES_STRUCT_TIMESPEC
#undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
#undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC
#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
/* Characteristics of definitions in the system header files. */
#undef HAVE_GETPW_DECLS
Vendored
+249 -1
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in for Bash 4.2, version 4.046.
# From configure.in for Bash 4.2, version 4.047.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for bash 4.2-maint.
#
@@ -629,6 +629,9 @@ JOBS_O
TERMCAP_DEP
TERMCAP_LIB
SIGLIST_O
PTHREAD_H_DEFINES_STRUCT_TIMESPEC
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
TIME_H_DEFINES_STRUCT_TIMESPEC
LIBINTL_H
INTL_INC
INTL_DEP
@@ -5748,6 +5751,41 @@ if test x$SIZE = x; then
fi
# Checks for stat-related time functions.
# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2012 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# st_atim.tv_nsec - Linux, Solaris, Cygwin
# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
# st_birthtim - Cygwin 1.7.0+
# Configure checks for struct timespec
# Copyright (C) 2000-2001, 2003-2007, 2009-2011, 2012 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Original written by Paul Eggert and Jim Meyering.
# Modified by Chet Ramey for bash
$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
@@ -13846,6 +13884,216 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
if ${bash_cv_sys_struct_timespec_in_time_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
int
main ()
{
static struct timespec x; x.tv_sec = x.tv_nsec;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bash_cv_sys_struct_timespec_in_time_h=yes
else
bash_cv_sys_struct_timespec_in_time_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_time_h" >&5
$as_echo "$bash_cv_sys_struct_timespec_in_time_h" >&6; }
HAVE_STRUCT_TIMESPEC=0
TIME_H_DEFINES_STRUCT_TIMESPEC=0
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
if test $bash_cv_sys_struct_timespec_in_time_h = yes; then
$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
$as_echo "#define TIME_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h
TIME_H_DEFINES_STRUCT_TIMESPEC=1
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
if ${bash_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/time.h>
int
main ()
{
static struct timespec x; x.tv_sec = x.tv_nsec;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bash_cv_sys_struct_timespec_in_sys_time_h=yes
else
bash_cv_sys_struct_timespec_in_sys_time_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_sys_time_h" >&5
$as_echo "$bash_cv_sys_struct_timespec_in_sys_time_h" >&6; }
if test $bash_cv_sys_struct_timespec_in_sys_time_h = yes; then
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
$as_echo "#define SYS_TIME_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
if ${bash_cv_sys_struct_timespec_in_pthread_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
main ()
{
static struct timespec x; x.tv_sec = x.tv_nsec;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
bash_cv_sys_struct_timespec_in_pthread_h=yes
else
bash_cv_sys_struct_timespec_in_pthread_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_pthread_h" >&5
$as_echo "$bash_cv_sys_struct_timespec_in_pthread_h" >&6; }
if test $bash_cv_sys_struct_timespec_in_pthread_h = yes; then
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
$as_echo "#define PTHREAD_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h
fi
fi
fi
ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
#include <sys/stat.h>
"
if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/stat.h>
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
struct timespec ts;
struct stat st;
int
main ()
{
st.st_atim = ts;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
else
ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
fi
else
ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
#include <sys/stat.h>
"
if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
_ACEOF
else
ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
#include <sys/stat.h>
"
if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
_ACEOF
else
ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
#include <sys/stat.h>
"
if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
_ACEOF
fi
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the existence of strsignal" >&5
$as_echo_n "checking for the existence of strsignal... " >&6; }
if ${bash_cv_have_strsignal+:} false; then :
+7 -1
View File
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 4.2, version 4.046])dnl
AC_REVISION([for Bash 4.2, version 4.047])dnl
define(bashvers, 4.2)
define(relstatus, maint)
@@ -652,6 +652,9 @@ if test x$SIZE = x; then
fi
AC_SUBST(SIZE)
m4_include([m4/stat-time.m4])
m4_include([m4/timespec.m4])
dnl Turn on any extensions available in the GNU C library.
AC_DEFINE(_GNU_SOURCE, 1)
@@ -940,6 +943,9 @@ BASH_STRUCT_TIMEZONE
BASH_STRUCT_WEXITSTATUS_OFFSET
BASH_CHECK_TYPE_STRUCT_TIMESPEC
BASH_STAT_TIME
dnl presence and behavior of C library functions
BASH_FUNC_STRSIGNAL
BASH_FUNC_OPENDIR_CHECK
+19 -7
View File
@@ -1945,9 +1945,9 @@ RREEDDIIRREECCTTIIOONN
ters in _w_o_r_d are quoted, the _d_e_l_i_m_i_t_e_r is the result of quote removal
on _w_o_r_d, and the lines in the here-document are not expanded. If _w_o_r_d
is unquoted, all lines of the here-document are subjected to parameter
expansion, command substitution, and arithmetic expansion. In the lat-
ter case, the character sequence \\<<nneewwlliinnee>> is ignored, and \\ must be
used to quote the characters \\, $$, and ``.
expansion, command substitution, and arithmetic expansion, the charac-
ter sequence \\<<nneewwlliinnee>> is ignored, and \\ must be used to quote the
characters \\, $$, and ``.
If the redirection operator is <<<<--, then all leading tab characters are
stripped from input lines and the line containing _d_e_l_i_m_i_t_e_r. This
@@ -1961,9 +1961,9 @@ RREEDDIIRREECCTTIIOONN
The _w_o_r_d undergoes brace expansion, tilde expansion, parameter and
variable expansion, command substitution, arithmetic expansion, and
quote removal. Pathname expansion word splitting are not performed.
The result is supplied as a single string to the command on its stan-
dard input.
quote removal. Pathname expansion and word splitting are not per-
formed. The result is supplied as a single string to the command on
its standard input.
DDuupplliiccaattiinngg FFiillee DDeessccrriippttoorrss
The redirection operator
@@ -2888,6 +2888,18 @@ RREEAADDLLIINNEE
_m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is
equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the
value of eeddiittiinngg--mmooddee also affects the default keymap.
kkeeyysseeqq--ttiimmeeoouutt ((550000))
Specifies the duration _r_e_a_d_l_i_n_e will wait for a character when
reading an ambiguous key sequence (one that can form a complete
key sequence using the input read so far, or can take additional
input to complete a longer key sequence). If no input is
received within the timeout, _r_e_a_d_l_i_n_e will use the shorter but
complete key sequence. The value is specified in milliseconds,
so a value of 1000 means that _r_e_a_d_l_i_n_e will wait one second for
additional input. If this variable is set to a value less than
or equal to zero, or to a non-numeric value, _r_e_a_d_l_i_n_e will wait
until another key is pressed to decide which key sequence to
complete.
mmaarrkk--ddiirreeccttoorriieess ((OOnn))
If set to OOnn, completed directory names have a slash appended.
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
@@ -5556,4 +5568,4 @@ BBUUGGSS
GNU Bash 4.2 2012 January 29 BASH(1)
GNU Bash 4.2 2012 February 4 BASH(1)
+21 -7
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2012 January 29<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2012 February 4<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -4666,9 +4666,9 @@ is the result of quote removal on
and the lines in the here-document are not expanded.
If <I>word</I> is unquoted,
all lines of the here-document are subjected to parameter expansion,
command substitution, and arithmetic expansion. In the latter
case, the character sequence
all lines of the here-document are subjected to
parameter expansion, command substitution, and arithmetic expansion,
the character sequence
<B>\&lt;newline&gt;</B>
is ignored, and
@@ -4712,7 +4712,7 @@ A variant of here documents, the format is:
The <I>word</I> undergoes
brace expansion, tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote removal.
Pathname expansion word splitting are not performed.
Pathname expansion and word splitting are not performed.
The result is supplied as a single string to the command on its
standard input.
<A NAME="lbBQ">&nbsp;</A>
@@ -6824,6 +6824,20 @@ the value of
<B>editing-mode</B>
also affects the default keymap.
<DT><B>keyseq-timeout (500)</B>
<DD>
Specifies the duration <I>readline</I> will wait for a character when reading an
ambiguous key sequence (one that can form a complete key sequence using
the input read so far, or can take additional input to complete a longer
key sequence).
If no input is received within the timeout, <I>readline</I> will use the shorter
but complete key sequence.
The value is specified in milliseconds, so a value of 1000 means that
<I>readline</I> will wait one second for additional input.
If this variable is set to a value less than or equal to zero, or to a
non-numeric value, <I>readline</I> will wait until another key is pressed to
decide which key sequence to complete.
<DT><B>mark-directories (On)</B>
<DD>
@@ -12916,7 +12930,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 4.2<TH ALIGN=CENTER width=33%>2012 January 29<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 4.2<TH ALIGN=CENTER width=33%>2012 February 4<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -13022,6 +13036,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 30 January 2012 10:38:37 EST
Time: 05 March 2012 21:31:01 EST
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+2967 -2952
View File
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -264,49 +264,49 @@
@xrdef{Readline Init File Syntax-pg}{100}
@xrdef{Conditional Init Constructs-title}{Conditional Init Constructs}
@xrdef{Conditional Init Constructs-snt}{Section@tie 8.3.2}
@xrdef{Conditional Init Constructs-pg}{107}
@xrdef{Sample Init File-title}{Sample Init File}
@xrdef{Sample Init File-snt}{Section@tie 8.3.3}
@xrdef{Conditional Init Constructs-pg}{107}
@xrdef{Sample Init File-pg}{107}
@xrdef{Sample Init File-pg}{108}
@xrdef{Bindable Readline Commands-title}{Bindable Readline Commands}
@xrdef{Bindable Readline Commands-snt}{Section@tie 8.4}
@xrdef{Commands For Moving-title}{Commands For Moving}
@xrdef{Commands For Moving-snt}{Section@tie 8.4.1}
@xrdef{Commands For History-title}{Commands For Manipulating The History}
@xrdef{Commands For History-snt}{Section@tie 8.4.2}
@xrdef{Bindable Readline Commands-pg}{110}
@xrdef{Commands For Moving-pg}{110}
@xrdef{Commands For History-pg}{111}
@xrdef{Bindable Readline Commands-pg}{111}
@xrdef{Commands For Moving-pg}{111}
@xrdef{Commands For History-pg}{112}
@xrdef{Commands For Text-title}{Commands For Changing Text}
@xrdef{Commands For Text-snt}{Section@tie 8.4.3}
@xrdef{Commands For Text-pg}{112}
@xrdef{Commands For Text-pg}{113}
@xrdef{Commands For Killing-title}{Killing And Yanking}
@xrdef{Commands For Killing-snt}{Section@tie 8.4.4}
@xrdef{Commands For Killing-pg}{113}
@xrdef{Commands For Killing-pg}{114}
@xrdef{Numeric Arguments-title}{Specifying Numeric Arguments}
@xrdef{Numeric Arguments-snt}{Section@tie 8.4.5}
@xrdef{Numeric Arguments-pg}{114}
@xrdef{Numeric Arguments-pg}{115}
@xrdef{Commands For Completion-title}{Letting Readline Type For You}
@xrdef{Commands For Completion-snt}{Section@tie 8.4.6}
@xrdef{Commands For Completion-pg}{115}
@xrdef{Commands For Completion-pg}{116}
@xrdef{Keyboard Macros-title}{Keyboard Macros}
@xrdef{Keyboard Macros-snt}{Section@tie 8.4.7}
@xrdef{Keyboard Macros-pg}{116}
@xrdef{Keyboard Macros-pg}{117}
@xrdef{Miscellaneous Commands-title}{Some Miscellaneous Commands}
@xrdef{Miscellaneous Commands-snt}{Section@tie 8.4.8}
@xrdef{Miscellaneous Commands-pg}{117}
@xrdef{Miscellaneous Commands-pg}{118}
@xrdef{Readline vi Mode-title}{Readline vi Mode}
@xrdef{Readline vi Mode-snt}{Section@tie 8.5}
@xrdef{Programmable Completion-title}{Programmable Completion}
@xrdef{Programmable Completion-snt}{Section@tie 8.6}
@xrdef{Readline vi Mode-pg}{119}
@xrdef{Programmable Completion-pg}{119}
@xrdef{Readline vi Mode-pg}{120}
@xrdef{Programmable Completion-pg}{120}
@xrdef{Programmable Completion Builtins-title}{Programmable Completion Builtins}
@xrdef{Programmable Completion Builtins-snt}{Section@tie 8.7}
@xrdef{Programmable Completion Builtins-pg}{121}
@xrdef{Programmable Completion Builtins-pg}{122}
@xrdef{A Programmable Completion Example-title}{A Programmable Completion Example}
@xrdef{A Programmable Completion Example-snt}{Section@tie 8.8}
@xrdef{A Programmable Completion Example-pg}{125}
@xrdef{A Programmable Completion Example-pg}{126}
@xrdef{Using History Interactively-title}{Using History Interactively}
@xrdef{Using History Interactively-snt}{Chapter@tie 9}
@xrdef{Bash History Facilities-title}{Bash History Facilities}
+3 -3
View File
@@ -52,8 +52,8 @@
\entry{wait}{95}{\code {wait}}
\entry{disown}{95}{\code {disown}}
\entry{suspend}{95}{\code {suspend}}
\entry{compgen}{121}{\code {compgen}}
\entry{complete}{122}{\code {complete}}
\entry{compopt}{125}{\code {compopt}}
\entry{compgen}{122}{\code {compgen}}
\entry{complete}{123}{\code {complete}}
\entry{compopt}{126}{\code {compopt}}
\entry{fc}{129}{\code {fc}}
\entry{history}{130}{\code {history}}
+3 -3
View File
@@ -15,9 +15,9 @@
\entry {\code {caller}}{45}
\entry {\code {cd}}{38}
\entry {\code {command}}{46}
\entry {\code {compgen}}{121}
\entry {\code {complete}}{122}
\entry {\code {compopt}}{125}
\entry {\code {compgen}}{122}
\entry {\code {complete}}{123}
\entry {\code {compopt}}{126}
\entry {\code {continue}}{38}
\initial {D}
\entry {\code {declare}}{46}
+3 -3
View File
@@ -103,9 +103,9 @@
\entry{kill ring}{99}{kill ring}
\entry{initialization file, readline}{100}{initialization file, readline}
\entry{variables, readline}{101}{variables, readline}
\entry{programmable completion}{119}{programmable completion}
\entry{completion builtins}{121}{completion builtins}
\entry{History, how to use}{127}{History, how to use}
\entry{programmable completion}{120}{programmable completion}
\entry{completion builtins}{122}{completion builtins}
\entry{History, how to use}{128}{History, how to use}
\entry{command history}{129}{command history}
\entry{history list}{129}{history list}
\entry{history builtins}{129}{history builtins}
+3 -3
View File
@@ -28,7 +28,7 @@
\entry {commands, shell}{8}
\entry {commands, simple}{8}
\entry {comments, shell}{7}
\entry {completion builtins}{121}
\entry {completion builtins}{122}
\entry {configuration}{135}
\entry {control operator}{3}
\entry {coprocess}{15}
@@ -61,7 +61,7 @@
\entry {history events}{132}
\entry {history expansion}{131}
\entry {history list}{129}
\entry {History, how to use}{127}
\entry {History, how to use}{128}
\initial {I}
\entry {identifier}{3}
\entry {initialization file, readline}{100}
@@ -100,7 +100,7 @@
\entry {process group}{3}
\entry {process group ID}{3}
\entry {process substitution}{25}
\entry {programmable completion}{119}
\entry {programmable completion}{120}
\entry {prompting}{87}
\initial {Q}
\entry {quoting}{6}
BIN
View File
Binary file not shown.
+106 -106
View File
@@ -1,106 +1,106 @@
\entry{beginning-of-line (C-a)}{110}{\code {beginning-of-line (C-a)}}
\entry{end-of-line (C-e)}{110}{\code {end-of-line (C-e)}}
\entry{forward-char (C-f)}{110}{\code {forward-char (C-f)}}
\entry{backward-char (C-b)}{110}{\code {backward-char (C-b)}}
\entry{forward-word (M-f)}{110}{\code {forward-word (M-f)}}
\entry{backward-word (M-b)}{110}{\code {backward-word (M-b)}}
\entry{shell-forward-word ()}{110}{\code {shell-forward-word ()}}
\entry{shell-backward-word ()}{110}{\code {shell-backward-word ()}}
\entry{clear-screen (C-l)}{110}{\code {clear-screen (C-l)}}
\entry{redraw-current-line ()}{110}{\code {redraw-current-line ()}}
\entry{accept-line (Newline or Return)}{111}{\code {accept-line (Newline or Return)}}
\entry{previous-history (C-p)}{111}{\code {previous-history (C-p)}}
\entry{next-history (C-n)}{111}{\code {next-history (C-n)}}
\entry{beginning-of-history (M-<)}{111}{\code {beginning-of-history (M-<)}}
\entry{end-of-history (M->)}{111}{\code {end-of-history (M->)}}
\entry{reverse-search-history (C-r)}{111}{\code {reverse-search-history (C-r)}}
\entry{forward-search-history (C-s)}{111}{\code {forward-search-history (C-s)}}
\entry{non-incremental-reverse-search-history (M-p)}{111}{\code {non-incremental-reverse-search-history (M-p)}}
\entry{non-incremental-forward-search-history (M-n)}{111}{\code {non-incremental-forward-search-history (M-n)}}
\entry{history-search-forward ()}{111}{\code {history-search-forward ()}}
\entry{history-search-backward ()}{111}{\code {history-search-backward ()}}
\entry{history-substr-search-forward ()}{111}{\code {history-substr-search-forward ()}}
\entry{history-substr-search-backward ()}{112}{\code {history-substr-search-backward ()}}
\entry{yank-nth-arg (M-C-y)}{112}{\code {yank-nth-arg (M-C-y)}}
\entry{yank-last-arg (M-. or M-_)}{112}{\code {yank-last-arg (M-. or M-_)}}
\entry{delete-char (C-d)}{112}{\code {delete-char (C-d)}}
\entry{backward-delete-char (Rubout)}{112}{\code {backward-delete-char (Rubout)}}
\entry{forward-backward-delete-char ()}{112}{\code {forward-backward-delete-char ()}}
\entry{quoted-insert (C-q or C-v)}{112}{\code {quoted-insert (C-q or C-v)}}
\entry{self-insert (a, b, A, 1, !, ...{})}{112}{\code {self-insert (a, b, A, 1, !, \dots {})}}
\entry{transpose-chars (C-t)}{113}{\code {transpose-chars (C-t)}}
\entry{transpose-words (M-t)}{113}{\code {transpose-words (M-t)}}
\entry{upcase-word (M-u)}{113}{\code {upcase-word (M-u)}}
\entry{downcase-word (M-l)}{113}{\code {downcase-word (M-l)}}
\entry{capitalize-word (M-c)}{113}{\code {capitalize-word (M-c)}}
\entry{overwrite-mode ()}{113}{\code {overwrite-mode ()}}
\entry{kill-line (C-k)}{113}{\code {kill-line (C-k)}}
\entry{backward-kill-line (C-x Rubout)}{113}{\code {backward-kill-line (C-x Rubout)}}
\entry{unix-line-discard (C-u)}{113}{\code {unix-line-discard (C-u)}}
\entry{kill-whole-line ()}{113}{\code {kill-whole-line ()}}
\entry{kill-word (M-d)}{113}{\code {kill-word (M-d)}}
\entry{backward-kill-word (M-DEL)}{114}{\code {backward-kill-word (M-\key {DEL})}}
\entry{shell-kill-word ()}{114}{\code {shell-kill-word ()}}
\entry{shell-backward-kill-word ()}{114}{\code {shell-backward-kill-word ()}}
\entry{unix-word-rubout (C-w)}{114}{\code {unix-word-rubout (C-w)}}
\entry{unix-filename-rubout ()}{114}{\code {unix-filename-rubout ()}}
\entry{delete-horizontal-space ()}{114}{\code {delete-horizontal-space ()}}
\entry{kill-region ()}{114}{\code {kill-region ()}}
\entry{copy-region-as-kill ()}{114}{\code {copy-region-as-kill ()}}
\entry{copy-backward-word ()}{114}{\code {copy-backward-word ()}}
\entry{copy-forward-word ()}{114}{\code {copy-forward-word ()}}
\entry{yank (C-y)}{114}{\code {yank (C-y)}}
\entry{yank-pop (M-y)}{114}{\code {yank-pop (M-y)}}
\entry{digit-argument (M-0, M-1, ...{} M--)}{114}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}
\entry{universal-argument ()}{114}{\code {universal-argument ()}}
\entry{complete (TAB)}{115}{\code {complete (\key {TAB})}}
\entry{possible-completions (M-?)}{115}{\code {possible-completions (M-?)}}
\entry{insert-completions (M-*)}{115}{\code {insert-completions (M-*)}}
\entry{menu-complete ()}{115}{\code {menu-complete ()}}
\entry{menu-complete-backward ()}{115}{\code {menu-complete-backward ()}}
\entry{delete-char-or-list ()}{115}{\code {delete-char-or-list ()}}
\entry{complete-filename (M-/)}{115}{\code {complete-filename (M-/)}}
\entry{possible-filename-completions (C-x /)}{115}{\code {possible-filename-completions (C-x /)}}
\entry{complete-username (M-~)}{116}{\code {complete-username (M-~)}}
\entry{possible-username-completions (C-x ~)}{116}{\code {possible-username-completions (C-x ~)}}
\entry{complete-variable (M-$)}{116}{\code {complete-variable (M-$)}}
\entry{possible-variable-completions (C-x $)}{116}{\code {possible-variable-completions (C-x $)}}
\entry{complete-hostname (M-@)}{116}{\code {complete-hostname (M-@)}}
\entry{possible-hostname-completions (C-x @)}{116}{\code {possible-hostname-completions (C-x @)}}
\entry{complete-command (M-!)}{116}{\code {complete-command (M-!)}}
\entry{possible-command-completions (C-x !)}{116}{\code {possible-command-completions (C-x !)}}
\entry{dynamic-complete-history (M-TAB)}{116}{\code {dynamic-complete-history (M-\key {TAB})}}
\entry{dabbrev-expand ()}{116}{\code {dabbrev-expand ()}}
\entry{complete-into-braces (M-{\tt \char 123})}{116}{\code {complete-into-braces (M-{\tt \char 123})}}
\entry{start-kbd-macro (C-x ()}{116}{\code {start-kbd-macro (C-x ()}}
\entry{end-kbd-macro (C-x ))}{116}{\code {end-kbd-macro (C-x ))}}
\entry{call-last-kbd-macro (C-x e)}{116}{\code {call-last-kbd-macro (C-x e)}}
\entry{print-last-kbd-macro ()}{117}{\code {print-last-kbd-macro ()}}
\entry{re-read-init-file (C-x C-r)}{117}{\code {re-read-init-file (C-x C-r)}}
\entry{abort (C-g)}{117}{\code {abort (C-g)}}
\entry{do-uppercase-version (M-a, M-b, M-x, ...{})}{117}{\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}
\entry{prefix-meta (ESC)}{117}{\code {prefix-meta (\key {ESC})}}
\entry{undo (C-_ or C-x C-u)}{117}{\code {undo (C-_ or C-x C-u)}}
\entry{revert-line (M-r)}{117}{\code {revert-line (M-r)}}
\entry{tilde-expand (M-&)}{117}{\code {tilde-expand (M-&)}}
\entry{set-mark (C-@)}{117}{\code {set-mark (C-@)}}
\entry{exchange-point-and-mark (C-x C-x)}{117}{\code {exchange-point-and-mark (C-x C-x)}}
\entry{character-search (C-])}{117}{\code {character-search (C-])}}
\entry{character-search-backward (M-C-])}{117}{\code {character-search-backward (M-C-])}}
\entry{skip-csi-sequence ()}{117}{\code {skip-csi-sequence ()}}
\entry{insert-comment (M-#)}{118}{\code {insert-comment (M-#)}}
\entry{dump-functions ()}{118}{\code {dump-functions ()}}
\entry{dump-variables ()}{118}{\code {dump-variables ()}}
\entry{dump-macros ()}{118}{\code {dump-macros ()}}
\entry{glob-complete-word (M-g)}{118}{\code {glob-complete-word (M-g)}}
\entry{glob-expand-word (C-x *)}{118}{\code {glob-expand-word (C-x *)}}
\entry{glob-list-expansions (C-x g)}{118}{\code {glob-list-expansions (C-x g)}}
\entry{display-shell-version (C-x C-v)}{118}{\code {display-shell-version (C-x C-v)}}
\entry{shell-expand-line (M-C-e)}{118}{\code {shell-expand-line (M-C-e)}}
\entry{history-expand-line (M-^)}{118}{\code {history-expand-line (M-^)}}
\entry{magic-space ()}{119}{\code {magic-space ()}}
\entry{alias-expand-line ()}{119}{\code {alias-expand-line ()}}
\entry{history-and-alias-expand-line ()}{119}{\code {history-and-alias-expand-line ()}}
\entry{insert-last-argument (M-. or M-_)}{119}{\code {insert-last-argument (M-. or M-_)}}
\entry{operate-and-get-next (C-o)}{119}{\code {operate-and-get-next (C-o)}}
\entry{edit-and-execute-command (C-xC-e)}{119}{\code {edit-and-execute-command (C-xC-e)}}
\entry{beginning-of-line (C-a)}{111}{\code {beginning-of-line (C-a)}}
\entry{end-of-line (C-e)}{111}{\code {end-of-line (C-e)}}
\entry{forward-char (C-f)}{111}{\code {forward-char (C-f)}}
\entry{backward-char (C-b)}{111}{\code {backward-char (C-b)}}
\entry{forward-word (M-f)}{111}{\code {forward-word (M-f)}}
\entry{backward-word (M-b)}{111}{\code {backward-word (M-b)}}
\entry{shell-forward-word ()}{111}{\code {shell-forward-word ()}}
\entry{shell-backward-word ()}{111}{\code {shell-backward-word ()}}
\entry{clear-screen (C-l)}{111}{\code {clear-screen (C-l)}}
\entry{redraw-current-line ()}{111}{\code {redraw-current-line ()}}
\entry{accept-line (Newline or Return)}{112}{\code {accept-line (Newline or Return)}}
\entry{previous-history (C-p)}{112}{\code {previous-history (C-p)}}
\entry{next-history (C-n)}{112}{\code {next-history (C-n)}}
\entry{beginning-of-history (M-<)}{112}{\code {beginning-of-history (M-<)}}
\entry{end-of-history (M->)}{112}{\code {end-of-history (M->)}}
\entry{reverse-search-history (C-r)}{112}{\code {reverse-search-history (C-r)}}
\entry{forward-search-history (C-s)}{112}{\code {forward-search-history (C-s)}}
\entry{non-incremental-reverse-search-history (M-p)}{112}{\code {non-incremental-reverse-search-history (M-p)}}
\entry{non-incremental-forward-search-history (M-n)}{112}{\code {non-incremental-forward-search-history (M-n)}}
\entry{history-search-forward ()}{112}{\code {history-search-forward ()}}
\entry{history-search-backward ()}{112}{\code {history-search-backward ()}}
\entry{history-substr-search-forward ()}{112}{\code {history-substr-search-forward ()}}
\entry{history-substr-search-backward ()}{113}{\code {history-substr-search-backward ()}}
\entry{yank-nth-arg (M-C-y)}{113}{\code {yank-nth-arg (M-C-y)}}
\entry{yank-last-arg (M-. or M-_)}{113}{\code {yank-last-arg (M-. or M-_)}}
\entry{delete-char (C-d)}{113}{\code {delete-char (C-d)}}
\entry{backward-delete-char (Rubout)}{113}{\code {backward-delete-char (Rubout)}}
\entry{forward-backward-delete-char ()}{113}{\code {forward-backward-delete-char ()}}
\entry{quoted-insert (C-q or C-v)}{113}{\code {quoted-insert (C-q or C-v)}}
\entry{self-insert (a, b, A, 1, !, ...{})}{113}{\code {self-insert (a, b, A, 1, !, \dots {})}}
\entry{transpose-chars (C-t)}{114}{\code {transpose-chars (C-t)}}
\entry{transpose-words (M-t)}{114}{\code {transpose-words (M-t)}}
\entry{upcase-word (M-u)}{114}{\code {upcase-word (M-u)}}
\entry{downcase-word (M-l)}{114}{\code {downcase-word (M-l)}}
\entry{capitalize-word (M-c)}{114}{\code {capitalize-word (M-c)}}
\entry{overwrite-mode ()}{114}{\code {overwrite-mode ()}}
\entry{kill-line (C-k)}{114}{\code {kill-line (C-k)}}
\entry{backward-kill-line (C-x Rubout)}{114}{\code {backward-kill-line (C-x Rubout)}}
\entry{unix-line-discard (C-u)}{114}{\code {unix-line-discard (C-u)}}
\entry{kill-whole-line ()}{114}{\code {kill-whole-line ()}}
\entry{kill-word (M-d)}{114}{\code {kill-word (M-d)}}
\entry{backward-kill-word (M-DEL)}{115}{\code {backward-kill-word (M-\key {DEL})}}
\entry{shell-kill-word ()}{115}{\code {shell-kill-word ()}}
\entry{shell-backward-kill-word ()}{115}{\code {shell-backward-kill-word ()}}
\entry{unix-word-rubout (C-w)}{115}{\code {unix-word-rubout (C-w)}}
\entry{unix-filename-rubout ()}{115}{\code {unix-filename-rubout ()}}
\entry{delete-horizontal-space ()}{115}{\code {delete-horizontal-space ()}}
\entry{kill-region ()}{115}{\code {kill-region ()}}
\entry{copy-region-as-kill ()}{115}{\code {copy-region-as-kill ()}}
\entry{copy-backward-word ()}{115}{\code {copy-backward-word ()}}
\entry{copy-forward-word ()}{115}{\code {copy-forward-word ()}}
\entry{yank (C-y)}{115}{\code {yank (C-y)}}
\entry{yank-pop (M-y)}{115}{\code {yank-pop (M-y)}}
\entry{digit-argument (M-0, M-1, ...{} M--)}{115}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}
\entry{universal-argument ()}{115}{\code {universal-argument ()}}
\entry{complete (TAB)}{116}{\code {complete (\key {TAB})}}
\entry{possible-completions (M-?)}{116}{\code {possible-completions (M-?)}}
\entry{insert-completions (M-*)}{116}{\code {insert-completions (M-*)}}
\entry{menu-complete ()}{116}{\code {menu-complete ()}}
\entry{menu-complete-backward ()}{116}{\code {menu-complete-backward ()}}
\entry{delete-char-or-list ()}{116}{\code {delete-char-or-list ()}}
\entry{complete-filename (M-/)}{116}{\code {complete-filename (M-/)}}
\entry{possible-filename-completions (C-x /)}{116}{\code {possible-filename-completions (C-x /)}}
\entry{complete-username (M-~)}{117}{\code {complete-username (M-~)}}
\entry{possible-username-completions (C-x ~)}{117}{\code {possible-username-completions (C-x ~)}}
\entry{complete-variable (M-$)}{117}{\code {complete-variable (M-$)}}
\entry{possible-variable-completions (C-x $)}{117}{\code {possible-variable-completions (C-x $)}}
\entry{complete-hostname (M-@)}{117}{\code {complete-hostname (M-@)}}
\entry{possible-hostname-completions (C-x @)}{117}{\code {possible-hostname-completions (C-x @)}}
\entry{complete-command (M-!)}{117}{\code {complete-command (M-!)}}
\entry{possible-command-completions (C-x !)}{117}{\code {possible-command-completions (C-x !)}}
\entry{dynamic-complete-history (M-TAB)}{117}{\code {dynamic-complete-history (M-\key {TAB})}}
\entry{dabbrev-expand ()}{117}{\code {dabbrev-expand ()}}
\entry{complete-into-braces (M-{\tt \char 123})}{117}{\code {complete-into-braces (M-{\tt \char 123})}}
\entry{start-kbd-macro (C-x ()}{117}{\code {start-kbd-macro (C-x ()}}
\entry{end-kbd-macro (C-x ))}{117}{\code {end-kbd-macro (C-x ))}}
\entry{call-last-kbd-macro (C-x e)}{117}{\code {call-last-kbd-macro (C-x e)}}
\entry{print-last-kbd-macro ()}{118}{\code {print-last-kbd-macro ()}}
\entry{re-read-init-file (C-x C-r)}{118}{\code {re-read-init-file (C-x C-r)}}
\entry{abort (C-g)}{118}{\code {abort (C-g)}}
\entry{do-uppercase-version (M-a, M-b, M-x, ...{})}{118}{\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}
\entry{prefix-meta (ESC)}{118}{\code {prefix-meta (\key {ESC})}}
\entry{undo (C-_ or C-x C-u)}{118}{\code {undo (C-_ or C-x C-u)}}
\entry{revert-line (M-r)}{118}{\code {revert-line (M-r)}}
\entry{tilde-expand (M-&)}{118}{\code {tilde-expand (M-&)}}
\entry{set-mark (C-@)}{118}{\code {set-mark (C-@)}}
\entry{exchange-point-and-mark (C-x C-x)}{118}{\code {exchange-point-and-mark (C-x C-x)}}
\entry{character-search (C-])}{118}{\code {character-search (C-])}}
\entry{character-search-backward (M-C-])}{118}{\code {character-search-backward (M-C-])}}
\entry{skip-csi-sequence ()}{118}{\code {skip-csi-sequence ()}}
\entry{insert-comment (M-#)}{119}{\code {insert-comment (M-#)}}
\entry{dump-functions ()}{119}{\code {dump-functions ()}}
\entry{dump-variables ()}{119}{\code {dump-variables ()}}
\entry{dump-macros ()}{119}{\code {dump-macros ()}}
\entry{glob-complete-word (M-g)}{119}{\code {glob-complete-word (M-g)}}
\entry{glob-expand-word (C-x *)}{119}{\code {glob-expand-word (C-x *)}}
\entry{glob-list-expansions (C-x g)}{119}{\code {glob-list-expansions (C-x g)}}
\entry{display-shell-version (C-x C-v)}{119}{\code {display-shell-version (C-x C-v)}}
\entry{shell-expand-line (M-C-e)}{119}{\code {shell-expand-line (M-C-e)}}
\entry{history-expand-line (M-^)}{119}{\code {history-expand-line (M-^)}}
\entry{magic-space ()}{120}{\code {magic-space ()}}
\entry{alias-expand-line ()}{120}{\code {alias-expand-line ()}}
\entry{history-and-alias-expand-line ()}{120}{\code {history-and-alias-expand-line ()}}
\entry{insert-last-argument (M-. or M-_)}{120}{\code {insert-last-argument (M-. or M-_)}}
\entry{operate-and-get-next (C-o)}{120}{\code {operate-and-get-next (C-o)}}
\entry{edit-and-execute-command (C-xC-e)}{120}{\code {edit-and-execute-command (C-xC-e)}}
+106 -106
View File
@@ -1,126 +1,126 @@
\initial {A}
\entry {\code {abort (C-g)}}{117}
\entry {\code {accept-line (Newline or Return)}}{111}
\entry {\code {alias-expand-line ()}}{119}
\entry {\code {abort (C-g)}}{118}
\entry {\code {accept-line (Newline or Return)}}{112}
\entry {\code {alias-expand-line ()}}{120}
\initial {B}
\entry {\code {backward-char (C-b)}}{110}
\entry {\code {backward-delete-char (Rubout)}}{112}
\entry {\code {backward-kill-line (C-x Rubout)}}{113}
\entry {\code {backward-kill-word (M-\key {DEL})}}{114}
\entry {\code {backward-word (M-b)}}{110}
\entry {\code {beginning-of-history (M-<)}}{111}
\entry {\code {beginning-of-line (C-a)}}{110}
\entry {\code {backward-char (C-b)}}{111}
\entry {\code {backward-delete-char (Rubout)}}{113}
\entry {\code {backward-kill-line (C-x Rubout)}}{114}
\entry {\code {backward-kill-word (M-\key {DEL})}}{115}
\entry {\code {backward-word (M-b)}}{111}
\entry {\code {beginning-of-history (M-<)}}{112}
\entry {\code {beginning-of-line (C-a)}}{111}
\initial {C}
\entry {\code {call-last-kbd-macro (C-x e)}}{116}
\entry {\code {capitalize-word (M-c)}}{113}
\entry {\code {character-search (C-])}}{117}
\entry {\code {character-search-backward (M-C-])}}{117}
\entry {\code {clear-screen (C-l)}}{110}
\entry {\code {complete (\key {TAB})}}{115}
\entry {\code {complete-command (M-!)}}{116}
\entry {\code {complete-filename (M-/)}}{115}
\entry {\code {complete-hostname (M-@)}}{116}
\entry {\code {complete-into-braces (M-{\tt \char 123})}}{116}
\entry {\code {complete-username (M-~)}}{116}
\entry {\code {complete-variable (M-$)}}{116}
\entry {\code {copy-backward-word ()}}{114}
\entry {\code {copy-forward-word ()}}{114}
\entry {\code {copy-region-as-kill ()}}{114}
\entry {\code {call-last-kbd-macro (C-x e)}}{117}
\entry {\code {capitalize-word (M-c)}}{114}
\entry {\code {character-search (C-])}}{118}
\entry {\code {character-search-backward (M-C-])}}{118}
\entry {\code {clear-screen (C-l)}}{111}
\entry {\code {complete (\key {TAB})}}{116}
\entry {\code {complete-command (M-!)}}{117}
\entry {\code {complete-filename (M-/)}}{116}
\entry {\code {complete-hostname (M-@)}}{117}
\entry {\code {complete-into-braces (M-{\tt \char 123})}}{117}
\entry {\code {complete-username (M-~)}}{117}
\entry {\code {complete-variable (M-$)}}{117}
\entry {\code {copy-backward-word ()}}{115}
\entry {\code {copy-forward-word ()}}{115}
\entry {\code {copy-region-as-kill ()}}{115}
\initial {D}
\entry {\code {dabbrev-expand ()}}{116}
\entry {\code {delete-char (C-d)}}{112}
\entry {\code {delete-char-or-list ()}}{115}
\entry {\code {delete-horizontal-space ()}}{114}
\entry {\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}{114}
\entry {\code {display-shell-version (C-x C-v)}}{118}
\entry {\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}{117}
\entry {\code {downcase-word (M-l)}}{113}
\entry {\code {dump-functions ()}}{118}
\entry {\code {dump-macros ()}}{118}
\entry {\code {dump-variables ()}}{118}
\entry {\code {dynamic-complete-history (M-\key {TAB})}}{116}
\entry {\code {dabbrev-expand ()}}{117}
\entry {\code {delete-char (C-d)}}{113}
\entry {\code {delete-char-or-list ()}}{116}
\entry {\code {delete-horizontal-space ()}}{115}
\entry {\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}{115}
\entry {\code {display-shell-version (C-x C-v)}}{119}
\entry {\code {do-uppercase-version (M-a, M-b, M-\var {x}, \dots {})}}{118}
\entry {\code {downcase-word (M-l)}}{114}
\entry {\code {dump-functions ()}}{119}
\entry {\code {dump-macros ()}}{119}
\entry {\code {dump-variables ()}}{119}
\entry {\code {dynamic-complete-history (M-\key {TAB})}}{117}
\initial {E}
\entry {\code {edit-and-execute-command (C-xC-e)}}{119}
\entry {\code {end-kbd-macro (C-x ))}}{116}
\entry {\code {end-of-history (M->)}}{111}
\entry {\code {end-of-line (C-e)}}{110}
\entry {\code {exchange-point-and-mark (C-x C-x)}}{117}
\entry {\code {edit-and-execute-command (C-xC-e)}}{120}
\entry {\code {end-kbd-macro (C-x ))}}{117}
\entry {\code {end-of-history (M->)}}{112}
\entry {\code {end-of-line (C-e)}}{111}
\entry {\code {exchange-point-and-mark (C-x C-x)}}{118}
\initial {F}
\entry {\code {forward-backward-delete-char ()}}{112}
\entry {\code {forward-char (C-f)}}{110}
\entry {\code {forward-search-history (C-s)}}{111}
\entry {\code {forward-word (M-f)}}{110}
\entry {\code {forward-backward-delete-char ()}}{113}
\entry {\code {forward-char (C-f)}}{111}
\entry {\code {forward-search-history (C-s)}}{112}
\entry {\code {forward-word (M-f)}}{111}
\initial {G}
\entry {\code {glob-complete-word (M-g)}}{118}
\entry {\code {glob-expand-word (C-x *)}}{118}
\entry {\code {glob-list-expansions (C-x g)}}{118}
\entry {\code {glob-complete-word (M-g)}}{119}
\entry {\code {glob-expand-word (C-x *)}}{119}
\entry {\code {glob-list-expansions (C-x g)}}{119}
\initial {H}
\entry {\code {history-and-alias-expand-line ()}}{119}
\entry {\code {history-expand-line (M-^)}}{118}
\entry {\code {history-search-backward ()}}{111}
\entry {\code {history-search-forward ()}}{111}
\entry {\code {history-substr-search-backward ()}}{112}
\entry {\code {history-substr-search-forward ()}}{111}
\entry {\code {history-and-alias-expand-line ()}}{120}
\entry {\code {history-expand-line (M-^)}}{119}
\entry {\code {history-search-backward ()}}{112}
\entry {\code {history-search-forward ()}}{112}
\entry {\code {history-substr-search-backward ()}}{113}
\entry {\code {history-substr-search-forward ()}}{112}
\initial {I}
\entry {\code {insert-comment (M-#)}}{118}
\entry {\code {insert-completions (M-*)}}{115}
\entry {\code {insert-last-argument (M-. or M-_)}}{119}
\entry {\code {insert-comment (M-#)}}{119}
\entry {\code {insert-completions (M-*)}}{116}
\entry {\code {insert-last-argument (M-. or M-_)}}{120}
\initial {K}
\entry {\code {kill-line (C-k)}}{113}
\entry {\code {kill-region ()}}{114}
\entry {\code {kill-whole-line ()}}{113}
\entry {\code {kill-word (M-d)}}{113}
\entry {\code {kill-line (C-k)}}{114}
\entry {\code {kill-region ()}}{115}
\entry {\code {kill-whole-line ()}}{114}
\entry {\code {kill-word (M-d)}}{114}
\initial {M}
\entry {\code {magic-space ()}}{119}
\entry {\code {menu-complete ()}}{115}
\entry {\code {menu-complete-backward ()}}{115}
\entry {\code {magic-space ()}}{120}
\entry {\code {menu-complete ()}}{116}
\entry {\code {menu-complete-backward ()}}{116}
\initial {N}
\entry {\code {next-history (C-n)}}{111}
\entry {\code {non-incremental-forward-search-history (M-n)}}{111}
\entry {\code {non-incremental-reverse-search-history (M-p)}}{111}
\entry {\code {next-history (C-n)}}{112}
\entry {\code {non-incremental-forward-search-history (M-n)}}{112}
\entry {\code {non-incremental-reverse-search-history (M-p)}}{112}
\initial {O}
\entry {\code {operate-and-get-next (C-o)}}{119}
\entry {\code {overwrite-mode ()}}{113}
\entry {\code {operate-and-get-next (C-o)}}{120}
\entry {\code {overwrite-mode ()}}{114}
\initial {P}
\entry {\code {possible-command-completions (C-x !)}}{116}
\entry {\code {possible-completions (M-?)}}{115}
\entry {\code {possible-filename-completions (C-x /)}}{115}
\entry {\code {possible-hostname-completions (C-x @)}}{116}
\entry {\code {possible-username-completions (C-x ~)}}{116}
\entry {\code {possible-variable-completions (C-x $)}}{116}
\entry {\code {prefix-meta (\key {ESC})}}{117}
\entry {\code {previous-history (C-p)}}{111}
\entry {\code {print-last-kbd-macro ()}}{117}
\entry {\code {possible-command-completions (C-x !)}}{117}
\entry {\code {possible-completions (M-?)}}{116}
\entry {\code {possible-filename-completions (C-x /)}}{116}
\entry {\code {possible-hostname-completions (C-x @)}}{117}
\entry {\code {possible-username-completions (C-x ~)}}{117}
\entry {\code {possible-variable-completions (C-x $)}}{117}
\entry {\code {prefix-meta (\key {ESC})}}{118}
\entry {\code {previous-history (C-p)}}{112}
\entry {\code {print-last-kbd-macro ()}}{118}
\initial {Q}
\entry {\code {quoted-insert (C-q or C-v)}}{112}
\entry {\code {quoted-insert (C-q or C-v)}}{113}
\initial {R}
\entry {\code {re-read-init-file (C-x C-r)}}{117}
\entry {\code {redraw-current-line ()}}{110}
\entry {\code {reverse-search-history (C-r)}}{111}
\entry {\code {revert-line (M-r)}}{117}
\entry {\code {re-read-init-file (C-x C-r)}}{118}
\entry {\code {redraw-current-line ()}}{111}
\entry {\code {reverse-search-history (C-r)}}{112}
\entry {\code {revert-line (M-r)}}{118}
\initial {S}
\entry {\code {self-insert (a, b, A, 1, !, \dots {})}}{112}
\entry {\code {set-mark (C-@)}}{117}
\entry {\code {shell-backward-kill-word ()}}{114}
\entry {\code {shell-backward-word ()}}{110}
\entry {\code {shell-expand-line (M-C-e)}}{118}
\entry {\code {shell-forward-word ()}}{110}
\entry {\code {shell-kill-word ()}}{114}
\entry {\code {skip-csi-sequence ()}}{117}
\entry {\code {start-kbd-macro (C-x ()}}{116}
\entry {\code {self-insert (a, b, A, 1, !, \dots {})}}{113}
\entry {\code {set-mark (C-@)}}{118}
\entry {\code {shell-backward-kill-word ()}}{115}
\entry {\code {shell-backward-word ()}}{111}
\entry {\code {shell-expand-line (M-C-e)}}{119}
\entry {\code {shell-forward-word ()}}{111}
\entry {\code {shell-kill-word ()}}{115}
\entry {\code {skip-csi-sequence ()}}{118}
\entry {\code {start-kbd-macro (C-x ()}}{117}
\initial {T}
\entry {\code {tilde-expand (M-&)}}{117}
\entry {\code {transpose-chars (C-t)}}{113}
\entry {\code {transpose-words (M-t)}}{113}
\entry {\code {tilde-expand (M-&)}}{118}
\entry {\code {transpose-chars (C-t)}}{114}
\entry {\code {transpose-words (M-t)}}{114}
\initial {U}
\entry {\code {undo (C-_ or C-x C-u)}}{117}
\entry {\code {universal-argument ()}}{114}
\entry {\code {unix-filename-rubout ()}}{114}
\entry {\code {unix-line-discard (C-u)}}{113}
\entry {\code {unix-word-rubout (C-w)}}{114}
\entry {\code {upcase-word (M-u)}}{113}
\entry {\code {undo (C-_ or C-x C-u)}}{118}
\entry {\code {universal-argument ()}}{115}
\entry {\code {unix-filename-rubout ()}}{115}
\entry {\code {unix-line-discard (C-u)}}{114}
\entry {\code {unix-word-rubout (C-w)}}{115}
\entry {\code {upcase-word (M-u)}}{114}
\initial {Y}
\entry {\code {yank (C-y)}}{114}
\entry {\code {yank-last-arg (M-. or M-_)}}{112}
\entry {\code {yank-nth-arg (M-C-y)}}{112}
\entry {\code {yank-pop (M-y)}}{114}
\entry {\code {yank (C-y)}}{115}
\entry {\code {yank-last-arg (M-. or M-_)}}{113}
\entry {\code {yank-nth-arg (M-C-y)}}{113}
\entry {\code {yank-pop (M-y)}}{115}
+22 -7
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 30 2012 by texi2html 1.64 -->
<!-- Created on March, 5 2012 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -3255,9 +3255,9 @@ arithmetic expansion, or filename expansion is performed on
<VAR>delimiter</VAR> is the result of quote removal on <VAR>word</VAR>,
and the lines in the here-document are not expanded.
If <VAR>word</VAR> is unquoted,
all lines of the here-document are subjected to parameter expansion,
command substitution, and arithmetic expansion. In the latter
case, the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
all lines of the here-document are subjected to
parameter expansion, command substitution, and arithmetic expansion,
the character sequence <CODE>\newline</CODE> is ignored, and <SAMP>`\'</SAMP>
must be used to quote the characters
<SAMP>`\'</SAMP>, <SAMP>`$'</SAMP>, and <SAMP>``'</SAMP>.
</P><P>
@@ -3291,7 +3291,7 @@ A variant of here documents, the format is:
The <VAR>word</VAR> undergoes
brace expansion, tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote removal.
Pathname expansion word splitting are not performed.
Pathname expansion and word splitting are not performed.
The result is supplied as a single string to the command on its
standard input.
</P><P>
@@ -10347,6 +10347,21 @@ The value of the <CODE>editing-mode</CODE> variable also affects the
default keymap.
<P>
<DT><CODE>keyseq-timeout</CODE>
<DD>Specifies the duration Readline will wait for a character when reading an
ambiguous key sequence (one that can form a complete key sequence using
the input read so far, or can take additional input to complete a longer
key sequence).
If no input is received within the timeout, Readline will use the shorter
but complete key sequence.
The value is specified in milliseconds, so a value of 1000 means that
Readline will wait one second for additional input.
If this variable is set to a value less than or equal to zero, or to a
non-numeric value, Readline will wait until another key is pressed to
decide which key sequence to complete.
The default value is <CODE>500</CODE>.
<P>
<DT><CODE>mark-directories</CODE>
<DD>If set to <SAMP>`on'</SAMP>, completed directory names have a slash
appended. The default is <SAMP>`on'</SAMP>.
@@ -16889,7 +16904,7 @@ to permit their use in free software.
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Chet Ramey</I> on <I>January, 30 2012</I>
This document was generated by <I>Chet Ramey</I> on <I>March, 5 2012</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -17051,7 +17066,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>January, 30 2012</I>
by <I>Chet Ramey</I> on <I>March, 5 2012</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+117 -103
View File
@@ -2125,9 +2125,9 @@ arithmetic expansion, or filename expansion is performed on WORD. If
any characters in WORD are quoted, the DELIMITER is the result of quote
removal on WORD, and the lines in the here-document are not expanded.
If WORD is unquoted, all lines of the here-document are subjected to
parameter expansion, command substitution, and arithmetic expansion.
In the latter case, the character sequence `\newline' is ignored, and
`\' must be used to quote the characters `\', `$', and ``'.
parameter expansion, command substitution, and arithmetic expansion,
the character sequence `\newline' is ignored, and `\' must be used to
quote the characters `\', `$', and ``'.
If the redirection operator is `<<-', then all leading tab
characters are stripped from input lines and the line containing
@@ -2142,7 +2142,7 @@ A variant of here documents, the format is:
The WORD undergoes brace expansion, tilde expansion, parameter and
variable expansion, command substitution, arithmetic expansion, and
quote removal. Pathname expansion word splitting are not performed.
quote removal. Pathname expansion and word splitting are not performed.
The result is supplied as a single string to the command on its
standard input.
@@ -7004,6 +7004,20 @@ Variable Settings
default value is `emacs'. The value of the `editing-mode'
variable also affects the default keymap.
`keyseq-timeout'
Specifies the duration Readline will wait for a character
when reading an ambiguous key sequence (one that can form a
complete key sequence using the input read so far, or can
take additional input to complete a longer key sequence). If
no input is received within the timeout, Readline will use
the shorter but complete key sequence. The value is
specified in milliseconds, so a value of 1000 means that
Readline will wait one second for additional input. If this
variable is set to a value less than or equal to zero, or to a
non-numeric value, Readline will wait until another key is
pressed to decide which key sequence to complete. The
default value is `500'.
`mark-directories'
If set to `on', completed directory names have a slash
appended. The default is `on'.
@@ -10514,13 +10528,13 @@ D.3 Parameter and Variable Index
(line 27)
* MAPFILE: Bash Variables. (line 439)
* mark-modified-lines: Readline Init File Syntax.
(line 178)
(line 192)
* mark-symlinked-directories: Readline Init File Syntax.
(line 183)
(line 197)
* match-hidden-files: Readline Init File Syntax.
(line 188)
(line 202)
* menu-complete-display-prefix: Readline Init File Syntax.
(line 195)
(line 209)
* meta-flag: Readline Init File Syntax.
(line 151)
* OLDPWD: Bash Variables. (line 443)
@@ -10531,9 +10545,9 @@ D.3 Parameter and Variable Index
(line 38)
* OSTYPE: Bash Variables. (line 450)
* output-meta: Readline Init File Syntax.
(line 200)
(line 214)
* page-completions: Readline Init File Syntax.
(line 205)
(line 219)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 453)
@@ -10553,17 +10567,17 @@ D.3 Parameter and Variable Index
* READLINE_POINT: Bash Variables. (line 504)
* REPLY: Bash Variables. (line 508)
* revert-all-at-newline: Readline Init File Syntax.
(line 215)
(line 229)
* SECONDS: Bash Variables. (line 511)
* SHELL: Bash Variables. (line 517)
* SHELLOPTS: Bash Variables. (line 522)
* SHLVL: Bash Variables. (line 531)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 221)
(line 235)
* show-all-if-unmodified: Readline Init File Syntax.
(line 227)
(line 241)
* skip-completed-text: Readline Init File Syntax.
(line 236)
(line 250)
* TEXTDOMAIN: Locale Translation. (line 11)
* TEXTDOMAINDIR: Locale Translation. (line 11)
* TIMEFORMAT: Bash Variables. (line 536)
@@ -10571,7 +10585,7 @@ D.3 Parameter and Variable Index
* TMPDIR: Bash Variables. (line 586)
* UID: Bash Variables. (line 590)
* visible-stats: Readline Init File Syntax.
(line 249)
(line 263)

File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
@@ -10885,93 +10899,93 @@ Node: Filename Expansion78057
Node: Pattern Matching80222
Node: Quote Removal83922
Node: Redirections84217
Node: Executing Commands93429
Node: Simple Command Expansion94099
Node: Command Search and Execution96029
Node: Command Execution Environment98366
Node: Environment101352
Node: Exit Status103011
Node: Signals104633
Node: Shell Scripts106601
Node: Shell Builtin Commands109119
Node: Bourne Shell Builtins111147
Node: Bash Builtins130528
Node: Modifying Shell Behavior157142
Node: The Set Builtin157487
Node: The Shopt Builtin167235
Node: Special Builtins181286
Node: Shell Variables182265
Node: Bourne Shell Variables182705
Node: Bash Variables184736
Node: Bash Features210247
Node: Invoking Bash211146
Node: Bash Startup Files216924
Node: Interactive Shells221943
Node: What is an Interactive Shell?222353
Node: Is this Shell Interactive?223002
Node: Interactive Shell Behavior223817
Node: Bash Conditional Expressions227097
Node: Shell Arithmetic230885
Node: Aliases233661
Node: Arrays236217
Node: The Directory Stack240425
Node: Directory Stack Builtins241144
Node: Controlling the Prompt244100
Node: The Restricted Shell246872
Node: Bash POSIX Mode248709
Node: Job Control258096
Node: Job Control Basics258556
Node: Job Control Builtins263275
Node: Job Control Variables267627
Node: Command Line Editing268785
Node: Introduction and Notation270457
Node: Readline Interaction272079
Node: Readline Bare Essentials273270
Node: Readline Movement Commands275059
Node: Readline Killing Commands276024
Node: Readline Arguments277944
Node: Searching278988
Node: Readline Init File281174
Node: Readline Init File Syntax282321
Node: Conditional Init Constructs297943
Node: Sample Init File300476
Node: Bindable Readline Commands303593
Node: Commands For Moving304800
Node: Commands For History305944
Node: Commands For Text310129
Node: Commands For Killing312802
Node: Numeric Arguments315259
Node: Commands For Completion316398
Node: Keyboard Macros320590
Node: Miscellaneous Commands321278
Node: Readline vi Mode327084
Node: Programmable Completion327991
Node: Programmable Completion Builtins335241
Node: A Programmable Completion Example344987
Node: Using History Interactively350237
Node: Bash History Facilities350921
Node: Bash History Builtins353912
Node: History Interaction357840
Node: Event Designators360545
Node: Word Designators361767
Node: Modifiers363406
Node: Installing Bash364810
Node: Basic Installation365947
Node: Compilers and Options368639
Node: Compiling For Multiple Architectures369380
Node: Installation Names371044
Node: Specifying the System Type371862
Node: Sharing Defaults372578
Node: Operation Controls373251
Node: Optional Features374209
Node: Reporting Bugs383781
Node: Major Differences From The Bourne Shell384982
Node: GNU Free Documentation License401674
Node: Indexes426870
Node: Builtin Index427324
Node: Reserved Word Index434151
Node: Variable Index436599
Node: Function Index449835
Node: Concept Index457063
Node: Executing Commands93413
Node: Simple Command Expansion94083
Node: Command Search and Execution96013
Node: Command Execution Environment98350
Node: Environment101336
Node: Exit Status102995
Node: Signals104617
Node: Shell Scripts106585
Node: Shell Builtin Commands109103
Node: Bourne Shell Builtins111131
Node: Bash Builtins130512
Node: Modifying Shell Behavior157126
Node: The Set Builtin157471
Node: The Shopt Builtin167219
Node: Special Builtins181270
Node: Shell Variables182249
Node: Bourne Shell Variables182689
Node: Bash Variables184720
Node: Bash Features210231
Node: Invoking Bash211130
Node: Bash Startup Files216908
Node: Interactive Shells221927
Node: What is an Interactive Shell?222337
Node: Is this Shell Interactive?222986
Node: Interactive Shell Behavior223801
Node: Bash Conditional Expressions227081
Node: Shell Arithmetic230869
Node: Aliases233645
Node: Arrays236201
Node: The Directory Stack240409
Node: Directory Stack Builtins241128
Node: Controlling the Prompt244084
Node: The Restricted Shell246856
Node: Bash POSIX Mode248693
Node: Job Control258080
Node: Job Control Basics258540
Node: Job Control Builtins263259
Node: Job Control Variables267611
Node: Command Line Editing268769
Node: Introduction and Notation270441
Node: Readline Interaction272063
Node: Readline Bare Essentials273254
Node: Readline Movement Commands275043
Node: Readline Killing Commands276008
Node: Readline Arguments277928
Node: Searching278972
Node: Readline Init File281158
Node: Readline Init File Syntax282305
Node: Conditional Init Constructs298738
Node: Sample Init File301271
Node: Bindable Readline Commands304388
Node: Commands For Moving305595
Node: Commands For History306739
Node: Commands For Text310924
Node: Commands For Killing313597
Node: Numeric Arguments316054
Node: Commands For Completion317193
Node: Keyboard Macros321385
Node: Miscellaneous Commands322073
Node: Readline vi Mode327879
Node: Programmable Completion328786
Node: Programmable Completion Builtins336036
Node: A Programmable Completion Example345782
Node: Using History Interactively351032
Node: Bash History Facilities351716
Node: Bash History Builtins354707
Node: History Interaction358635
Node: Event Designators361340
Node: Word Designators362562
Node: Modifiers364201
Node: Installing Bash365605
Node: Basic Installation366742
Node: Compilers and Options369434
Node: Compiling For Multiple Architectures370175
Node: Installation Names371839
Node: Specifying the System Type372657
Node: Sharing Defaults373373
Node: Operation Controls374046
Node: Optional Features375004
Node: Reporting Bugs384576
Node: Major Differences From The Bourne Shell385777
Node: GNU Free Documentation License402469
Node: Indexes427665
Node: Builtin Index428119
Node: Reserved Word Index434946
Node: Variable Index437394
Node: Function Index450630
Node: Concept Index457858

End Tag Table
+13 -14
View File
@@ -1,4 +1,4 @@
This is TeX, Version 3.1415926 (TeX Live 2010/Fink) (format=tex 2011.12.21) 30 JAN 2012 10:38
This is TeX, Version 3.1415926 (TeX Live 2010/Fink) (format=tex 2011.12.21) 5 MAR 2012 21:30
**/usr/homes/chet/src/bash/src/doc/bashref.texi
(/usr/homes/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2009-01-18.17]:
@@ -338,8 +338,8 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
.@texttt c
.etc.
[103] [104] [105] [106] [107]
Overfull \hbox (26.43913pt too wide) in paragraph at lines 904--904
[103] [104] [105] [106] [107] [108]
Overfull \hbox (26.43913pt too wide) in paragraph at lines 918--918
[]@texttt Meta-Control-h: backward-kill-word Text after the function name is i
gnored[]
@@ -351,9 +351,9 @@ gnored[]
.@texttt t
.etc.
[108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119]
[120] [121]
Overfull \hbox (12.05716pt too wide) in paragraph at lines 1852--1852
[109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120]
[121] [122]
Overfull \hbox (12.05716pt too wide) in paragraph at lines 1866--1866
[]@texttt complete [-abcdefgjksuv] [-o @textttsl comp-option@texttt ] [-DE] [-
A @textttsl ac-tion@texttt ] [-
@@ -365,8 +365,8 @@ A @textttsl ac-tion@texttt ] [-
.@texttt m
.etc.
[122]
Underfull \hbox (badness 2753) in paragraph at lines 1966--1969
[123]
Underfull \hbox (badness 2753) in paragraph at lines 1980--1983
@texttt hostname[]@textrm Hostnames, as taken from the file spec-i-fied by
@hbox(7.60416+2.12917)x433.62, glue set 3.02202
@@ -377,8 +377,8 @@ Underfull \hbox (badness 2753) in paragraph at lines 1966--1969
.@texttt o
.etc.
[123] [124] [125]
Overfull \hbox (26.43913pt too wide) in paragraph at lines 2117--2117
[124] [125] [126]
Overfull \hbox (26.43913pt too wide) in paragraph at lines 2131--2131
[] @texttt # Tilde expansion, with side effect of expanding tilde to full p
athname[]
@@ -390,9 +390,8 @@ athname[]
.@penalty 10000
.etc.
[126]) (/usr/homes/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[127] [128] [129] [130] [131] [132]) Chapter 10 [133] [134] [135] [136]
[137]
[127]) (/usr/homes/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[128] [129] [130] [131] [132]) Chapter 10 [133] [134] [135] [136] [137]
Underfull \hbox (badness 2772) in paragraph at lines 7700--7704
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -419,4 +418,4 @@ Here is how much of TeX's memory you used:
51 hyphenation exceptions out of 8191
16i,6n,14p,319b,705s stack positions out of 5000i,500n,10000p,200000b,50000s
Output written on bashref.dvi (172 pages, 701644 bytes).
Output written on bashref.dvi (172 pages, 702588 bytes).
BIN
View File
Binary file not shown.
+679 -656
View File
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -97,20 +97,20 @@
@numsecentry{Readline Init File}{8.3}{Readline Init File}{100}
@numsubsecentry{Readline Init File Syntax}{8.3.1}{Readline Init File Syntax}{100}
@numsubsecentry{Conditional Init Constructs}{8.3.2}{Conditional Init Constructs}{107}
@numsubsecentry{Sample Init File}{8.3.3}{Sample Init File}{107}
@numsecentry{Bindable Readline Commands}{8.4}{Bindable Readline Commands}{110}
@numsubsecentry{Commands For Moving}{8.4.1}{Commands For Moving}{110}
@numsubsecentry{Commands For Manipulating The History}{8.4.2}{Commands For History}{111}
@numsubsecentry{Commands For Changing Text}{8.4.3}{Commands For Text}{112}
@numsubsecentry{Killing And Yanking}{8.4.4}{Commands For Killing}{113}
@numsubsecentry{Specifying Numeric Arguments}{8.4.5}{Numeric Arguments}{114}
@numsubsecentry{Letting Readline Type For You}{8.4.6}{Commands For Completion}{115}
@numsubsecentry{Keyboard Macros}{8.4.7}{Keyboard Macros}{116}
@numsubsecentry{Some Miscellaneous Commands}{8.4.8}{Miscellaneous Commands}{117}
@numsecentry{Readline vi Mode}{8.5}{Readline vi Mode}{119}
@numsecentry{Programmable Completion}{8.6}{Programmable Completion}{119}
@numsecentry{Programmable Completion Builtins}{8.7}{Programmable Completion Builtins}{121}
@numsecentry{A Programmable Completion Example}{8.8}{A Programmable Completion Example}{125}
@numsubsecentry{Sample Init File}{8.3.3}{Sample Init File}{108}
@numsecentry{Bindable Readline Commands}{8.4}{Bindable Readline Commands}{111}
@numsubsecentry{Commands For Moving}{8.4.1}{Commands For Moving}{111}
@numsubsecentry{Commands For Manipulating The History}{8.4.2}{Commands For History}{112}
@numsubsecentry{Commands For Changing Text}{8.4.3}{Commands For Text}{113}
@numsubsecentry{Killing And Yanking}{8.4.4}{Commands For Killing}{114}
@numsubsecentry{Specifying Numeric Arguments}{8.4.5}{Numeric Arguments}{115}
@numsubsecentry{Letting Readline Type For You}{8.4.6}{Commands For Completion}{116}
@numsubsecentry{Keyboard Macros}{8.4.7}{Keyboard Macros}{117}
@numsubsecentry{Some Miscellaneous Commands}{8.4.8}{Miscellaneous Commands}{118}
@numsecentry{Readline vi Mode}{8.5}{Readline vi Mode}{120}
@numsecentry{Programmable Completion}{8.6}{Programmable Completion}{120}
@numsecentry{Programmable Completion Builtins}{8.7}{Programmable Completion Builtins}{122}
@numsecentry{A Programmable Completion Example}{8.8}{A Programmable Completion Example}{126}
@numchapentry{Using History Interactively}{9}{Using History Interactively}{129}
@numsecentry{Bash History Facilities}{9.1}{Bash History Facilities}{129}
@numsecentry{Bash History Builtins}{9.2}{Bash History Builtins}{129}
+4 -4
View File
@@ -126,14 +126,14 @@
\entry{meta-flag}{103}{\code {meta-flag}}
\entry{isearch-terminators}{103}{\code {isearch-terminators}}
\entry{keymap}{103}{\code {keymap}}
\entry{mark-modified-lines}{103}{\code {mark-modified-lines}}
\entry{mark-symlinked-directories}{103}{\code {mark-symlinked-directories}}
\entry{mark-modified-lines}{104}{\code {mark-modified-lines}}
\entry{mark-symlinked-directories}{104}{\code {mark-symlinked-directories}}
\entry{match-hidden-files}{104}{\code {match-hidden-files}}
\entry{menu-complete-display-prefix}{104}{\code {menu-complete-display-prefix}}
\entry{output-meta}{104}{\code {output-meta}}
\entry{page-completions}{104}{\code {page-completions}}
\entry{revert-all-at-newline}{104}{\code {revert-all-at-newline}}
\entry{show-all-if-ambiguous}{104}{\code {show-all-if-ambiguous}}
\entry{show-all-if-unmodified}{104}{\code {show-all-if-unmodified}}
\entry{skip-completed-text}{104}{\code {skip-completed-text}}
\entry{show-all-if-unmodified}{105}{\code {show-all-if-unmodified}}
\entry{skip-completed-text}{105}{\code {skip-completed-text}}
\entry{visible-stats}{105}{\code {visible-stats}}
+4 -4
View File
@@ -115,8 +115,8 @@
\entry {\code {MAILCHECK}}{72}
\entry {\code {MAILPATH}}{65}
\entry {\code {MAPFILE}}{72}
\entry {\code {mark-modified-lines}}{103}
\entry {\code {mark-symlinked-directories}}{103}
\entry {\code {mark-modified-lines}}{104}
\entry {\code {mark-symlinked-directories}}{104}
\entry {\code {match-hidden-files}}{104}
\entry {\code {menu-complete-display-prefix}}{104}
\entry {\code {meta-flag}}{103}
@@ -152,8 +152,8 @@
\entry {\code {SHELLOPTS}}{73}
\entry {\code {SHLVL}}{73}
\entry {\code {show-all-if-ambiguous}}{104}
\entry {\code {show-all-if-unmodified}}{104}
\entry {\code {skip-completed-text}}{104}
\entry {\code {show-all-if-unmodified}}{105}
\entry {\code {skip-completed-text}}{105}
\initial {T}
\entry {\code {TEXTDOMAIN}}{7}
\entry {\code {TEXTDOMAINDIR}}{7}
+3 -3
View File
@@ -574,8 +574,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
wise, the editor given by _e_n_a_m_e is invoked on a file containing
those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT
variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set.
If neither variable is set, is used. When editing is complete,
the edited commands are echoed and executed.
If neither variable is set, _v_i is used. When editing is com-
plete, the edited commands are echoed and executed.
In the second form, _c_o_m_m_a_n_d is re-executed after each instance
of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is intepreted the same as
@@ -1691,4 +1691,4 @@ SSEEEE AALLSSOO
GNU Bash-4.0 2004 Apr 20 BASH_BUILTINS(1)
GNU Bash-4.2 2004 Apr 20 BASH_BUILTINS(1)
+26 -26
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Mon Jan 30 10:38:30 2012
%%CreationDate: Mon Mar 5 21:30:56 2012
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
@@ -362,7 +362,7 @@ E F0 2.658(as the k)5.348 F -.15(ey)-.1 G 2.658(map to be af).15 F 2.659
180 726 S(ymap)-.2 E F0 3.193(names are)5.883 F F3 3.193
(emacs, emacs\255standar)5.693 F 3.192
(d, emacs\255meta, emacs\255ctlx, vi, vi\255mo)-.37 F(ve)-.1 E(,)-.1 E
F0(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP
F0(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
@@ -488,7 +488,7 @@ G(H).855 E F0 1.662(is the same as the current directory)3.912 F 4.162
(symbolic links while tra)144 720 R -.15(ve)-.2 G(rsing).15 E F1(dir)
3.62 E F0 1.12(and before processing instances of)3.62 F F1(..)3.62 E F0
(in)3.62 E F1(dir)3.62 E F0 1.12(\(see also the)3.62 F F2<ad50>3.62 E F0
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(2)203.725 E 0 Cg EP
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(2)203.725 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
@@ -618,7 +618,7 @@ F2(comp-option)2.5 E F0(The)184 698.4 Q F2(comp-option)2.79 E F0 .291
(controls se)2.791 F -.15(ve)-.25 G .291(ral aspects of the compspec')
.15 F 2.791(sb)-.55 G(eha)-2.791 E .291(vior be)-.2 F .291
(yond the simple)-.15 F(generation of completions.)184 710.4 Q F2
(comp-option)5 E F0(may be one of:)2.5 E(GNU Bash-4.0)72 768 Q
(comp-option)5 E F0(may be one of:)2.5 E(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(3)203.725 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
@@ -689,7 +689,7 @@ F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1
.15 E F1(user)184 696 Q F0(User names.)21.67 E
(May also be speci\214ed as)5 E F1<ad75>2.5 E F0(.)A F1 -.1(va)184 708 S
(riable).1 E F0(Names of all shell v)5.1 E 2.5(ariables. May)-.25 F
(also be speci\214ed as)2.5 E F1<ad76>2.5 E F0(.)A(GNU Bash-4.0)72 768 Q
(also be speci\214ed as)2.5 E F1<ad76>2.5 E F0(.)A(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(4)203.725 E 0 Cg EP
%%Page: 5 5
%%BeginPageSetup
@@ -815,7 +815,7 @@ G 3.764(nt).15 G 1.264(hen display the v)-3.764 F 1.264(alues of)-.25 F
(utes and)-.2 F -.25(va)144 727.2 S 1.362(lues of all shell v).25 F
3.862(ariables. The)-.25 F F1<ad66>3.862 E F0 1.363
(option will restrict the display to shell functions.)3.862 F(The)6.363
E F1<ad46>3.863 E F0(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(5)
E F1<ad46>3.863 E F0(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(5)
203.725 E 0 Cg EP
%%Page: 6 6
%%BeginPageSetup
@@ -954,7 +954,7 @@ F3(SIGHUP)2.641 E F0 .14(is not sent to the)2.39 F .004
3.729 F 1.528 -.15(ve o)-.15 H(r).15 E .656(mark all jobs; the)144 727.2
R F1<ad72>3.156 E F0 .657(option without a)3.156 F F2(jobspec)4.897 E F0
(ar)3.467 E .657(gument restricts operation to running jobs.)-.18 F(The)
5.657 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(6)203.725 E 0 Cg EP
5.657 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(6)203.725 E 0 Cg EP
%%Page: 7 7
%%BeginPageSetup
BP
@@ -1073,7 +1073,7 @@ E(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F2<ad63>2.999 E F0
.15 F(non-interacti)144 727.2 Q 2.279 -.15(ve s)-.25 H 1.979(hell e).15
F 1.979(xits, unless the)-.15 F F2(execfail)4.479 E F0 1.979
(shell option is enabled.)4.479 F 1.98(In that case, it returns)6.979 F
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(7)203.725 E 0 Cg EP
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(7)203.725 E 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
@@ -1152,9 +1152,9 @@ F(If)5.334 E F1(ename)3.024 E F0 .334(is not gi)3.014 F -.15(ve)-.25 G
(n,).15 E .63(the v)144 410.4 R .63(alue of the)-.25 F F3(FCEDIT)3.13 E
F0 -.25(va)2.88 G .631(riable is used, and the v).25 F .631(alue of)-.25
F F3(EDIT)3.131 E(OR)-.162 E F0(if)2.881 E F3(FCEDIT)3.131 E F0 .631
(is not set.)2.881 F .631(If nei-)5.631 F 1.884(ther v)144 422.4 R 1.884
(ariable is set, is used.)-.25 F 1.884
(When editing is complete, the edited commands are echoed and)6.884 F
(is not set.)2.881 F .631(If nei-)5.631 F .951(ther v)144 422.4 R .951
(ariable is set,)-.25 F F1(vi)5.117 E F0 .951(is used.)5.117 F .95
(When editing is complete, the edited commands are echoed and)5.951 F
-.15(exe)144 434.4 S(cuted.).15 E .788(In the second form,)144 458.4 R
F1(command)3.288 E F0 .788(is re-e)3.288 F -.15(xe)-.15 G .788
(cuted after each instance of).15 F F1(pat)3.288 E F0 .788
@@ -1212,7 +1212,7 @@ F0 .004(does not specify a v)2.814 F .004(alid job or)-.25 F F1(jobspec)
.796(he ne)-3.296 F(xt)-.15 E(ar)144 720 Q .085
(gument to be processed into the v)-.18 F(ariable)-.25 E F3(OPTIND)2.585
E/F5 9/Times-Roman@0 SF(.)A F3(OPTIND)4.585 E F0 .085
(is initialized to 1 each time the shell)2.335 F(GNU Bash-4.0)72 768 Q
(is initialized to 1 each time the shell)2.335 F(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(8)203.725 E 0 Cg EP
%%Page: 9 9
%%BeginPageSetup
@@ -1324,7 +1324,7 @@ F1(history \255p)108 691.2 Q F4(ar)2.5 E(g)-.37 E F0([)2.5 E F4(ar)A 2.5
G 5.072(been modi\214ed.)144 727.2 R 5.072(An ar)10.072 F 5.072
(gument of)-.18 F F4(n)7.932 E F0 5.073(lists only the last)7.813 F F4
(n)7.933 E F0 7.573(lines. If)7.813 F 5.073(the shell v)7.573 F(ariable)
-.25 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(9)203.725 E 0 Cg EP
-.25 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(9)203.725 E 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
@@ -1445,7 +1445,7 @@ E F3(let)108 700.8 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A(g)-.37 E F0
(AT)-.54 G(ION).855 E F0(abo)2.447 E -.15(ve)-.15 G 2.697(\). If).15 F
(the last)144 724.8 Q F2(ar)2.83 E(g)-.37 E F0 -.25(eva)2.72 G
(luates to 0,).25 E F3(let)2.5 E F0(returns 1; 0 is returned otherwise.)
2.5 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(10)198.725 E 0 Cg EP
2.5 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(10)198.725 E 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
@@ -1571,7 +1571,7 @@ er escape sequences, which are con)144 674.4 R -.15(ve)-.4 G .704
5.531(.I)C 3.031(na)-5.531 G .531(ddition to the standard)-3.031 F F2
(printf)3.032 E F0 .532(\(1\) format speci\214cations,)B F1(printf)3.032
E F0 .532(interprets the follo)3.032 F(w-)-.25 E(ing e)144 710.4 Q
(xtensions:)-.15 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(11)
(xtensions:)-.15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(11)
198.725 E 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
@@ -1694,7 +1694,7 @@ are assigned empty)-.1 F -.25(va)144 664.8 S 2.511(lues. The).25 F .011
-.25 E F2(aname)3.549 E F0 3.549(,s).18 G 1.049(tarting at 0.)-3.549 F
F2(aname)180.33 724.8 Q F0(is unset before an)2.68 E 2.5(yn)-.15 G .5
-.25(ew va)-2.5 H(lues are assigned.).25 E(Other)5 E F2(name)2.5 E F0
(ar)2.5 E(guments are ignored.)-.18 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)
(ar)2.5 E(guments are ignored.)-.18 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)
148.735 E(12)198.725 E 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
@@ -1828,7 +1828,7 @@ E F0 .011(is supplied a non-numeric ar)2.511 F .011
(unction and not during e)-2.91 F -.15(xe)-.15 G .41
(cution of a script by).15 F F1(.)2.91 E F0(or)3.743 E F1(sour)2.91 E
(ce)-.18 E F0 5.41(.A)C .71 -.15(ny c)-5.41 H .409
(ommand associated with the).15 F(GNU Bash-4.0)72 768 Q(2004 Apr 20)
(ommand associated with the).15 F(GNU Bash-4.2)72 768 Q(2004 Apr 20)
148.735 E(13)198.725 E 0 Cg EP
%%Page: 14 14
%%BeginPageSetup
@@ -1940,7 +1940,7 @@ F1(histexpand)184 688.8 Q F0(Same as)224 700.8 Q F1<ad48>2.5 E F0(.)A F1
3.087(sd)-3.087 G .587(escribed abo)-3.087 F .887 -.15(ve u)-.15 H(nder)
.15 E F3(HIST)3.087 E(OR)-.162 E(Y)-.315 E/F4 9/Times-Roman@0 SF(.)A F0
.587(This option is)5.087 F(on by def)224 724.8 Q(ault in interacti)-.1
E .3 -.15(ve s)-.25 H(hells.).15 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)
E .3 -.15(ve s)-.25 H(hells.).15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)
148.735 E(14)198.725 E 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
@@ -2040,7 +2040,7 @@ F0 .214(does not o)2.714 F -.15(ve)-.15 G .214(rwrite an e).15 F .214
F .838(mands e)184 714 R -.15(xe)-.15 G .838(cuted in a subshell en).15
F 3.338(vironment. The)-.4 F F1(ERR)3.338 E F0 .839
(trap is normally not inherited in)3.339 F(such cases.)184 726 Q
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(15)198.725 E 0 Cg EP
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(15)198.725 E 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
@@ -2157,7 +2157,7 @@ F1(cdable_v)144 646.8 Q(ars)-.1 E F0 .156(If set, an ar)184 658.8 R .156
(orrection is found, the corrected \214lename is printed, and)-3.27 F
(the command proceeds.)184 718.8 Q
(This option is only used by interacti)5 E .3 -.15(ve s)-.25 H(hells.)
.15 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(16)198.725 E 0 Cg EP
.15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(16)198.725 E 0 Cg EP
%%Page: 17 17
%%BeginPageSetup
BP
@@ -2268,7 +2268,7 @@ F1(dotglob)144 684 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165
1.387(cute the \214le speci\214ed as an).15 F(ar)184 708 Q
(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E
(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15
E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E(GNU Bash-4.0)72 768 Q
E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(17)198.725 E 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
@@ -2370,7 +2370,7 @@ G(adline).18 E F0 1.181(is being used,)3.681 F F1(bash)3.682 E F0 1.182
708 R 1.381(ord containing a)-.1 F F1(@)3.881 E F0 1.381
(is being completed \(see)3.881 F F1(Completing)3.88 E F0(under)3.88 E
F2(READLINE)3.88 E F0(abo)184 720 Q -.15(ve)-.15 G 2.5(\). This).15 F
(is enabled by def)2.5 E(ault.)-.1 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)
(is enabled by def)2.5 E(ault.)-.1 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)
148.735 E(18)198.725 E 0 Cg EP
%%Page: 19 19
%%BeginPageSetup
@@ -2471,7 +2471,7 @@ E F1(test)108 705.6 Q F3 -.2(ex)2.5 G(pr).2 E F1([)108 717.6 Q F3 -.2
(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)144 729.6
S(pr).2 E F0 5.53(.E).73 G .53
(ach operator and operand must be a separate ar)-5.53 F 3.03
(gument. Expressions)-.18 F .53(are composed of the)3.03 F(GNU Bash-4.0)
(gument. Expressions)-.18 F .53(are composed of the)3.03 F(GNU Bash-4.2)
72 768 Q(2004 Apr 20)148.735 E(19)198.725 E 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
@@ -2583,7 +2583,7 @@ to print a list of signal names and their corresponding num-)2.83 F 4.31
(is either a signal name de\214ned in <)4.62 F F4(signal.h)A F0 1.811
(>, or a signal number)B 6.811(.S)-.55 G(ignal)-6.811 E
(names are case insensiti)144 716.4 Q .3 -.15(ve a)-.25 H(nd the).15 E
F1(SIG)2.5 E F0(pre\214x is optional.)2.25 E(GNU Bash-4.0)72 768 Q
F1(SIG)2.5 E F0(pre\214x is optional.)2.25 E(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(20)198.725 E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
@@ -2725,7 +2725,7 @@ e maximum number of open \214le descriptors \(most systems do not allo)
(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F4
<ad71>144 717.6 Q F0
(The maximum number of bytes in POSIX message queues)24.74 E
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
@@ -2826,7 +2826,7 @@ F .726(The e)5.726 F .727(xit status is true unless a)-.15 F F2(name)
(Otherwise, the return status is the)5.457 F -.15(ex)144 564 S
(it status of the last process or job w).15 E(aited for)-.1 E(.)-.55 E
/F5 10.95/Times-Bold@0 SF(SEE ALSO)72 580.8 Q F0(bash\(1\), sh\(1\))108
592.8 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(22)198.725 E 0 Cg EP
592.8 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(22)198.725 E 0 Cg EP
%%Trailer
end
%%EOF
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Mon Jan 30 10:38:31 2012
%%CreationDate: Mon Mar 5 21:30:56 2012
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
+12 -2
View File
@@ -1,6 +1,6 @@
/* posixdir.h -- Posix directory reading includes and defines. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
/* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -46,16 +46,26 @@
# define D_NAMLEN(d) ((d)->d_namlen)
#endif /* !HAVE_DIRENT_H */
/* The bash code fairly consistenly uses d_fileno; make sure it's available */
#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO)
# define d_fileno d_ino
#endif
#if defined (_POSIX_SOURCE) && (!defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO))
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
#if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO)
# define REAL_DIR_ENTRY(dp) 1
#else
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
#endif /* _POSIX_SOURCE */
#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (BROKEN_DIRENT_D_INO)
# define D_INO_AVAILABLE
#endif
/* Signal the rest of the code that it can safely use dirent.d_fileno */
#if defined (D_INO_AVAILABLE) || defined (HAVE_STRUCT_DIRENT_D_FILENO)
# define D_FILENO_AVAILABLE 1
#endif
#endif /* !_POSIXDIR_H_ */
+62
View File
@@ -0,0 +1,62 @@
/* posixdir.h -- Posix directory reading includes and defines. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file should be included instead of <dirent.h> or <sys/dir.h>. */
#if !defined (_POSIXDIR_H_)
#define _POSIXDIR_H_
#if defined (HAVE_DIRENT_H)
# include <dirent.h>
# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN)
# define D_NAMLEN(d) ((d)->d_namlen)
# else
# define D_NAMLEN(d) (strlen ((d)->d_name))
# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */
#else
# if defined (HAVE_SYS_NDIR_H)
# include <sys/ndir.h>
# endif
# if defined (HAVE_SYS_DIR_H)
# include <sys/dir.h>
# endif
# if defined (HAVE_NDIR_H)
# include <ndir.h>
# endif
# if !defined (dirent)
# define dirent direct
# endif /* !dirent */
# define D_NAMLEN(d) ((d)->d_namlen)
#endif /* !HAVE_DIRENT_H */
#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO)
# define d_fileno d_ino
#endif
#if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
#else
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
# define D_INO_AVAILABLE 1
#endif /* _POSIX_SOURCE */
#endif /* !_POSIXDIR_H_ */
+214
View File
@@ -0,0 +1,214 @@
/* stat-related time functions.
Copyright (C) 2005, 2007, 2009-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 3 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#ifndef STAT_TIME_H
#define STAT_TIME_H 1
#include <sys/stat.h>
#if defined (TIME_H_DEFINES_STRUCT_TIMESPEC)
# include <time.h>
#elif defined (SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)
# include <sys/time.h>
#elif defined (PTHREAD_H_DEFINES_STRUCT_TIMESPEC)
# include <pthread.h>
#endif
#ifndef HAVE_STRUCT_TIMESPEC
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
#endif
/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim
for access, status change, data modification, or birth (creation)
time respectively.
These macros are private to stat-time.h. */
#if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
# ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
# else
# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
# endif
#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec)
#endif
/* Return the nanosecond component of *ST's access time. */
static inline long int
get_stat_atime_ns (struct stat const *st)
{
# if defined STAT_TIMESPEC
return STAT_TIMESPEC (st, st_atim).tv_nsec;
# elif defined STAT_TIMESPEC_NS
return STAT_TIMESPEC_NS (st, st_atim);
# else
return 0;
# endif
}
/* Return the nanosecond component of *ST's status change time. */
static inline long int
get_stat_ctime_ns (struct stat const *st)
{
# if defined STAT_TIMESPEC
return STAT_TIMESPEC (st, st_ctim).tv_nsec;
# elif defined STAT_TIMESPEC_NS
return STAT_TIMESPEC_NS (st, st_ctim);
# else
return 0;
# endif
}
/* Return the nanosecond component of *ST's data modification time. */
static inline long int
get_stat_mtime_ns (struct stat const *st)
{
# if defined STAT_TIMESPEC
return STAT_TIMESPEC (st, st_mtim).tv_nsec;
# elif defined STAT_TIMESPEC_NS
return STAT_TIMESPEC_NS (st, st_mtim);
# else
return 0;
# endif
}
/* Return the nanosecond component of *ST's birth time. */
static inline long int
get_stat_birthtime_ns (struct stat const *st)
{
# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
return STAT_TIMESPEC_NS (st, st_birthtim);
# else
/* Avoid a "parameter unused" warning. */
(void) st;
return 0;
# endif
}
/* Return *ST's access time. */
static inline struct timespec
get_stat_atime (struct stat const *st)
{
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_atim);
#else
struct timespec t;
t.tv_sec = st->st_atime;
t.tv_nsec = get_stat_atime_ns (st);
return t;
#endif
}
/* Return *ST's status change time. */
static inline struct timespec
get_stat_ctime (struct stat const *st)
{
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_ctim);
#else
struct timespec t;
t.tv_sec = st->st_ctime;
t.tv_nsec = get_stat_ctime_ns (st);
return t;
#endif
}
/* Return *ST's data modification time. */
static inline struct timespec
get_stat_mtime (struct stat const *st)
{
#ifdef STAT_TIMESPEC
return STAT_TIMESPEC (st, st_mtim);
#else
struct timespec t;
t.tv_sec = st->st_mtime;
t.tv_nsec = get_stat_mtime_ns (st);
return t;
#endif
}
static inline int
timespec_cmp (struct timespec a, struct timespec b)
{
return (a.tv_sec < b.tv_sec
? -1
: (a.tv_sec > b.tv_sec
? 1
: (int) (a.tv_nsec - b.tv_nsec)));
}
/* Return *ST's birth time, if available; otherwise return a value
with tv_sec and tv_nsec both equal to -1. */
static inline struct timespec
get_stat_birthtime (struct stat const *st)
{
struct timespec t;
#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
t = STAT_TIMESPEC (st, st_birthtim);
#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
t.tv_sec = st->st_birthtime;
t.tv_nsec = st->st_birthtimensec;
#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Windows platforms (but not Cygwin) put the "file creation
time" in st_ctime (!). See
<http://msdn2.microsoft.com/de-de/library/14h5k7ff(VS.80).aspx>. */
t.tv_sec = st->st_ctime;
t.tv_nsec = 0;
#else
/* Birth time is not supported. */
t.tv_sec = -1;
t.tv_nsec = -1;
/* Avoid a "parameter unused" warning. */
(void) st;
#endif
#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
/* FreeBSD and NetBSD sometimes signal the absence of knowledge by
using zero. Attempt to work around this problem. Alas, this can
report failure even for valid time stamps. Also, NetBSD
sometimes returns junk in the birth time fields; work around this
bug if it is detected. */
if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
{
t.tv_sec = -1;
t.tv_nsec = -1;
}
#endif
return t;
}
#endif
+5 -3
View File
@@ -221,7 +221,7 @@ int already_making_children = 0;
/* If this is non-zero, $LINES and $COLUMNS are reset after every process
exits from get_tty_state(). */
int check_window_size;
int check_window_size = CHECKWINSIZE_DEFAULT;
/* Functions local to this file. */
@@ -3220,8 +3220,10 @@ waitchld (wpid, block)
wait_signal_received = SIGCHLD;
longjmp (wait_intr_buf, 1);
}
run_sigchld_trap (children_exited);
else if (sigchld) /* called from signal handler */
queue_sigchld_trap (children_exited);
else
run_sigchld_trap (children_exited);
}
/* We have successfully recorded the useful information about this process
+4314
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -138,9 +138,11 @@ _rl_signal_handler (sig)
{
_rl_caught_signal = 0; /* XXX */
#if defined (SIGWINCH)
if (sig == SIGWINCH)
rl_resize_terminal ();
else
#endif
_rl_handle_signal (sig);
SIGHANDLER_RETURN;
}
+698
View File
@@ -0,0 +1,698 @@
/* signals.c -- signal handling support for readline. */
/* Copyright (C) 1987-2011 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
Readline 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 3 of the License, or
(at your option) any later version.
Readline 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 Readline. If not, see <http://www.gnu.org/licenses/>.
*/
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h> /* Just for NULL. Yuck. */
#include <sys/types.h>
#include <signal.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
/* System-specific feature definitions and include files. */
#include "rldefs.h"
#if defined (GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL */
/* Some standard library routines. */
#include "readline.h"
#include "history.h"
#include "rlprivate.h"
#if defined (HANDLE_SIGNALS)
#if !defined (RETSIGTYPE)
# if defined (VOID_SIGHANDLER)
# define RETSIGTYPE void
# else
# define RETSIGTYPE int
# endif /* !VOID_SIGHANDLER */
#endif /* !RETSIGTYPE */
#if defined (VOID_SIGHANDLER)
# define SIGHANDLER_RETURN return
#else
# define SIGHANDLER_RETURN return (0)
#endif
/* This typedef is equivalent to the one for Function; it allows us
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
typedef RETSIGTYPE SigHandler ();
#if defined (HAVE_POSIX_SIGNALS)
typedef struct sigaction sighandler_cxt;
# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
#else
typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt;
# define sigemptyset(m)
#endif /* !HAVE_POSIX_SIGNALS */
#ifndef SA_RESTART
# define SA_RESTART 0
#endif
static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *));
static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *));
static RETSIGTYPE rl_signal_handler PARAMS((int));
static RETSIGTYPE _rl_handle_signal PARAMS((int));
/* Exported variables for use by applications. */
/* If non-zero, readline will install its own signal handlers for
SIGINT, SIGTERM, SIGHUP, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
int rl_catch_signals = 1;
/* If non-zero, readline will install a signal handler for SIGWINCH. */
#ifdef SIGWINCH
int rl_catch_sigwinch = 1;
#else
int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */
#endif
/* Private variables. */
int _rl_interrupt_immediately = 0;
int volatile _rl_caught_signal = 0; /* should be sig_atomic_t, but that requires including <signal.h> everywhere */
/* If non-zero, print characters corresponding to received signals as long as
the user has indicated his desire to do so (_rl_echo_control_chars). */
int _rl_echoctl = 0;
int _rl_intr_char = 0;
int _rl_quit_char = 0;
int _rl_susp_char = 0;
static int signals_set_flag;
static int sigwinch_set_flag;
/* **************************************************************** */
/* */
/* Signal Handling */
/* */
/* **************************************************************** */
static sighandler_cxt old_int, old_term, old_hup, old_alrm, old_quit;
#if defined (SIGTSTP)
static sighandler_cxt old_tstp, old_ttou, old_ttin;
#endif
#if defined (SIGWINCH)
static sighandler_cxt old_winch;
#endif
_rl_sigcleanup_func_t *_rl_sigcleanup;
void *_rl_sigcleanarg;
/* Readline signal handler functions. */
/* Called from RL_CHECK_SIGNALS() macro */
RETSIGTYPE
_rl_signal_handler (sig)
int sig;
{
_rl_caught_signal = 0; /* XXX */
if (sig == SIGWINCH)
rl_resize_terminal ();
else
_rl_handle_signal (sig);
SIGHANDLER_RETURN;
}
static RETSIGTYPE
rl_signal_handler (sig)
int sig;
{
if (_rl_interrupt_immediately)
{
_rl_interrupt_immediately = 0;
_rl_handle_signal (sig);
}
else
_rl_caught_signal = sig;
SIGHANDLER_RETURN;
}
static RETSIGTYPE
_rl_handle_signal (sig)
int sig;
{
#if defined (HAVE_POSIX_SIGNALS)
sigset_t set;
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
long omask;
# else /* !HAVE_BSD_SIGNALS */
sighandler_cxt dummy_cxt; /* needed for rl_set_sighandler call */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
RL_SETSTATE(RL_STATE_SIGHANDLER);
#if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS)
/* Since the signal will not be blocked while we are in the signal
handler, ignore it until rl_clear_signals resets the catcher. */
# if defined (SIGALRM)
if (sig == SIGINT || sig == SIGALRM)
# else
if (sig == SIGINT)
# endif
rl_set_sighandler (sig, SIG_IGN, &dummy_cxt);
#endif /* !HAVE_BSD_SIGNALS && !HAVE_POSIX_SIGNALS */
/* If there's a sig cleanup function registered, call it and `deregister'
the cleanup function to avoid multiple calls */
if (_rl_sigcleanup)
{
(*_rl_sigcleanup) (sig, _rl_sigcleanarg);
_rl_sigcleanup = 0;
_rl_sigcleanarg = 0;
}
switch (sig)
{
case SIGINT:
_rl_reset_completion_state ();
rl_free_line_state ();
/* FALLTHROUGH */
case SIGTERM:
case SIGHUP:
#if defined (SIGTSTP)
case SIGTSTP:
case SIGTTOU:
case SIGTTIN:
#endif /* SIGTSTP */
#if defined (SIGALRM)
case SIGALRM:
#endif
#if defined (SIGQUIT)
case SIGQUIT:
#endif
rl_echo_signal_char (sig);
rl_cleanup_after_signal ();
#if defined (HAVE_POSIX_SIGNALS)
sigemptyset (&set);
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
sigdelset (&set, sig);
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
omask = sigblock (0);
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
#if defined (__EMX__)
signal (sig, SIG_ACK);
#endif
#if defined (HAVE_KILL)
kill (getpid (), sig);
#else
raise (sig); /* assume we have raise */
#endif
/* Let the signal that we just sent through. */
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL);
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
sigsetmask (omask & ~(sigmask (sig)));
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
rl_reset_after_signal ();
}
RL_UNSETSTATE(RL_STATE_SIGHANDLER);
SIGHANDLER_RETURN;
}
#if defined (SIGWINCH)
static RETSIGTYPE
rl_sigwinch_handler (sig)
int sig;
{
SigHandler *oh;
#if defined (MUST_REINSTALL_SIGHANDLERS)
sighandler_cxt dummy_winch;
/* We don't want to change old_winch -- it holds the state of SIGWINCH
disposition set by the calling application. We need this state
because we call the application's SIGWINCH handler after updating
our own idea of the screen size. */
rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch);
#endif
RL_SETSTATE(RL_STATE_SIGHANDLER);
_rl_caught_signal = sig;
/* If another sigwinch handler has been installed, call it. */
oh = (SigHandler *)old_winch.sa_handler;
if (oh && oh != (SigHandler *)SIG_IGN && oh != (SigHandler *)SIG_DFL)
(*oh) (sig);
RL_UNSETSTATE(RL_STATE_SIGHANDLER);
SIGHANDLER_RETURN;
}
#endif /* SIGWINCH */
/* Functions to manage signal handling. */
#if !defined (HAVE_POSIX_SIGNALS)
static int
rl_sigaction (sig, nh, oh)
int sig;
sighandler_cxt *nh, *oh;
{
oh->sa_handler = signal (sig, nh->sa_handler);
return 0;
}
#endif /* !HAVE_POSIX_SIGNALS */
/* Set up a readline-specific signal handler, saving the old signal
information in OHANDLER. Return the old signal handler, like
signal(). */
static SigHandler *
rl_set_sighandler (sig, handler, ohandler)
int sig;
SigHandler *handler;
sighandler_cxt *ohandler;
{
sighandler_cxt old_handler;
#if defined (HAVE_POSIX_SIGNALS)
struct sigaction act;
act.sa_handler = handler;
# if defined (SIGWINCH)
act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0;
# else
act.sa_flags = 0;
# endif /* SIGWINCH */
sigemptyset (&act.sa_mask);
sigemptyset (&ohandler->sa_mask);
sigaction (sig, &act, &old_handler);
#else
old_handler.sa_handler = (SigHandler *)signal (sig, handler);
#endif /* !HAVE_POSIX_SIGNALS */
/* XXX -- assume we have memcpy */
/* If rl_set_signals is called twice in a row, don't set the old handler to
rl_signal_handler, because that would cause infinite recursion. */
if (handler != rl_signal_handler || old_handler.sa_handler != rl_signal_handler)
memcpy (ohandler, &old_handler, sizeof (sighandler_cxt));
return (ohandler->sa_handler);
}
static void
rl_maybe_set_sighandler (sig, handler, ohandler)
int sig;
SigHandler *handler;
sighandler_cxt *ohandler;
{
sighandler_cxt dummy;
SigHandler *oh;
sigemptyset (&dummy.sa_mask);
oh = rl_set_sighandler (sig, handler, ohandler);
if (oh == (SigHandler *)SIG_IGN)
rl_sigaction (sig, ohandler, &dummy);
}
int
rl_set_signals ()
{
sighandler_cxt dummy;
SigHandler *oh;
#if defined (HAVE_POSIX_SIGNALS)
static int sigmask_set = 0;
static sigset_t bset, oset;
#endif
#if defined (HAVE_POSIX_SIGNALS)
if (rl_catch_signals && sigmask_set == 0)
{
sigemptyset (&bset);
sigaddset (&bset, SIGINT);
sigaddset (&bset, SIGTERM);
sigaddset (&bset, SIGHUP);
#if defined (SIGQUIT)
sigaddset (&bset, SIGQUIT);
#endif
#if defined (SIGALRM)
sigaddset (&bset, SIGALRM);
#endif
#if defined (SIGTSTP)
sigaddset (&bset, SIGTSTP);
#endif
#if defined (SIGTTIN)
sigaddset (&bset, SIGTTIN);
#endif
#if defined (SIGTTOU)
sigaddset (&bset, SIGTTOU);
#endif
sigmask_set = 1;
}
#endif /* HAVE_POSIX_SIGNALS */
if (rl_catch_signals && signals_set_flag == 0)
{
#if defined (HAVE_POSIX_SIGNALS)
sigemptyset (&oset);
sigprocmask (SIG_BLOCK, &bset, &oset);
#endif
rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
rl_maybe_set_sighandler (SIGHUP, rl_signal_handler, &old_hup);
#if defined (SIGQUIT)
rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
#endif
#if defined (SIGALRM)
oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
if (oh == (SigHandler *)SIG_IGN)
rl_sigaction (SIGALRM, &old_alrm, &dummy);
#if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART)
/* If the application using readline has already installed a signal
handler with SA_RESTART, SIGALRM will cause reads to be restarted
automatically, so readline should just get out of the way. Since
we tested for SIG_IGN above, we can just test for SIG_DFL here. */
if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
rl_sigaction (SIGALRM, &old_alrm, &dummy);
#endif /* HAVE_POSIX_SIGNALS */
#endif /* SIGALRM */
#if defined (SIGTSTP)
rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
#endif /* SIGTSTP */
#if defined (SIGTTOU)
rl_maybe_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou);
#endif /* SIGTTOU */
#if defined (SIGTTIN)
rl_maybe_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin);
#endif /* SIGTTIN */
signals_set_flag = 1;
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
#endif
}
#if defined (SIGWINCH)
if (rl_catch_sigwinch && sigwinch_set_flag == 0)
{
rl_maybe_set_sighandler (SIGWINCH, rl_sigwinch_handler, &old_winch);
sigwinch_set_flag = 1;
}
#endif /* SIGWINCH */
return 0;
}
int
rl_clear_signals ()
{
sighandler_cxt dummy;
if (rl_catch_signals && signals_set_flag == 1)
{
sigemptyset (&dummy.sa_mask);
rl_sigaction (SIGINT, &old_int, &dummy);
rl_sigaction (SIGTERM, &old_term, &dummy);
rl_sigaction (SIGHUP, &old_hup, &dummy);
#if defined (SIGQUIT)
rl_sigaction (SIGQUIT, &old_quit, &dummy);
#endif
#if defined (SIGALRM)
rl_sigaction (SIGALRM, &old_alrm, &dummy);
#endif
#if defined (SIGTSTP)
rl_sigaction (SIGTSTP, &old_tstp, &dummy);
#endif /* SIGTSTP */
#if defined (SIGTTOU)
rl_sigaction (SIGTTOU, &old_ttou, &dummy);
#endif /* SIGTTOU */
#if defined (SIGTTIN)
rl_sigaction (SIGTTIN, &old_ttin, &dummy);
#endif /* SIGTTIN */
signals_set_flag = 0;
}
#if defined (SIGWINCH)
if (rl_catch_sigwinch && sigwinch_set_flag == 1)
{
sigemptyset (&dummy.sa_mask);
rl_sigaction (SIGWINCH, &old_winch, &dummy);
sigwinch_set_flag = 0;
}
#endif
return 0;
}
/* Clean up the terminal and readline state after catching a signal, before
resending it to the calling application. */
void
rl_cleanup_after_signal ()
{
_rl_clean_up_for_exit ();
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
rl_clear_pending_input ();
rl_clear_signals ();
}
/* Reset the terminal and readline state after a signal handler returns. */
void
rl_reset_after_signal ()
{
if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag);
rl_set_signals ();
}
/* Free up the readline variable line state for the current line (undo list,
any partial history entry, any keyboard macros in progress, and any
numeric arguments in process) after catching a signal, before calling
rl_cleanup_after_signal(). */
void
rl_free_line_state ()
{
register HIST_ENTRY *entry;
rl_free_undo_list ();
entry = current_history ();
if (entry)
entry->data = (char *)NULL;
_rl_kill_kbd_macro ();
rl_clear_message ();
_rl_reset_argument ();
}
#endif /* HANDLE_SIGNALS */
/* **************************************************************** */
/* */
/* SIGINT Management */
/* */
/* **************************************************************** */
#if defined (HAVE_POSIX_SIGNALS)
static sigset_t sigint_set, sigint_oset;
static sigset_t sigwinch_set, sigwinch_oset;
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
static int sigint_oldmask;
static int sigwinch_oldmask;
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
static int sigint_blocked;
static int sigwinch_blocked;
/* Cause SIGINT to not be delivered until the corresponding call to
release_sigint(). */
void
_rl_block_sigint ()
{
if (sigint_blocked)
return;
#if defined (HAVE_POSIX_SIGNALS)
sigemptyset (&sigint_set);
sigemptyset (&sigint_oset);
sigaddset (&sigint_set, SIGINT);
sigprocmask (SIG_BLOCK, &sigint_set, &sigint_oset);
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
sigint_oldmask = sigblock (sigmask (SIGINT));
# else /* !HAVE_BSD_SIGNALS */
# if defined (HAVE_USG_SIGHOLD)
sighold (SIGINT);
# endif /* HAVE_USG_SIGHOLD */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
sigint_blocked = 1;
}
/* Allow SIGINT to be delivered. */
void
_rl_release_sigint ()
{
if (sigint_blocked == 0)
return;
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_SETMASK, &sigint_oset, (sigset_t *)NULL);
#else
# if defined (HAVE_BSD_SIGNALS)
sigsetmask (sigint_oldmask);
# else /* !HAVE_BSD_SIGNALS */
# if defined (HAVE_USG_SIGHOLD)
sigrelse (SIGINT);
# endif /* HAVE_USG_SIGHOLD */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
sigint_blocked = 0;
}
/* Cause SIGWINCH to not be delivered until the corresponding call to
release_sigwinch(). */
void
_rl_block_sigwinch ()
{
if (sigwinch_blocked)
return;
#if defined (SIGWINCH)
#if defined (HAVE_POSIX_SIGNALS)
sigemptyset (&sigwinch_set);
sigemptyset (&sigwinch_oset);
sigaddset (&sigwinch_set, SIGWINCH);
sigprocmask (SIG_BLOCK, &sigwinch_set, &sigwinch_oset);
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
sigwinch_oldmask = sigblock (sigmask (SIGWINCH));
# else /* !HAVE_BSD_SIGNALS */
# if defined (HAVE_USG_SIGHOLD)
sighold (SIGWINCH);
# endif /* HAVE_USG_SIGHOLD */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
#endif /* SIGWINCH */
sigwinch_blocked = 1;
}
/* Allow SIGWINCH to be delivered. */
void
_rl_release_sigwinch ()
{
if (sigwinch_blocked == 0)
return;
#if defined (SIGWINCH)
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_SETMASK, &sigwinch_oset, (sigset_t *)NULL);
#else
# if defined (HAVE_BSD_SIGNALS)
sigsetmask (sigwinch_oldmask);
# else /* !HAVE_BSD_SIGNALS */
# if defined (HAVE_USG_SIGHOLD)
sigrelse (SIGWINCH);
# endif /* HAVE_USG_SIGHOLD */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
#endif /* SIGWINCH */
sigwinch_blocked = 0;
}
/* **************************************************************** */
/* */
/* Echoing special control characters */
/* */
/* **************************************************************** */
void
rl_echo_signal_char (sig)
int sig;
{
char cstr[3];
int cslen, c;
if (_rl_echoctl == 0 || _rl_echo_control_chars == 0)
return;
switch (sig)
{
case SIGINT: c = _rl_intr_char; break;
#if defined (SIGQUIT)
case SIGQUIT: c = _rl_quit_char; break;
#endif
#if defined (SIGTSTP)
case SIGTSTP: c = _rl_susp_char; break;
#endif
default: return;
}
if (CTRL_CHAR (c) || c == RUBOUT)
{
cstr[0] = '^';
cstr[1] = CTRL_CHAR (c) ? UNCTRL (c) : '?';
cstr[cslen = 2] = '\0';
}
else
{
cstr[0] = c;
cstr[cslen = 1] = '\0';
}
_rl_output_some_chars (cstr, cslen);
}
+3 -3
View File
@@ -48,7 +48,7 @@
#include <bashansi.h>
#if defined (BROKEN_DIRENT_D_INO)
#if !defined (D_FILENO_AVAILABLE)
# include "command.h"
# include "general.h"
# include "externs.h"
@@ -71,7 +71,7 @@ extern int errno;
/* If the d_fileno member of a struct dirent doesn't return anything useful,
we need to check inode number equivalence the hard way. Return 1 if
the inode corresponding to PATH/DIR is identical to THISINO. */
#if defined (BROKEN_DIRENT_D_INO)
#if !defined (D_FILENO_AVAILABLE)
static int
_path_checkino (dotp, name, thisino)
char *dotp;
@@ -206,7 +206,7 @@ getcwd (buf, size)
(d->d_name[1] == '\0' ||
(d->d_name[1] == '.' && d->d_name[2] == '\0')))
continue;
#if !defined (BROKEN_DIRENT_D_INO)
#if defined (D_FILENO_AVAILABLE)
if (mount_point || d->d_fileno == thisino)
#else
if (mount_point || _path_checkino (dotp, d->d_name, thisino))
+356
View File
@@ -0,0 +1,356 @@
/* getcwd.c -- get pathname of current directory */
/* Copyright (C) 1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if !defined (HAVE_GETCWD)
#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX)
#pragma alloca
#endif /* _AIX && RISC6000 && !__GNUC__ */
#if defined (__QNX__)
# undef HAVE_LSTAT
#endif
#include <bashtypes.h>
#include <errno.h>
#if defined (HAVE_LIMITS_H)
# include <limits.h>
#endif
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <posixdir.h>
#include <posixstat.h>
#include <maxpath.h>
#include <memalloc.h>
#include <bashansi.h>
#if defined (BROKEN_DIRENT_D_INO)
# include "command.h"
# include "general.h"
# include "externs.h"
#endif
#include <xmalloc.h>
#if !defined (errno)
extern int errno;
#endif /* !errno */
#if !defined (HAVE_LSTAT)
# define lstat stat
#endif
#if !defined (NULL)
# define NULL 0
#endif
/* If the d_fileno member of a struct dirent doesn't return anything useful,
we need to check inode number equivalence the hard way. Return 1 if
the inode corresponding to PATH/DIR is identical to THISINO. */
#if defined (BROKEN_DIRENT_D_INO)
static int
_path_checkino (dotp, name, thisino)
char *dotp;
char *name;
ino_t thisino;
{
char *fullpath;
int r, e;
struct stat st;
e = errno;
fullpath = sh_makepath (dotp, name, MP_RMDOT);
if (stat (fullpath, &st) < 0)
{
errno = e;
return 0;
}
free (fullpath);
errno = e;
return (st.st_ino == thisino);
}
#endif
/* Get the pathname of the current working directory,
and put it in SIZE bytes of BUF. Returns NULL if the
directory couldn't be determined or SIZE was too small.
If successful, returns BUF. In GNU, if BUF is NULL,
an array is allocated with `malloc'; the array is SIZE
bytes long, unless SIZE <= 0, in which case it is as
big as necessary. */
#if defined (__STDC__)
char *
getcwd (char *buf, size_t size)
#else /* !__STDC__ */
char *
getcwd (buf, size)
char *buf;
size_t size;
#endif /* !__STDC__ */
{
static const char dots[]
= "../../../../../../../../../../../../../../../../../../../../../../../\
../../../../../../../../../../../../../../../../../../../../../../../../../../\
../../../../../../../../../../../../../../../../../../../../../../../../../..";
const char *dotp, *dotlist;
size_t dotsize;
dev_t rootdev, thisdev;
ino_t rootino, thisino;
char path[PATH_MAX + 1];
register char *pathp;
char *pathbuf;
size_t pathsize;
struct stat st;
int saved_errno;
if (buf != NULL && size == 0)
{
errno = EINVAL;
return ((char *)NULL);
}
pathsize = sizeof (path);
pathp = &path[pathsize];
*--pathp = '\0';
pathbuf = path;
if (stat (".", &st) < 0)
return ((char *)NULL);
thisdev = st.st_dev;
thisino = st.st_ino;
if (stat ("/", &st) < 0)
return ((char *)NULL);
rootdev = st.st_dev;
rootino = st.st_ino;
saved_errno = 0;
dotsize = sizeof (dots) - 1;
dotp = &dots[sizeof (dots)];
dotlist = dots;
while (!(thisdev == rootdev && thisino == rootino))
{
register DIR *dirstream;
register struct dirent *d;
dev_t dotdev;
ino_t dotino;
char mount_point;
int namlen;
/* Look at the parent directory. */
if (dotp == dotlist)
{
/* My, what a deep directory tree you have, Grandma. */
char *new;
if (dotlist == dots)
{
new = (char *)malloc (dotsize * 2 + 1);
if (new == NULL)
goto lose;
memcpy (new, dots, dotsize);
}
else
{
new = (char *)realloc ((PTR_T) dotlist, dotsize * 2 + 1);
if (new == NULL)
goto lose;
}
memcpy (&new[dotsize], new, dotsize);
dotp = &new[dotsize];
dotsize *= 2;
new[dotsize] = '\0';
dotlist = new;
}
dotp -= 3;
/* Figure out if this directory is a mount point. */
if (stat (dotp, &st) < 0)
goto lose;
dotdev = st.st_dev;
dotino = st.st_ino;
mount_point = dotdev != thisdev;
/* Search for the last directory. */
dirstream = opendir (dotp);
if (dirstream == NULL)
goto lose;
while ((d = readdir (dirstream)) != NULL)
{
if (d->d_name[0] == '.' &&
(d->d_name[1] == '\0' ||
(d->d_name[1] == '.' && d->d_name[2] == '\0')))
continue;
#if !defined (BROKEN_DIRENT_D_INO)
if (mount_point || d->d_fileno == thisino)
#else
if (mount_point || _path_checkino (dotp, d->d_name, thisino))
#endif
{
char *name;
namlen = D_NAMLEN(d);
name = (char *)
alloca (dotlist + dotsize - dotp + 1 + namlen + 1);
memcpy (name, dotp, dotlist + dotsize - dotp);
name[dotlist + dotsize - dotp] = '/';
memcpy (&name[dotlist + dotsize - dotp + 1],
d->d_name, namlen + 1);
if (lstat (name, &st) < 0)
{
#if 0
int save = errno;
(void) closedir (dirstream);
errno = save;
goto lose;
#else
saved_errno = errno;
#endif
}
if (st.st_dev == thisdev && st.st_ino == thisino)
break;
}
}
if (d == NULL)
{
#if 0
int save = errno;
#else
int save = errno ? errno : saved_errno;
#endif
(void) closedir (dirstream);
errno = save;
goto lose;
}
else
{
size_t space;
while ((space = pathp - pathbuf) <= namlen)
{
char *new;
if (pathbuf == path)
{
new = (char *)malloc (pathsize * 2);
if (!new)
goto lose;
}
else
{
new = (char *)realloc ((PTR_T) pathbuf, (pathsize * 2));
if (!new)
goto lose;
pathp = new + space;
}
(void) memcpy (new + pathsize + space, pathp, pathsize - space);
pathp = new + pathsize + space;
pathbuf = new;
pathsize *= 2;
}
pathp -= namlen;
(void) memcpy (pathp, d->d_name, namlen);
*--pathp = '/';
(void) closedir (dirstream);
}
thisdev = dotdev;
thisino = dotino;
}
if (pathp == &path[sizeof(path) - 1])
*--pathp = '/';
if (dotlist != dots)
free ((PTR_T) dotlist);
{
size_t len = pathbuf + pathsize - pathp;
if (buf == NULL && size <= 0)
size = len;
if ((size_t) size < len)
{
errno = ERANGE;
goto lose2;
}
if (buf == NULL)
{
buf = (char *) malloc (size);
if (buf == NULL)
goto lose2;
}
(void) memcpy((PTR_T) buf, (PTR_T) pathp, len);
}
if (pathbuf != path)
free (pathbuf);
return (buf);
lose:
if ((dotlist != dots) && dotlist)
{
int e = errno;
free ((PTR_T) dotlist);
errno = e;
}
lose2:
if ((pathbuf != path) && pathbuf)
{
int e = errno;
free ((PTR_T) pathbuf);
errno = e;
}
return ((char *)NULL);
}
#if defined (TEST)
# include <stdio.h>
main (argc, argv)
int argc;
char **argv;
{
char b[PATH_MAX];
if (getcwd(b, sizeof(b)))
{
printf ("%s\n", b);
exit (0);
}
else
{
perror ("cwd: getcwd");
exit (1);
}
}
#endif /* TEST */
#endif /* !HAVE_GETCWD */
+43 -5
View File
@@ -91,6 +91,13 @@ stub_charset ()
void
u32reset ()
{
#if defined (HAVE_ICONV)
if (u32init && localconv != (iconv_t)-1)
{
iconv_close (localconv);
localconv = (iconv_t)-1;
}
#endif
u32init = 0;
utf8locale = 0;
}
@@ -123,6 +130,20 @@ u32tochar (x, s)
return l;
}
int
u32tocesc (wc, s)
u_bits32_t wc;
char *s;
{
int l;
if (wc < 0x10000)
l = sprintf (s, "\\u%04X", wc);
else
l = sprintf (s, "\\u%08X", wc);
return l;
}
/* Convert unsigned 32-bit int to utf-8 character string */
int
u32toutf8 (wc, s)
@@ -144,6 +165,7 @@ u32toutf8 (wc, s)
}
else if (wc < 0x10000)
{
/* Technically, we could return 0 here if 0xd800 <= wc <= 0x0dfff */
s[0] = (wc >> 12) | 0xe0;
s[1] = ((wc >> 6) & 0x3f) | 0x80;
s[2] = (wc & 0x3f) | 0x80;
@@ -264,15 +286,23 @@ u32cconv (c, s)
{
localconv = iconv_open (charset, "UTF-8");
if (localconv == (iconv_t)-1)
localconv = iconv_open (charset, "ASCII");
/* We assume ASCII when presented with an unknown encoding. */
localconv = iconv_open ("ASCII", "UTF-8");
}
u32init = 1;
}
/* If we have a UTF-8 locale, convert to UTF-8 and return converted value. */
n = u32toutf8 (c, s);
if (utf8locale || localconv == (iconv_t)-1)
if (utf8locale)
return n;
/* If the conversion is not supported, even the ASCII requested above, we
bail now. Currently we return the UTF-8 conversion. We could return
u32tocesc(). */
if (localconv == (iconv_t)-1)
return n;
optr = obuf;
obytesleft = sizeof (obuf);
iptr = s;
@@ -281,7 +311,15 @@ u32cconv (c, s)
iconv (localconv, NULL, NULL, NULL, NULL);
if (iconv (localconv, (ICONV_CONST char **)&iptr, &sn, &optr, &obytesleft) == (size_t)-1)
return n; /* You get utf-8 if iconv fails */
{
#if 1
/* You get ISO C99 escape sequences if iconv fails */
n = u32tocesc (c, s);
#else
/* You get UTF-8 if iconv fails */
#endif
return n;
}
*optr = '\0';
@@ -289,9 +327,9 @@ u32cconv (c, s)
checking */
strcpy (s, obuf);
return (optr - obuf);
#endif
#endif /* HAVE_ICONV */
n = u32tochar (c, s); /* fallback */
n = u32tocesc (c, s); /* fallback is ISO C99 escape sequences */
return n;
}
#else
+340
View File
@@ -0,0 +1,340 @@
/* unicode.c - functions to convert unicode characters */
/* Copyright (C) 2010-2012 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if defined (HANDLE_MULTIBYTE)
#include <stdc.h>
#include <wchar.h>
#include <bashansi.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <limits.h>
#if HAVE_ICONV
# include <iconv.h>
#endif
#include <xmalloc.h>
#ifndef USHORT_MAX
# ifdef USHRT_MAX
# define USHORT_MAX USHRT_MAX
# else
# define USHORT_MAX ((unsigned short) ~(unsigned short)0)
# endif
#endif
#if !defined (STREQ)
# define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0)
#endif /* !STREQ */
#if defined (HAVE_LOCALE_CHARSET)
extern const char *locale_charset __P((void));
#else
extern char *get_locale_var __P((char *));
#endif
static int u32init = 0;
static int utf8locale = 0;
#if defined (HAVE_ICONV)
static iconv_t localconv;
#endif
#ifndef HAVE_LOCALE_CHARSET
static char charsetbuf[40];
static char *
stub_charset ()
{
char *locale, *s, *t;
locale = get_locale_var ("LC_CTYPE");
if (locale == 0 || *locale == 0)
{
strcpy (charsetbuf, "ASCII");
return charsetbuf;
}
s = strrchr (locale, '.');
if (s)
{
strcpy (charsetbuf, s+1);
t = strchr (charsetbuf, '@');
if (t)
*t = 0;
return charsetbuf;
}
strcpy (charsetbuf, locale);
return charsetbuf;
}
#endif
void
u32reset ()
{
#if defined (HAVE_ICONV)
if (u32init && localconv != (iconv_t)-1)
{
iconv_close (localconv);
localconv = (iconv_t)-1;
}
#endif
u32init = 0;
utf8locale = 0;
}
/* u32toascii ? */
int
u32tochar (x, s)
unsigned long x;
char *s;
{
int l;
l = (x <= UCHAR_MAX) ? 1 : ((x <= USHORT_MAX) ? 2 : 4);
if (x <= UCHAR_MAX)
s[0] = x & 0xFF;
else if (x <= USHORT_MAX) /* assume unsigned short = 16 bits */
{
s[0] = (x >> 8) & 0xFF;
s[1] = x & 0xFF;
}
else
{
s[0] = (x >> 24) & 0xFF;
s[1] = (x >> 16) & 0xFF;
s[2] = (x >> 8) & 0xFF;
s[3] = x & 0xFF;
}
s[l] = '\0';
return l;
}
int
u32tocesc (wc, s)
u_bits32_t wc;
char *s;
{
int l;
if (wc < 0x10000)
l = sprintf (s, "\\u%04X", wc);
else
l = sprintf (s, "\\u%08X", wc);
return l;
}
/* Convert unsigned 32-bit int to utf-8 character string */
int
u32toutf8 (wc, s)
u_bits32_t wc;
char *s;
{
int l;
if (wc < 0x0080)
{
s[0] = (char)wc;
l = 1;
}
else if (wc < 0x0800)
{
s[0] = (wc >> 6) | 0xc0;
s[1] = (wc & 0x3f) | 0x80;
l = 2;
}
else if (wc < 0x10000)
{
/* Technically, we could return 0 here if 0xd800 <= wc <= 0x0dfff */
s[0] = (wc >> 12) | 0xe0;
s[1] = ((wc >> 6) & 0x3f) | 0x80;
s[2] = (wc & 0x3f) | 0x80;
l = 3;
}
else if (wc < 0x200000)
{
s[0] = (wc >> 18) | 0xf0;
s[1] = ((wc >> 12) & 0x3f) | 0x80;
s[2] = ((wc >> 6) & 0x3f) | 0x80;
s[3] = (wc & 0x3f) | 0x80;
l = 4;
}
/* Strictly speaking, UTF-8 doesn't have characters longer than 4 bytes */
else if (wc < 0x04000000)
{
s[0] = (wc >> 24) | 0xf8;
s[1] = ((wc >> 18) & 0x3f) | 0x80;
s[2] = ((wc >> 12) & 0x3f) | 0x80;
s[3] = ((wc >> 6) & 0x3f) | 0x80;
s[4] = (wc & 0x3f) | 0x80;
l = 5;
}
else if (wc < 0x080000000)
{
s[0] = (wc >> 30) | 0xf8;
s[1] = ((wc >> 24) & 0x3f) | 0x80;
s[2] = ((wc >> 18) & 0x3f) | 0x80;
s[3] = ((wc >> 12) & 0x3f) | 0x80;
s[4] = ((wc >> 6) & 0x3f) | 0x80;
s[5] = (wc & 0x3f) | 0x80;
l = 6;
}
else
l = 0;
s[l] = '\0';
return l;
}
/* Convert a 32-bit unsigned int (unicode) to a UTF-16 string. Rarely used,
only if sizeof(wchar_t) == 2. */
int
u32toutf16 (c, s)
u_bits32_t c;
unsigned short *s;
{
int l;
l = 0;
if (c < 0x0d800)
{
s[0] = (unsigned short) (c & 0xFFFF);
l = 1;
}
else if (c >= 0x0e000 && c <= 0x010ffff)
{
c -= 0x010000;
s[0] = (unsigned short)((c >> 10) + 0xd800);
s[1] = (unsigned short)((c & 0x3ff) + 0xdc00);
l = 2;
}
s[l] = 0;
return l;
}
/* convert a single unicode-32 character into a multibyte string and put the
result in S, which must be large enough (at least MB_LEN_MAX bytes) */
int
u32cconv (c, s)
unsigned long c;
char *s;
{
wchar_t wc;
wchar_t ws[3];
int n;
#if HAVE_ICONV
const char *charset;
char obuf[25], *optr;
size_t obytesleft;
const char *iptr;
size_t sn;
#endif
#if __STDC_ISO_10646__
wc = c;
if (sizeof (wchar_t) == 4 && c <= 0x7fffffff)
n = wctomb (s, wc);
else if (sizeof (wchar_t) == 2 && c <= 0x10ffff && u32toutf16 (c, ws))
n = wcstombs (s, ws, MB_LEN_MAX);
else
n = -1;
if (n != -1)
return n;
#endif
#if HAVE_NL_LANGINFO
codeset = nl_langinfo (CODESET);
if (STREQ (codeset, "UTF-8"))
{
n = u32toutf8 (c, s);
return n;
}
#endif
#if HAVE_ICONV
/* this is mostly from coreutils-8.5/lib/unicodeio.c */
if (u32init == 0)
{
# if HAVE_LOCALE_CHARSET
charset = locale_charset (); /* XXX - fix later */
# else
charset = stub_charset ();
# endif
if (STREQ (charset, "UTF-8"))
utf8locale = 1;
else
{
localconv = iconv_open (charset, "UTF-8");
if (localconv == (iconv_t)-1)
/* We assume ASCII when presented with an unknown encoding. */
localconv = iconv_open ("ASCII", "UTF-8");
}
u32init = 1;
}
/* If we have a UTF-8 locale, convert to UTF-8 and return converted value. */
n = u32toutf8 (c, s);
if (utf8locale)
return n;
/* If the conversion is not supported, even the ASCII requested above, we
bail now. Currently we return the UTF-8 conversion. We could return
u32cesc(). */
if (localconv == (iconv_t)-1)
return n;
optr = obuf;
obytesleft = sizeof (obuf);
iptr = s;
sn = n;
iconv (localconv, NULL, NULL, NULL, NULL);
if (iconv (localconv, (ICONV_CONST char **)&iptr, &sn, &optr, &obytesleft) == (size_t)-1)
{
#if 1
/* You get ISO C99 escape sequences if iconv fails */
n = u32tocesc (c, s);
#else
/* You get UTF-8 if iconv fails */
#endif
return n;
}
*optr = '\0';
/* number of chars to be copied is optr - obuf if we want to do bounds
checking */
strcpy (s, obuf);
return (optr - obuf);
#endif /* HAVE_ICONV */
n = u32tocesc (c, s); /* fallback is ISO C99 escape sequences */
return n;
}
#else
void
u32reset ()
{
}
#endif /* HANDLE_MULTIBYTE */
+61
View File
@@ -0,0 +1,61 @@
# Checks for stat-related time functions.
# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2012 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
dnl Modified by Chet Ramey for bash.
# st_atim.tv_nsec - Linux, Solaris, Cygwin
# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
# st_birthtim - Cygwin 1.7.0+
AC_DEFUN([BASH_STAT_TIME],
[
AC_REQUIRE([AC_C_INLINE])
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
[AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
[ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <sys/stat.h>
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
struct timespec ts;
struct stat st;
]],
[[
st.st_atim = ts;
]])],
[ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
[ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
[Define to 1 if the type of the st_atim member of a struct stat is
struct timespec.])
fi],
[AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
[AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
[AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
[#include <sys/types.h>
#include <sys/stat.h>])],
[#include <sys/types.h>
#include <sys/stat.h>])],
[#include <sys/types.h>
#include <sys/stat.h>])],
[#include <sys/types.h>
#include <sys/stat.h>])
])
+71
View File
@@ -0,0 +1,71 @@
# Configure checks for struct timespec
# Copyright (C) 2000-2001, 2003-2007, 2009-2011, 2012 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Original written by Paul Eggert and Jim Meyering.
# Modified by Chet Ramey for bash
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
dnl in time.h, sys/time.h, or pthread.h.
AC_DEFUN([BASH_CHECK_TYPE_STRUCT_TIMESPEC],
[
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CACHE_CHECK([for struct timespec in <time.h>],
[bash_cv_sys_struct_timespec_in_time_h],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <time.h>
]],
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
[bash_cv_sys_struct_timespec_in_time_h=yes],
[bash_cv_sys_struct_timespec_in_time_h=no])])
HAVE_STRUCT_TIMESPEC=0
TIME_H_DEFINES_STRUCT_TIMESPEC=0
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
if test $bash_cv_sys_struct_timespec_in_time_h = yes; then
AC_DEFINE([HAVE_STRUCT_TIMESPEC])
AC_DEFINE([TIME_H_DEFINES_STRUCT_TIMESPEC])
TIME_H_DEFINES_STRUCT_TIMESPEC=1
else
AC_CACHE_CHECK([for struct timespec in <sys/time.h>],
[bash_cv_sys_struct_timespec_in_sys_time_h],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/time.h>
]],
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
[bash_cv_sys_struct_timespec_in_sys_time_h=yes],
[bash_cv_sys_struct_timespec_in_sys_time_h=no])])
if test $bash_cv_sys_struct_timespec_in_sys_time_h = yes; then
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
AC_DEFINE([HAVE_STRUCT_TIMESPEC])
AC_DEFINE([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
else
AC_CACHE_CHECK([for struct timespec in <pthread.h>],
[bash_cv_sys_struct_timespec_in_pthread_h],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <pthread.h>
]],
[[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
[bash_cv_sys_struct_timespec_in_pthread_h=yes],
[bash_cv_sys_struct_timespec_in_pthread_h=no])])
if test $bash_cv_sys_struct_timespec_in_pthread_h = yes; then
PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
AC_DEFINE([HAVE_STRUCT_TIMESPEC])
AC_DEFINE([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
fi
fi
fi
AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
])
+6 -1
View File
@@ -94,7 +94,7 @@ int shell_tty = -1;
/* If this is non-zero, $LINES and $COLUMNS are reset after every process
exits from get_tty_state(). */
int check_window_size;
int check_window_size = CHECKWINSIZE_DEFAULT;
/* STATUS and FLAGS are only valid if pid != NO_PID
STATUS is only valid if (flags & PROC_RUNNING) == 0 */
@@ -447,6 +447,11 @@ reap_zombie_children ()
#endif /* WAITPID */
#if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS)
#if !defined (SA_RESTART)
# define SA_RESTART 0
#endif
static int
siginterrupt (sig, flag)
int sig, flag;
+954
View File
@@ -0,0 +1,954 @@
/* nojobs.c - functions that make children, remember them, and handle their termination. */
/* This file works under BSD, System V, minix, and Posix systems. It does
not implement job control. */
/* Copyright (C) 1987-2011 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "bashtypes.h"
#include "filecntl.h"
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#if defined (BUFFERED_INPUT)
# include "input.h"
#endif
/* Need to include this up here for *_TTY_DRIVER definitions. */
#include "shtty.h"
#include "bashintl.h"
#include "shell.h"
#include "jobs.h"
#include "execute_cmd.h"
#include "builtins/builtext.h" /* for wait_builtin */
#define DEFAULT_CHILD_MAX 32
#if defined (_POSIX_VERSION) || !defined (HAVE_KILLPG)
# define killpg(pg, sig) kill(-(pg),(sig))
#endif /* USG || _POSIX_VERSION */
#if !defined (HAVE_SIGINTERRUPT) && !defined (HAVE_POSIX_SIGNALS)
# define siginterrupt(sig, code)
#endif /* !HAVE_SIGINTERRUPT && !HAVE_POSIX_SIGNALS */
#if defined (HAVE_WAITPID)
# define WAITPID(pid, statusp, options) waitpid (pid, statusp, options)
#else
# define WAITPID(pid, statusp, options) wait (statusp)
#endif /* !HAVE_WAITPID */
/* Return the fd from which we are actually getting input. */
#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
#if !defined (errno)
extern int errno;
#endif /* !errno */
extern int interactive, interactive_shell, login_shell;
extern int subshell_environment;
extern int last_command_exit_value, last_command_exit_signal;
extern int interrupt_immediately;
extern sh_builtin_func_t *this_shell_builtin;
#if defined (HAVE_POSIX_SIGNALS)
extern sigset_t top_level_mask;
#endif
extern procenv_t wait_intr_buf;
extern int wait_signal_received;
pid_t last_made_pid = NO_PID;
pid_t last_asynchronous_pid = NO_PID;
/* Call this when you start making children. */
int already_making_children = 0;
/* The controlling tty for this shell. */
int shell_tty = -1;
/* If this is non-zero, $LINES and $COLUMNS are reset after every process
exits from get_tty_state(). */
int check_window_size;
/* STATUS and FLAGS are only valid if pid != NO_PID
STATUS is only valid if (flags & PROC_RUNNING) == 0 */
struct proc_status {
pid_t pid;
int status; /* Exit status of PID or 128 + fatal signal number */
int flags;
};
/* Values for proc_status.flags */
#define PROC_RUNNING 0x01
#define PROC_NOTIFIED 0x02
#define PROC_ASYNC 0x04
#define PROC_SIGNALED 0x10
/* Return values from find_status_by_pid */
#define PROC_BAD -1
#define PROC_STILL_ALIVE -2
static struct proc_status *pid_list = (struct proc_status *)NULL;
static int pid_list_size;
static int wait_sigint_received;
static long child_max = -1L;
static void alloc_pid_list __P((void));
static int find_proc_slot __P((void));
static int find_index_by_pid __P((pid_t));
static int find_status_by_pid __P((pid_t));
static int process_exit_status __P((WAIT));
static int find_termsig_by_pid __P((pid_t));
static int get_termsig __P((WAIT));
static void set_pid_status __P((pid_t, WAIT));
static void set_pid_flags __P((pid_t, int));
static void unset_pid_flags __P((pid_t, int));
static int get_pid_flags __P((pid_t));
static void add_pid __P((pid_t, int));
static void mark_dead_jobs_as_notified __P((int));
static sighandler wait_sigint_handler __P((int));
static char *j_strsignal __P((int));
#if defined (HAVE_WAITPID)
static void reap_zombie_children __P((void));
#endif
#if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS)
static int siginterrupt __P((int, int));
#endif
static void restore_sigint_handler __P((void));
/* Allocate new, or grow existing PID_LIST. */
static void
alloc_pid_list ()
{
register int i;
int old = pid_list_size;
pid_list_size += 10;
pid_list = (struct proc_status *)xrealloc (pid_list, pid_list_size * sizeof (struct proc_status));
/* None of the newly allocated slots have process id's yet. */
for (i = old; i < pid_list_size; i++)
pid_list[i].pid = NO_PID;
}
/* Return the offset within the PID_LIST array of an empty slot. This can
create new slots if all of the existing slots are taken. */
static int
find_proc_slot ()
{
register int i;
for (i = 0; i < pid_list_size; i++)
if (pid_list[i].pid == NO_PID)
return (i);
if (i == pid_list_size)
alloc_pid_list ();
return (i);
}
/* Return the offset within the PID_LIST array of a slot containing PID,
or the value NO_PID if the pid wasn't found. */
static int
find_index_by_pid (pid)
pid_t pid;
{
register int i;
for (i = 0; i < pid_list_size; i++)
if (pid_list[i].pid == pid)
return (i);
return (NO_PID);
}
/* Return the status of PID as looked up in the PID_LIST array. A
return value of PROC_BAD indicates that PID wasn't found. */
static int
find_status_by_pid (pid)
pid_t pid;
{
int i;
i = find_index_by_pid (pid);
if (i == NO_PID)
return (PROC_BAD);
if (pid_list[i].flags & PROC_RUNNING)
return (PROC_STILL_ALIVE);
return (pid_list[i].status);
}
static int
process_exit_status (status)
WAIT status;
{
if (WIFSIGNALED (status))
return (128 + WTERMSIG (status));
else
return (WEXITSTATUS (status));
}
/* Return the status of PID as looked up in the PID_LIST array. A
return value of PROC_BAD indicates that PID wasn't found. */
static int
find_termsig_by_pid (pid)
pid_t pid;
{
int i;
i = find_index_by_pid (pid);
if (i == NO_PID)
return (0);
if (pid_list[i].flags & PROC_RUNNING)
return (0);
return (get_termsig ((WAIT)pid_list[i].status));
}
/* Set LAST_COMMAND_EXIT_SIGNAL depending on STATUS. If STATUS is -1, look
up PID in the pid array and set LAST_COMMAND_EXIT_SIGNAL appropriately
depending on its flags and exit status. */
static int
get_termsig (status)
WAIT status;
{
if (WIFSTOPPED (status) == 0 && WIFSIGNALED (status))
return (WTERMSIG (status));
else
return (0);
}
/* Give PID the status value STATUS in the PID_LIST array. */
static void
set_pid_status (pid, status)
pid_t pid;
WAIT status;
{
int slot;
#if defined (COPROCESS_SUPPORT)
coproc_pidchk (pid, status);
#endif
slot = find_index_by_pid (pid);
if (slot == NO_PID)
return;
pid_list[slot].status = process_exit_status (status);
pid_list[slot].flags &= ~PROC_RUNNING;
if (WIFSIGNALED (status))
pid_list[slot].flags |= PROC_SIGNALED;
/* If it's not a background process, mark it as notified so it gets
cleaned up. */
if ((pid_list[slot].flags & PROC_ASYNC) == 0)
pid_list[slot].flags |= PROC_NOTIFIED;
}
/* Give PID the flags FLAGS in the PID_LIST array. */
static void
set_pid_flags (pid, flags)
pid_t pid;
int flags;
{
int slot;
slot = find_index_by_pid (pid);
if (slot == NO_PID)
return;
pid_list[slot].flags |= flags;
}
/* Unset FLAGS for PID in the pid list */
static void
unset_pid_flags (pid, flags)
pid_t pid;
int flags;
{
int slot;
slot = find_index_by_pid (pid);
if (slot == NO_PID)
return;
pid_list[slot].flags &= ~flags;
}
/* Return the flags corresponding to PID in the PID_LIST array. */
static int
get_pid_flags (pid)
pid_t pid;
{
int slot;
slot = find_index_by_pid (pid);
if (slot == NO_PID)
return 0;
return (pid_list[slot].flags);
}
static void
add_pid (pid, async)
pid_t pid;
int async;
{
int slot;
slot = find_proc_slot ();
pid_list[slot].pid = pid;
pid_list[slot].status = -1;
pid_list[slot].flags = PROC_RUNNING;
if (async)
pid_list[slot].flags |= PROC_ASYNC;
}
static void
mark_dead_jobs_as_notified (force)
int force;
{
register int i, ndead;
/* first, count the number of non-running async jobs if FORCE == 0 */
for (i = ndead = 0; force == 0 && i < pid_list_size; i++)
{
if (pid_list[i].pid == NO_PID)
continue;
if (((pid_list[i].flags & PROC_RUNNING) == 0) &&
(pid_list[i].flags & PROC_ASYNC))
ndead++;
}
if (child_max < 0)
child_max = getmaxchild ();
if (child_max < 0)
child_max = DEFAULT_CHILD_MAX;
if (force == 0 && ndead <= child_max)
return;
/* If FORCE == 0, we just mark as many non-running async jobs as notified
to bring us under the CHILD_MAX limit. */
for (i = 0; i < pid_list_size; i++)
{
if (pid_list[i].pid == NO_PID)
continue;
if (((pid_list[i].flags & PROC_RUNNING) == 0) &&
pid_list[i].pid != last_asynchronous_pid)
{
pid_list[i].flags |= PROC_NOTIFIED;
if (force == 0 && (pid_list[i].flags & PROC_ASYNC) && --ndead <= child_max)
break;
}
}
}
/* Remove all dead, notified jobs from the pid_list. */
int
cleanup_dead_jobs ()
{
register int i;
#if defined (HAVE_WAITPID)
reap_zombie_children ();
#endif
for (i = 0; i < pid_list_size; i++)
{
if ((pid_list[i].flags & PROC_RUNNING) == 0 &&
(pid_list[i].flags & PROC_NOTIFIED))
pid_list[i].pid = NO_PID;
}
#if defined (COPROCESS_SUPPORT)
coproc_reap ();
#endif
return 0;
}
void
reap_dead_jobs ()
{
mark_dead_jobs_as_notified (0);
cleanup_dead_jobs ();
}
/* Initialize the job control mechanism, and set up the tty stuff. */
initialize_job_control (force)
int force;
{
shell_tty = fileno (stderr);
if (interactive)
get_tty_state ();
}
/* Setup this shell to handle C-C, etc. */
void
initialize_job_signals ()
{
set_signal_handler (SIGINT, sigint_sighandler);
/* If this is a login shell we don't wish to be disturbed by
stop signals. */
if (login_shell)
ignore_tty_job_signals ();
}
#if defined (HAVE_WAITPID)
/* Collect the status of all zombie children so that their system
resources can be deallocated. */
static void
reap_zombie_children ()
{
# if defined (WNOHANG)
pid_t pid;
WAIT status;
CHECK_TERMSIG;
while ((pid = waitpid (-1, (int *)&status, WNOHANG)) > 0)
set_pid_status (pid, status);
# endif /* WNOHANG */
CHECK_TERMSIG;
}
#endif /* WAITPID */
#if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS)
#if !defined (SA_RESTART)
# define SA_RESTART 0
#endif
static int
siginterrupt (sig, flag)
int sig, flag;
{
struct sigaction act;
sigaction (sig, (struct sigaction *)NULL, &act);
if (flag)
act.sa_flags &= ~SA_RESTART;
else
act.sa_flags |= SA_RESTART;
return (sigaction (sig, &act, (struct sigaction *)NULL));
}
#endif /* !HAVE_SIGINTERRUPT && HAVE_POSIX_SIGNALS */
/* Fork, handling errors. Returns the pid of the newly made child, or 0.
COMMAND is just for remembering the name of the command; we don't do
anything else with it. ASYNC_P says what to do with the tty. If
non-zero, then don't give it away. */
pid_t
make_child (command, async_p)
char *command;
int async_p;
{
pid_t pid;
int forksleep;
/* Discard saved memory. */
if (command)
free (command);
start_pipeline ();
#if defined (BUFFERED_INPUT)
/* If default_buffered_input is active, we are reading a script. If
the command is asynchronous, we have already duplicated /dev/null
as fd 0, but have not changed the buffered stream corresponding to
the old fd 0. We don't want to sync the stream in this case. */
if (default_buffered_input != -1 && (!async_p || default_buffered_input > 0))
sync_buffered_stream (default_buffered_input);
#endif /* BUFFERED_INPUT */
/* Create the child, handle severe errors. Retry on EAGAIN. */
forksleep = 1;
while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < FORKSLEEP_MAX)
{
sys_error ("fork: retry");
#if defined (HAVE_WAITPID)
/* Posix systems with a non-blocking waitpid () system call available
get another chance after zombies are reaped. */
reap_zombie_children ();
if (forksleep > 1 && sleep (forksleep) != 0)
break;
#else
if (sleep (forksleep) != 0)
break;
#endif /* HAVE_WAITPID */
forksleep <<= 1;
}
if (pid < 0)
{
sys_error ("fork");
throw_to_top_level ();
}
if (pid == 0)
{
#if defined (BUFFERED_INPUT)
unset_bash_input (0);
#endif /* BUFFERED_INPUT */
#if defined (HAVE_POSIX_SIGNALS)
/* Restore top-level signal mask. */
sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL);
#endif
#if 0
/* Ignore INT and QUIT in asynchronous children. */
if (async_p)
last_asynchronous_pid = getpid ();
#endif
default_tty_job_signals ();
}
else
{
/* In the parent. */
last_made_pid = pid;
if (async_p)
last_asynchronous_pid = pid;
add_pid (pid, async_p);
}
return (pid);
}
void
ignore_tty_job_signals ()
{
#if defined (SIGTSTP)
set_signal_handler (SIGTSTP, SIG_IGN);
set_signal_handler (SIGTTIN, SIG_IGN);
set_signal_handler (SIGTTOU, SIG_IGN);
#endif
}
void
default_tty_job_signals ()
{
#if defined (SIGTSTP)
set_signal_handler (SIGTSTP, SIG_DFL);
set_signal_handler (SIGTTIN, SIG_DFL);
set_signal_handler (SIGTTOU, SIG_DFL);
#endif
}
/* Wait for a single pid (PID) and return its exit status. Called by
the wait builtin. */
int
wait_for_single_pid (pid)
pid_t pid;
{
pid_t got_pid;
WAIT status;
int pstatus, flags;
pstatus = find_status_by_pid (pid);
if (pstatus == PROC_BAD)
{
internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid);
return (127);
}
if (pstatus != PROC_STILL_ALIVE)
{
if (pstatus > 128)
last_command_exit_signal = find_termsig_by_pid (pid);
return (pstatus);
}
siginterrupt (SIGINT, 1);
while ((got_pid = WAITPID (pid, &status, 0)) != pid)
{
CHECK_TERMSIG;
if (got_pid < 0)
{
if (errno != EINTR && errno != ECHILD)
{
siginterrupt (SIGINT, 0);
sys_error ("wait");
}
break;
}
else if (got_pid > 0)
set_pid_status (got_pid, status);
}
if (got_pid > 0)
{
set_pid_status (got_pid, status);
set_pid_flags (got_pid, PROC_NOTIFIED);
}
siginterrupt (SIGINT, 0);
QUIT;
return (got_pid > 0 ? process_exit_status (status) : -1);
}
/* Wait for all of the shell's children to exit. Called by the `wait'
builtin. */
void
wait_for_background_pids ()
{
pid_t got_pid;
WAIT status;
/* If we aren't using job control, we let the kernel take care of the
bookkeeping for us. wait () will return -1 and set errno to ECHILD
when there are no more unwaited-for child processes on both
4.2 BSD-based and System V-based systems. */
siginterrupt (SIGINT, 1);
/* Wait for ECHILD */
while ((got_pid = WAITPID (-1, &status, 0)) != -1)
set_pid_status (got_pid, status);
if (errno != EINTR && errno != ECHILD)
{
siginterrupt (SIGINT, 0);
sys_error("wait");
}
siginterrupt (SIGINT, 0);
QUIT;
mark_dead_jobs_as_notified (1);
cleanup_dead_jobs ();
}
/* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */
#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids
static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER;
static void
restore_sigint_handler ()
{
if (old_sigint_handler != INVALID_SIGNAL_HANDLER)
{
set_signal_handler (SIGINT, old_sigint_handler);
old_sigint_handler = INVALID_SIGNAL_HANDLER;
}
}
/* Handle SIGINT while we are waiting for children in a script to exit.
All interrupts are effectively ignored by the shell, but allowed to
kill a running job. */
static sighandler
wait_sigint_handler (sig)
int sig;
{
SigHandler *sigint_handler;
/* If we got a SIGINT while in `wait', and SIGINT is trapped, do
what POSIX.2 says (see builtins/wait.def for more info). */
if (this_shell_builtin && this_shell_builtin == wait_builtin &&
signal_is_trapped (SIGINT) &&
((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler))
{
last_command_exit_value = EXECUTION_FAILURE;
restore_sigint_handler ();
interrupt_immediately = 0;
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
wait_signal_received = SIGINT;
longjmp (wait_intr_buf, 1);
}
if (interrupt_immediately)
{
last_command_exit_value = EXECUTION_FAILURE;
restore_sigint_handler ();
ADDINTERRUPT;
QUIT;
}
wait_sigint_received = 1;
SIGRETURN (0);
}
static char *
j_strsignal (s)
int s;
{
static char retcode_name_buffer[64] = { '\0' };
char *x;
x = strsignal (s);
if (x == 0)
{
x = retcode_name_buffer;
sprintf (x, "Signal %d", s);
}
return x;
}
/* Wait for pid (one of our children) to terminate. This is called only
by the execution code in execute_cmd.c. */
int
wait_for (pid)
pid_t pid;
{
int return_val, pstatus;
pid_t got_pid;
WAIT status;
pstatus = find_status_by_pid (pid);
if (pstatus == PROC_BAD)
return (0);
if (pstatus != PROC_STILL_ALIVE)
{
if (pstatus > 128)
last_command_exit_signal = find_termsig_by_pid (pid);
return (pstatus);
}
/* If we are running a script, ignore SIGINT while we're waiting for
a child to exit. The loop below does some of this, but not all. */
wait_sigint_received = 0;
if (interactive_shell == 0)
old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
while ((got_pid = WAITPID (-1, &status, 0)) != pid) /* XXX was pid now -1 */
{
CHECK_TERMSIG;
if (got_pid < 0 && errno == ECHILD)
{
#if !defined (_POSIX_VERSION)
status.w_termsig = status.w_retcode = 0;
#else
status = 0;
#endif /* _POSIX_VERSION */
break;
}
else if (got_pid < 0 && errno != EINTR)
programming_error ("wait_for(%ld): %s", (long)pid, strerror(errno));
else if (got_pid > 0)
set_pid_status (got_pid, status);
}
if (got_pid > 0)
set_pid_status (got_pid, status);
#if defined (HAVE_WAITPID)
if (got_pid >= 0)
reap_zombie_children ();
#endif /* HAVE_WAITPID */
if (interactive_shell == 0)
{
SigHandler *temp_handler;
temp_handler = old_sigint_handler;
restore_sigint_handler ();
/* If the job exited because of SIGINT, make sure the shell acts as if
it had received one also. */
if (WIFSIGNALED (status) && (WTERMSIG (status) == SIGINT))
{
if (maybe_call_trap_handler (SIGINT) == 0)
{
if (temp_handler == SIG_DFL)
termsig_handler (SIGINT);
else if (temp_handler != INVALID_SIGNAL_HANDLER && temp_handler != SIG_IGN)
(*temp_handler) (SIGINT);
}
}
}
/* Default return value. */
/* ``a full 8 bits of status is returned'' */
return_val = process_exit_status (status);
last_command_exit_signal = get_termsig (status);
#if defined (DONT_REPORT_SIGPIPE) && defined (DONT_REPORT_SIGTERM)
# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE && (x) != SIGTERM)
#elif !defined (DONT_REPORT_SIGPIPE) && !defined (DONT_REPORT_SIGTERM)
# define REPORTSIG(x) ((x) != SIGINT)
#elif defined (DONT_REPORT_SIGPIPE)
# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE)
#else
# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGTERM)
#endif
if ((WIFSTOPPED (status) == 0) && WIFSIGNALED (status) && REPORTSIG(WTERMSIG (status)))
{
fprintf (stderr, "%s", j_strsignal (WTERMSIG (status)));
if (WIFCORED (status))
fprintf (stderr, _(" (core dumped)"));
fprintf (stderr, "\n");
}
if (interactive_shell && subshell_environment == 0)
{
if (WIFSIGNALED (status) || WIFSTOPPED (status))
set_tty_state ();
else
get_tty_state ();
}
else if (interactive_shell == 0 && subshell_environment == 0 && check_window_size)
get_new_window_size (0, (int *)0, (int *)0);
return (return_val);
}
/* Send PID SIGNAL. Returns -1 on failure, 0 on success. If GROUP is non-zero,
or PID is less than -1, then kill the process group associated with PID. */
int
kill_pid (pid, signal, group)
pid_t pid;
int signal, group;
{
int result;
if (pid < -1)
{
pid = -pid;
group = 1;
}
result = group ? killpg (pid, signal) : kill (pid, signal);
return (result);
}
static TTYSTRUCT shell_tty_info;
static int got_tty_state;
/* Fill the contents of shell_tty_info with the current tty info. */
get_tty_state ()
{
int tty;
tty = input_tty ();
if (tty != -1)
{
ttgetattr (tty, &shell_tty_info);
got_tty_state = 1;
if (check_window_size)
get_new_window_size (0, (int *)0, (int *)0);
}
}
/* Make the current tty use the state in shell_tty_info. */
int
set_tty_state ()
{
int tty;
tty = input_tty ();
if (tty != -1)
{
if (got_tty_state == 0)
return 0;
ttsetattr (tty, &shell_tty_info);
}
return 0;
}
/* Give the terminal to PGRP. */
give_terminal_to (pgrp, force)
pid_t pgrp;
int force;
{
}
/* Stop a pipeline. */
int
stop_pipeline (async, ignore)
int async;
COMMAND *ignore;
{
already_making_children = 0;
return 0;
}
void
start_pipeline ()
{
already_making_children = 1;
}
void
stop_making_children ()
{
already_making_children = 0;
}
int
get_job_by_pid (pid, block)
pid_t pid;
int block;
{
int i;
i = find_index_by_pid (pid);
return ((i == NO_PID) ? PROC_BAD : i);
}
/* Print descriptive information about the job with leader pid PID. */
void
describe_pid (pid)
pid_t pid;
{
fprintf (stderr, "%ld\n", (long) pid);
}
void
freeze_jobs_list ()
{
}
void
unfreeze_jobs_list ()
{
}
int
count_all_jobs ()
{
return 0;
}
+5521
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+2
View File
@@ -674,8 +674,10 @@ set_signal_handler (sig, handler)
/* XXX - bash-4.2 */
/* We don't want a child death to interrupt interruptible system calls, even
if we take the time to reap children */
#if defined (SIGCHLD)
if (sig == SIGCHLD)
act.sa_flags |= SA_RESTART; /* XXX */
#endif
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
+685
View File
@@ -0,0 +1,685 @@
/* sig.c - interface for shell signal handlers and signal initialization. */
/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "bashtypes.h"
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#include <stdio.h>
#include <signal.h>
#include "bashintl.h"
#include "shell.h"
#if defined (JOB_CONTROL)
#include "jobs.h"
#endif /* JOB_CONTROL */
#include "siglist.h"
#include "sig.h"
#include "trap.h"
#include "builtins/common.h"
#if defined (READLINE)
# include "bashline.h"
# include <readline/readline.h>
#endif
#if defined (HISTORY)
# include "bashhist.h"
#endif
extern int last_command_exit_value;
extern int last_command_exit_signal;
extern int return_catch_flag;
extern int loop_level, continuing, breaking, funcnest;
extern int executing_list;
extern int comsub_ignore_return;
extern int parse_and_execute_level, shell_initialized;
#if defined (HISTORY)
extern int history_lines_this_session;
#endif
extern int no_line_editing;
extern void initialize_siglist ();
/* Non-zero after SIGINT. */
volatile int interrupt_state = 0;
/* Non-zero after SIGWINCH */
volatile int sigwinch_received = 0;
/* Set to the value of any terminating signal received. */
volatile int terminating_signal = 0;
/* The environment at the top-level R-E loop. We use this in
the case of error return. */
procenv_t top_level;
#if defined (JOB_CONTROL) || defined (HAVE_POSIX_SIGNALS)
/* The signal masks that this shell runs with. */
sigset_t top_level_mask;
#endif /* JOB_CONTROL */
/* When non-zero, we throw_to_top_level (). */
int interrupt_immediately = 0;
/* When non-zero, we call the terminating signal handler immediately. */
int terminate_immediately = 0;
#if defined (SIGWINCH)
static SigHandler *old_winch = (SigHandler *)SIG_DFL;
#endif
static void initialize_shell_signals __P((void));
void
initialize_signals (reinit)
int reinit;
{
initialize_shell_signals ();
initialize_job_signals ();
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_UNDER_SYS_SIGLIST) && !defined (HAVE_STRSIGNAL)
if (reinit == 0)
initialize_siglist ();
#endif /* !HAVE_SYS_SIGLIST && !HAVE_UNDER_SYS_SIGLIST && !HAVE_STRSIGNAL */
}
/* A structure describing a signal that terminates the shell if not
caught. The orig_handler member is present so children can reset
these signals back to their original handlers. */
struct termsig {
int signum;
SigHandler *orig_handler;
int orig_flags;
};
#define NULL_HANDLER (SigHandler *)SIG_DFL
/* The list of signals that would terminate the shell if not caught.
We catch them, but just so that we can write the history file,
and so forth. */
static struct termsig terminating_signals[] = {
#ifdef SIGHUP
{ SIGHUP, NULL_HANDLER, 0 },
#endif
#ifdef SIGINT
{ SIGINT, NULL_HANDLER, 0 },
#endif
#ifdef SIGILL
{ SIGILL, NULL_HANDLER, 0 },
#endif
#ifdef SIGTRAP
{ SIGTRAP, NULL_HANDLER, 0 },
#endif
#ifdef SIGIOT
{ SIGIOT, NULL_HANDLER, 0 },
#endif
#ifdef SIGDANGER
{ SIGDANGER, NULL_HANDLER, 0 },
#endif
#ifdef SIGEMT
{ SIGEMT, NULL_HANDLER, 0 },
#endif
#ifdef SIGFPE
{ SIGFPE, NULL_HANDLER, 0 },
#endif
#ifdef SIGBUS
{ SIGBUS, NULL_HANDLER, 0 },
#endif
#ifdef SIGSEGV
{ SIGSEGV, NULL_HANDLER, 0 },
#endif
#ifdef SIGSYS
{ SIGSYS, NULL_HANDLER, 0 },
#endif
#ifdef SIGPIPE
{ SIGPIPE, NULL_HANDLER, 0 },
#endif
#ifdef SIGALRM
{ SIGALRM, NULL_HANDLER, 0 },
#endif
#ifdef SIGTERM
{ SIGTERM, NULL_HANDLER, 0 },
#endif
#ifdef SIGXCPU
{ SIGXCPU, NULL_HANDLER, 0 },
#endif
#ifdef SIGXFSZ
{ SIGXFSZ, NULL_HANDLER, 0 },
#endif
#ifdef SIGVTALRM
{ SIGVTALRM, NULL_HANDLER, 0 },
#endif
#if 0
#ifdef SIGPROF
{ SIGPROF, NULL_HANDLER, 0 },
#endif
#endif
#ifdef SIGLOST
{ SIGLOST, NULL_HANDLER, 0 },
#endif
#ifdef SIGUSR1
{ SIGUSR1, NULL_HANDLER, 0 },
#endif
#ifdef SIGUSR2
{ SIGUSR2, NULL_HANDLER, 0 },
#endif
};
#define TERMSIGS_LENGTH (sizeof (terminating_signals) / sizeof (struct termsig))
#define XSIG(x) (terminating_signals[x].signum)
#define XHANDLER(x) (terminating_signals[x].orig_handler)
#define XSAFLAGS(x) (terminating_signals[x].orig_flags)
static int termsigs_initialized = 0;
/* Initialize signals that will terminate the shell to do some
unwind protection. For non-interactive shells, we only call
this when a trap is defined for EXIT (0) or when trap is run
to display signal dispositions. */
void
initialize_terminating_signals ()
{
register int i;
#if defined (HAVE_POSIX_SIGNALS)
struct sigaction act, oact;
#endif
if (termsigs_initialized)
return;
/* The following code is to avoid an expensive call to
set_signal_handler () for each terminating_signals. Fortunately,
this is possible in Posix. Unfortunately, we have to call signal ()
on non-Posix systems for each signal in terminating_signals. */
#if defined (HAVE_POSIX_SIGNALS)
act.sa_handler = termsig_sighandler;
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
for (i = 0; i < TERMSIGS_LENGTH; i++)
sigaddset (&act.sa_mask, XSIG (i));
for (i = 0; i < TERMSIGS_LENGTH; i++)
{
/* If we've already trapped it, don't do anything. */
if (signal_is_trapped (XSIG (i)))
continue;
sigaction (XSIG (i), &act, &oact);
XHANDLER(i) = oact.sa_handler;
XSAFLAGS(i) = oact.sa_flags;
/* Don't do anything with signals that are ignored at shell entry
if the shell is not interactive. */
/* XXX - should we do this for interactive shells, too? */
if (interactive_shell == 0 && XHANDLER (i) == SIG_IGN)
{
sigaction (XSIG (i), &oact, &act);
set_signal_ignored (XSIG (i));
}
#if defined (SIGPROF) && !defined (_MINIX)
if (XSIG (i) == SIGPROF && XHANDLER (i) != SIG_DFL && XHANDLER (i) != SIG_IGN)
sigaction (XSIG (i), &oact, (struct sigaction *)NULL);
#endif /* SIGPROF && !_MINIX */
}
#else /* !HAVE_POSIX_SIGNALS */
for (i = 0; i < TERMSIGS_LENGTH; i++)
{
/* If we've already trapped it, don't do anything. */
if (signal_is_trapped (XSIG (i)))
continue;
XHANDLER(i) = signal (XSIG (i), termsig_sighandler);
XSAFLAGS(i) = 0;
/* Don't do anything with signals that are ignored at shell entry
if the shell is not interactive. */
/* XXX - should we do this for interactive shells, too? */
if (interactive_shell == 0 && XHANDLER (i) == SIG_IGN)
{
signal (XSIG (i), SIG_IGN);
set_signal_ignored (XSIG (i));
}
#ifdef SIGPROF
if (XSIG (i) == SIGPROF && XHANDLER (i) != SIG_DFL && XHANDLER (i) != SIG_IGN)
signal (XSIG (i), XHANDLER (i));
#endif
}
#endif /* !HAVE_POSIX_SIGNALS */
termsigs_initialized = 1;
}
static void
initialize_shell_signals ()
{
if (interactive)
initialize_terminating_signals ();
#if defined (JOB_CONTROL) || defined (HAVE_POSIX_SIGNALS)
/* All shells use the signal mask they inherit, and pass it along
to child processes. Children will never block SIGCHLD, though. */
sigemptyset (&top_level_mask);
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &top_level_mask);
# if defined (SIGCHLD)
sigdelset (&top_level_mask, SIGCHLD);
# endif
#endif /* JOB_CONTROL || HAVE_POSIX_SIGNALS */
/* And, some signals that are specifically ignored by the shell. */
set_signal_handler (SIGQUIT, SIG_IGN);
if (interactive)
{
set_signal_handler (SIGINT, sigint_sighandler);
set_signal_handler (SIGTERM, SIG_IGN);
set_sigwinch_handler ();
}
}
void
reset_terminating_signals ()
{
register int i;
#if defined (HAVE_POSIX_SIGNALS)
struct sigaction act;
#endif
if (termsigs_initialized == 0)
return;
#if defined (HAVE_POSIX_SIGNALS)
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
for (i = 0; i < TERMSIGS_LENGTH; i++)
{
/* Skip a signal if it's trapped or handled specially, because the
trap code will restore the correct value. */
if (signal_is_trapped (XSIG (i)) || signal_is_special (XSIG (i)))
continue;
act.sa_handler = XHANDLER (i);
act.sa_flags = XSAFLAGS (i);
sigaction (XSIG (i), &act, (struct sigaction *) NULL);
}
#else /* !HAVE_POSIX_SIGNALS */
for (i = 0; i < TERMSIGS_LENGTH; i++)
{
if (signal_is_trapped (XSIG (i)) || signal_is_special (XSIG (i)))
continue;
signal (XSIG (i), XHANDLER (i));
}
#endif /* !HAVE_POSIX_SIGNALS */
}
#undef XSIG
#undef XHANDLER
/* Run some of the cleanups that should be performed when we run
jump_to_top_level from a builtin command context. XXX - might want to
also call reset_parser here. */
void
top_level_cleanup ()
{
/* Clean up string parser environment. */
while (parse_and_execute_level)
parse_and_execute_cleanup ();
#if defined (PROCESS_SUBSTITUTION)
unlink_fifo_list ();
#endif /* PROCESS_SUBSTITUTION */
run_unwind_protects ();
loop_level = continuing = breaking = funcnest = 0;
executing_list = comsub_ignore_return = return_catch_flag = 0;
}
/* What to do when we've been interrupted, and it is safe to handle it. */
void
throw_to_top_level ()
{
int print_newline = 0;
if (interrupt_state)
{
print_newline = 1;
DELINTERRUPT;
}
if (interrupt_state)
return;
last_command_exit_signal = (last_command_exit_value > 128) ?
(last_command_exit_value - 128) : 0;
last_command_exit_value |= 128;
/* Run any traps set on SIGINT. */
run_interrupt_trap ();
/* Clean up string parser environment. */
while (parse_and_execute_level)
parse_and_execute_cleanup ();
#if defined (JOB_CONTROL)
give_terminal_to (shell_pgrp, 0);
#endif /* JOB_CONTROL */
#if defined (JOB_CONTROL) || defined (HAVE_POSIX_SIGNALS)
/* This should not be necessary on systems using sigsetjmp/siglongjmp. */
sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL);
#endif
reset_parser ();
#if defined (READLINE)
if (interactive)
bashline_reset ();
#endif /* READLINE */
#if defined (PROCESS_SUBSTITUTION)
unlink_fifo_list ();
#endif /* PROCESS_SUBSTITUTION */
run_unwind_protects ();
loop_level = continuing = breaking = funcnest = 0;
executing_list = comsub_ignore_return = return_catch_flag = 0;
if (interactive && print_newline)
{
fflush (stdout);
fprintf (stderr, "\n");
fflush (stderr);
}
/* An interrupted `wait' command in a script does not exit the script. */
if (interactive || (interactive_shell && !shell_initialized) ||
(print_newline && signal_is_trapped (SIGINT)))
jump_to_top_level (DISCARD);
else
jump_to_top_level (EXITPROG);
}
/* This is just here to isolate the longjmp calls. */
void
jump_to_top_level (value)
int value;
{
longjmp (top_level, value);
}
sighandler
termsig_sighandler (sig)
int sig;
{
/* If we get called twice with the same signal before handling it,
terminate right away. */
if (
#ifdef SIGHUP
sig != SIGHUP &&
#endif
#ifdef SIGINT
sig != SIGINT &&
#endif
#ifdef SIGDANGER
sig != SIGDANGER &&
#endif
#ifdef SIGPIPE
sig != SIGPIPE &&
#endif
#ifdef SIGALRM
sig != SIGALRM &&
#endif
#ifdef SIGTERM
sig != SIGTERM &&
#endif
#ifdef SIGXCPU
sig != SIGXCPU &&
#endif
#ifdef SIGXFSZ
sig != SIGXFSZ &&
#endif
#ifdef SIGVTALRM
sig != SIGVTALRM &&
#endif
#ifdef SIGLOST
sig != SIGLOST &&
#endif
#ifdef SIGUSR1
sig != SIGUSR1 &&
#endif
#ifdef SIGUSR2
sig != SIGUSR2 &&
#endif
sig == terminating_signal)
terminate_immediately = 1;
terminating_signal = sig;
/* XXX - should this also trigger when interrupt_immediately is set? */
if (terminate_immediately)
{
#if defined (HISTORY)
/* XXX - will inhibit history file being written */
# if defined (READLINE)
if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0))
# endif
history_lines_this_session = 0;
#endif
terminate_immediately = 0;
termsig_handler (sig);
}
#if defined (READLINE)
if (interactive_shell && interactive && no_line_editing == 0)
bashline_set_event_hook ();
#endif
SIGRETURN (0);
}
void
termsig_handler (sig)
int sig;
{
static int handling_termsig = 0;
/* Simple semaphore to keep this function from being executed multiple
times. Since we no longer are running as a signal handler, we don't
block multiple occurrences of the terminating signals while running. */
if (handling_termsig)
return;
handling_termsig = 1;
terminating_signal = 0; /* keep macro from re-testing true. */
/* I don't believe this condition ever tests true. */
if (sig == SIGINT && signal_is_trapped (SIGINT))
run_interrupt_trap ();
#if defined (HISTORY)
if (interactive_shell && sig != SIGABRT)
maybe_save_shell_history ();
#endif /* HISTORY */
#if defined (JOB_CONTROL)
if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB))))
hangup_all_jobs ();
end_job_control ();
#endif /* JOB_CONTROL */
#if defined (PROCESS_SUBSTITUTION)
unlink_fifo_list ();
#endif /* PROCESS_SUBSTITUTION */
/* Reset execution context */
loop_level = continuing = breaking = funcnest = 0;
executing_list = comsub_ignore_return = return_catch_flag = 0;
run_exit_trap ();
set_signal_handler (sig, SIG_DFL);
kill (getpid (), sig);
}
/* What we really do when SIGINT occurs. */
sighandler
sigint_sighandler (sig)
int sig;
{
#if defined (MUST_REINSTALL_SIGHANDLERS)
signal (sig, sigint_sighandler);
#endif
/* interrupt_state needs to be set for the stack of interrupts to work
right. Should it be set unconditionally? */
if (interrupt_state == 0)
ADDINTERRUPT;
if (interrupt_immediately)
{
interrupt_immediately = 0;
last_command_exit_value = 128 + sig;
throw_to_top_level ();
}
SIGRETURN (0);
}
#if defined (SIGWINCH)
sighandler
sigwinch_sighandler (sig)
int sig;
{
#if defined (MUST_REINSTALL_SIGHANDLERS)
set_signal_handler (SIGWINCH, sigwinch_sighandler);
#endif /* MUST_REINSTALL_SIGHANDLERS */
sigwinch_received = 1;
SIGRETURN (0);
}
#endif /* SIGWINCH */
void
set_sigwinch_handler ()
{
#if defined (SIGWINCH)
old_winch = set_signal_handler (SIGWINCH, sigwinch_sighandler);
#endif
}
void
unset_sigwinch_handler ()
{
#if defined (SIGWINCH)
set_signal_handler (SIGWINCH, old_winch);
#endif
}
/* Signal functions used by the rest of the code. */
#if !defined (HAVE_POSIX_SIGNALS)
/* Perform OPERATION on NEWSET, perhaps leaving information in OLDSET. */
sigprocmask (operation, newset, oldset)
int operation, *newset, *oldset;
{
int old, new;
if (newset)
new = *newset;
else
new = 0;
switch (operation)
{
case SIG_BLOCK:
old = sigblock (new);
break;
case SIG_SETMASK:
old = sigsetmask (new);
break;
default:
internal_error (_("sigprocmask: %d: invalid operation"), operation);
}
if (oldset)
*oldset = old;
}
#else
#if !defined (SA_INTERRUPT)
# define SA_INTERRUPT 0
#endif
#if !defined (SA_RESTART)
# define SA_RESTART 0
#endif
SigHandler *
set_signal_handler (sig, handler)
int sig;
SigHandler *handler;
{
struct sigaction act, oact;
act.sa_handler = handler;
act.sa_flags = 0;
/* XXX - bash-4.2 */
/* We don't want a child death to interrupt interruptible system calls, even
if we take the time to reap children */
if (sig == SIGCHLD)
act.sa_flags |= SA_RESTART; /* XXX */
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
sigaction (sig, &act, &oact);
return (oact.sa_handler);
}
#endif /* HAVE_POSIX_SIGNALS */
+21 -4
View File
@@ -50,6 +50,7 @@ extern int errno;
#endif /* !_POSIX_VERSION */
#include "posixstat.h"
#include "filecntl.h"
#include "stat-time.h"
#include "bashintl.h"
@@ -288,20 +289,36 @@ term ()
return (value);
}
static int
stat_mtime (fn, st, ts)
char *fn;
struct stat *st;
struct timespec *ts;
{
int r;
r = sh_stat (fn, st);
if (r < 0)
return r;
*ts = get_stat_mtime (st);
return 0;
}
static int
filecomp (s, t, op)
char *s, *t;
int op;
{
struct stat st1, st2;
struct timespec ts1, ts2;
int r1, r2;
if ((r1 = sh_stat (s, &st1)) < 0)
if ((r1 = stat_mtime (s, &st1, &ts1)) < 0)
{
if (op == EF)
return (FALSE);
}
if ((r2 = sh_stat (t, &st2)) < 0)
if ((r2 = stat_mtime (t, &st2, &ts2)) < 0)
{
if (op == EF)
return (FALSE);
@@ -309,8 +326,8 @@ filecomp (s, t, op)
switch (op)
{
case OT: return (r1 < r2 || (r2 == 0 && st1.st_mtime < st2.st_mtime));
case NT: return (r1 > r2 || (r1 == 0 && st1.st_mtime > st2.st_mtime));
case OT: return (r1 < r2 || (r2 == 0 && timespec_cmp (ts1, ts2) < 0));
case NT: return (r1 > r2 || (r1 == 0 && timespec_cmp (ts1, ts2) > 0));
case EF: return (same_file (s, t, &st1, &st2));
}
return (FALSE);
+11
View File
@@ -453,6 +453,17 @@ set_impossible_sigchld_trap ()
change_signal (SIGCHLD, (char *)IMPOSSIBLE_TRAP_HANDLER);
sigmodes[SIGCHLD] &= ~SIG_TRAPPED; /* maybe_set_sigchld_trap checks this */
}
/* Act as if we received SIGCHLD NCHILD times and increment
pending_traps[SIGCHLD] by that amount. This allows us to still run the
SIGCHLD trap once for each exited child. */
void
queue_sigchld_trap (nchild)
int nchild;
{
if (nchild > 0)
pending_traps[SIGCHLD] += nchild;
}
#endif /* JOB_CONTROL && SIGCHLD */
void
+1129
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -65,6 +65,7 @@ extern void initialize_traps __P((void));
extern void run_pending_traps __P((void));
extern void queue_sigchld_trap __P((int));
extern void maybe_set_sigchld_trap __P((char *));
extern void set_impossible_sigchld_trap __P((void));
extern void set_sigchld_trap __P((char *));
+105
View File
@@ -0,0 +1,105 @@
/* trap.h -- data structures used in the trap mechanism. */
/* Copyright (C) 1993-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (_TRAP_H_)
#define _TRAP_H_
#include "stdc.h"
#if !defined (SIG_DFL)
#include "bashtypes.h"
#include <signal.h>
#endif /* SIG_DFL */
#if !defined (NSIG)
#define NSIG 64
#endif /* !NSIG */
#define NO_SIG -1
#define DEFAULT_SIG SIG_DFL
#define IGNORE_SIG SIG_IGN
/* Special shell trap names. */
#define DEBUG_TRAP NSIG
#define ERROR_TRAP NSIG+1
#define RETURN_TRAP NSIG+2
#define EXIT_TRAP 0
/* system signals plus special bash traps */
#define BASH_NSIG NSIG+3
/* Flags values for decode_signal() */
#define DSIG_SIGPREFIX 0x01 /* don't alllow `SIG' PREFIX */
#define DSIG_NOCASE 0x02 /* case-insensitive comparison */
/* A value which can never be the target of a trap handler. */
#define IMPOSSIBLE_TRAP_HANDLER (SigHandler *)initialize_traps
#define signal_object_p(x,f) (decode_signal (x,f) != NO_SIG)
#define TRAP_STRING(s) \
(signal_is_trapped (s) && signal_is_ignored (s) == 0) ? trap_list[s] \
: (char *)NULL
extern char *trap_list[];
/* Externally-visible functions declared in trap.c. */
extern void initialize_traps __P((void));
extern void run_pending_traps __P((void));
extern void maybe_set_sigchld_trap __P((char *));
extern void set_impossible_sigchld_trap __P((void));
extern void set_sigchld_trap __P((char *));
extern void set_debug_trap __P((char *));
extern void set_error_trap __P((char *));
extern void set_return_trap __P((char *));
extern void set_sigint_trap __P((char *));
extern void set_signal __P((int, char *));
extern void restore_default_signal __P((int));
extern void ignore_signal __P((int));
extern int run_exit_trap __P((void));
extern void run_trap_cleanup __P((int));
extern int run_debug_trap __P((void));
extern void run_error_trap __P((void));
extern void run_return_trap __P((void));
extern void free_trap_strings __P((void));
extern void reset_signal_handlers __P((void));
extern void restore_original_signals __P((void));
extern void get_all_original_signals __P((void));
extern char *signal_name __P((int));
extern int decode_signal __P((char *, int));
extern void run_interrupt_trap __P((void));
extern int maybe_call_trap_handler __P((int));
extern int signal_is_special __P((int));
extern int signal_is_trapped __P((int));
extern int signal_is_ignored __P((int));
extern int signal_is_hard_ignored __P((int));
extern void set_signal_ignored __P((int));
extern int signal_in_progress __P((int));
#endif /* _TRAP_H_ */
+2 -2
View File
@@ -88,7 +88,7 @@ show_shell_version (extended)
{
printf ("%s\n", _(bash_copyright));
printf ("%s\n", _(bash_license));
printf (_("This is free software; you are free to change and redistribute it.\n"));
printf (_("There is NO WARRANTY, to the extent permitted by law.\n"));
printf ("%s\n", _("This is free software; you are free to change and redistribute it."));
printf ("%s\n", _("There is NO WARRANTY, to the extent permitted by law."));
}
}
+94
View File
@@ -0,0 +1,94 @@
/* version.c -- distribution and version numbers. */
/* Copyright (C) 1989-2011 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 3 of the License, or
(at your option) any later version.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include "stdc.h"
#include "version.h"
#include "patchlevel.h"
#include "conftypes.h"
#include "bashintl.h"
extern char *shell_name;
/* Defines from version.h */
const char * const dist_version = DISTVERSION;
const int patch_level = PATCHLEVEL;
const int build_version = BUILDVERSION;
#ifdef RELSTATUS
const char * const release_status = RELSTATUS;
#else
const char * const release_status = (char *)0;
#endif
const char * const sccs_version = SCCSVERSION;
const char * const bash_copyright = N_("Copyright (C) 2011 Free Software Foundation, Inc.");
const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
/* Functions for getting, setting, and displaying the shell version. */
/* Forward declarations so we don't have to include externs.h */
extern char *shell_version_string __P((void));
extern void show_shell_version __P((int));
/* Give version information about this shell. */
char *
shell_version_string ()
{
static char tt[32] = { '\0' };
if (tt[0] == '\0')
{
if (release_status)
#if defined (HAVE_SNPRINTF)
snprintf (tt, sizeof (tt), "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
#else
sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
#endif
else
#if defined (HAVE_SNPRINTF)
snprintf (tt, sizeof (tt), "%s.%d(%d)", dist_version, patch_level, build_version);
#else
sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version);
#endif
}
return tt;
}
void
show_shell_version (extended)
int extended;
{
printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE);
if (extended)
{
printf ("%s\n", _(bash_copyright));
printf ("%s\n", _(bash_license));
printf (_("This is free software; you are free to change and redistribute it.\n"));
printf (_("There is NO WARRANTY, to the extent permitted by law.\n"));
}
}