diff options
| author | Samuel Thibault <samy@hurd.youpi.perso.aquilenet.fr> | 2012-05-20 13:37:32 +0000 |
|---|---|---|
| committer | Samuel Thibault <samy@hurd.youpi.perso.aquilenet.fr> | 2012-05-20 13:37:32 +0000 |
| commit | ca35f7a6e428a95d1ff0aa40d6545820b580df1d (patch) | |
| tree | 27027c7aabca1f4bbe7fb684e4f0f1a7d3b24051 | |
| parent | c490cb9d4c1df1adcb2e76679e1969e7fe062560 (diff) | |
| parent | 756a64304b61a94b9b57ae88c4af5654152f5b8e (diff) | |
Merge branch 'upstream-merged'
279 files changed, 5 insertions, 21500 deletions
diff --git a/bsdfsck/Makefile b/bsdfsck/Makefile index b5dcfbf2..4e237e98 100644 --- a/bsdfsck/Makefile +++ b/bsdfsck/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 1994, 1995 Free Software Foundation +# Copyright (C) 1994, 1995, 2012 Free Software Foundation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -22,7 +22,6 @@ SRCS = dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ pass5.c setup.c utilities.c # preen.c OBJS = dir.o inode.o main.o pass1.o pass1b.o pass2.o pass3.o pass4.o \ pass5.o setup.o utilities.o tables.o # preen.o -LCLHDRS = fsck.h target = bsdfsck vpath tables.c ../ufs diff --git a/configure b/configure deleted file mode 100755 index 1fab7980..00000000 --- a/configure +++ /dev/null @@ -1,5868 +0,0 @@ -#! /bin/sh -# From configure.in Id: configure.in,v 1.38 2008/11/17 11:34:18 tschwinge Exp . -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for GNU Hurd 0.3. -# -# Report bugs to <bug-hurd@gnu.org>. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-hurd@gnu.org -$0: about your system, including any error possibly output -$0: before this message. Then install a modern shell, or -$0: manually run the script under such a shell if you do -$0: have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 </dev/null -exec 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='GNU Hurd' -PACKAGE_TARNAME='hurd' -PACKAGE_VERSION='0.3' -PACKAGE_STRING='GNU Hurd 0.3' -PACKAGE_BUGREPORT='bug-hurd@gnu.org' -PACKAGE_URL='http://www.gnu.org/software/hurd/' - -ac_unique_file="hurd/hurd_types.h" -ac_default_prefix= -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -HAVE_SUN_RPC -LIBNCURSESW -NCURSESW_INCLUDE -boot_store_types -PARTED_LIBS -EGREP -GREP -CPP -libc_cv_gnu89_inline -VERSIONING -LIBCRYPT -MIG -RANLIB -AR -OBJCOPY -LD -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AWK -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -enable_static_progs -enable_profile -asm_syntax -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_profile -enable_static_progs -with_parted -enable_boot_store_types -enable_ncursesw -with_ncursesw_include_dir -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures GNU Hurd 0.3 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/hurd] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of GNU Hurd 0.3:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-profile do not build profiled libraries and programs - --enable-static-progs=PROGRAMS... - build statically-linked PROGRAM.static versions - of (only) the listed programs ext2fs,ufs - --enable-boot-store-types=TYPES... - list of store types included in statically - linked filesystems used for booting - --disable-ncursesw Do not use ncursesw - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-parted disable user-space partition stores - --with-ncursesw-include-dir=DIR - Set directory containing the include files for - use with -lncursesw, when it isn't installed as - the default curses library. If DIR is "none", - then no special ncursesw include files are used. - --without-ncursesw-include-dir - Equivalent to --with-ncursesw-include-dir=none - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to <bug-hurd@gnu.org>. -GNU Hurd home page: <http://www.gnu.org/software/hurd/>. -General help using GNU software: <http://www.gnu.org/gethelp/>. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -GNU Hurd configure 0.3 -generated by GNU Autoconf 2.67 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case <limits.h> declares $2. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_func - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------- ## -## Report this to bug-hurd@gnu.org ## -## ------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by GNU Hurd $as_me 0.3, which was -generated by GNU Autoconf 2.67. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -case "$host_os" in -gnu*) ;; -none) as_fn_error $? " -*** You must specify a host of $host_cpu-gnu or $host_cpu-$host_vendor-gnu -*** to configure; you will need to use the same host specification -*** to configure other packages for the GNU/Hurd system." "$LINENO" 5 ;; -*) as_fn_error $? "this is the gnu os, host cannot be $host_os -*** Host configuration must be \`MACHINE-gnu' or \`MACHINE-VENDOR-gnu'. -*** To cross-compile, you must specify both --host and --build; -*** for example \`--build=$host --host=$host_cpu-gnu'. -*** Run $0 --help for more information." "$LINENO" 5 ;; -esac - -case "$host_cpu" in -alpha*) - asm_syntax=alpha - ;; -arm*) - asm_syntax=arm - ;; -m68k | m680?0) - asm_syntax=m68k - ;; -mips*) - asm_syntax=mips - ;; -i?86) - asm_syntax=i386 - ;; -powerpc*) - asm_syntax=ppc - ;; -sparc64* | ultrasparc*) - asm_syntax=sparc64 - ;; -sparc*) - asm_syntax=sparc - ;; -*) - asm_syntax="$host_cpu" - ;; -esac - - -test -r "$srcdir/libthreads/$asm_syntax/cthreads.h" || { - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unsupported CPU type $host_cpu" >&5 -$as_echo "$as_me: WARNING: unsupported CPU type $host_cpu" >&2;} -} - -# Check whether --enable-profile was given. -if test "${enable_profile+set}" = set; then : - enableval=$enable_profile; -fi - - - -# Check whether --enable-static-progs was given. -if test "${enable_static_progs+set}" = set; then : - enableval=$enable_static_progs; -fi - -case "$enable_static_progs" in -'no') enable_static_progs= ;; # we got --disable-static -'') enable_static_progs='ext2fs,ufs' ;; -esac -# Convert comma/space-separated list into space-separated list. -enable_static_progs=`echo "$enable_static_progs" | sed 's/[, ][, ]*/ /g'` - - -# Don't needlessly overwrite files that whose contents haven't changed. This -# helps for avoinding unneccessary recompilation cycles when keeping -# cross-compilation toolchains up-to-date. Thus, unconditionally use the -# supplied `install-sh', as the GNU Coreutils one doesn't provide this -# functionality yet (TODO: change that). TODO: $ac_abs_top_builddir et al. are -# not yet available here, that's why we use `readlink' (but only if available). -INSTALL="$SHELL $(readlink -f "$ac_install_sh")"\ -C || unset INSTALL -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Require GCC. -if test x$GCC != xyes; then - as_fn_error $? "this code uses GNU C extensions, you must compile with GCC" "$LINENO" 5 -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. -set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LD="${ac_tool_prefix}ld" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LD"; then - ac_ct_LD=$LD - # Extract the first word of "ld", so it can be a program name with args. -set dummy ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LD"; then - ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LD="ld" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LD=$ac_cv_prog_ac_ct_LD -if test -n "$ac_ct_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 -$as_echo "$ac_ct_LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LD" = x; then - LD="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LD=$ac_ct_LD - fi -else - LD="$ac_cv_prog_LD" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - # Extract the first word of "objcopy", so it can be a program name with args. -set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -else - OBJCOPY="$ac_cv_prog_OBJCOPY" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. -set dummy ${ac_tool_prefix}mig; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MIG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MIG"; then - ac_cv_prog_MIG="$MIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MIG="${ac_tool_prefix}mig" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MIG=$ac_cv_prog_MIG -if test -n "$MIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5 -$as_echo "$MIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MIG"; then - ac_ct_MIG=$MIG - # Extract the first word of "mig", so it can be a program name with args. -set dummy mig; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MIG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MIG"; then - ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MIG="mig" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MIG=$ac_cv_prog_ac_ct_MIG -if test -n "$ac_ct_MIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MIG" >&5 -$as_echo "$ac_ct_MIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MIG" = x; then - MIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MIG=$ac_ct_MIG - fi -else - MIG="$ac_cv_prog_MIG" -fi - -# Require MiG. -if test x${MIG} = x; then - as_fn_error $? " -*** You need GNU MiG to compile the GNU Hurd, please see -*** http://www.gnu.org/software/hurd/mig.html for further details, or -*** download it directly from the main GNU server (ftp.gnu.org) or any -*** GNU mirror." "$LINENO" 5 -fi - - - -# See if there's a separate libcrypt (many systems put crypt there). - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 -$as_echo_n "checking for crypt in -lcrypt... " >&6; } -if test "${ac_cv_lib_crypt_crypt+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char crypt (); -int -main () -{ -return crypt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypt_crypt=yes -else - ac_cv_lib_crypt_crypt=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 -$as_echo "$ac_cv_lib_crypt_crypt" >&6; } -if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : - LIBCRYPT=-lcrypt -fi - - - -# See if mig groks `retcode'. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $MIG supports the retcode keyword" >&5 -$as_echo_n "checking whether $MIG supports the retcode keyword... " >&6; } -if test "${hurd_cv_mig_retcode+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.defs <<\EOF -#include <mach/std_types.defs> -#include <mach/mach_types.defs> -subsystem foobar 1000; -type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE - ctype: mach_port_t; -simpleroutine foobar_reply ( - reply_port: reply_port_t; - err: kern_return_t, RetCode); -EOF -if { ac_try='CC="${CC}" ${MIG-false} -n conftest.defs 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - hurd_cv_mig_retcode=yes -else - hurd_cv_mig_retcode=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_mig_retcode" >&5 -$as_echo "$hurd_cv_mig_retcode" >&6; } -if test $hurd_cv_mig_retcode = yes; then - $as_echo "#define HAVE_MIG_RETCODE 1" >>confdefs.h - -fi - -# See if --version-script is available. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --version-script" >&5 -$as_echo_n "checking for ld --version-script... " >&6; } -if test "${hurd_cv_ld_version_script_option+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <<\EOF -void foobar() {} -EOF -cat > conftest.map <<\EOF -VERS_1 { - global: sym; -}; - -VERS_2 { - global: sym; -} VERS_1; -EOF - -if { ac_try='eval $ac_compile 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } && - { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o - -nostartfiles -nostdlib - -Wl,--version-script,conftest.map - 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - hurd_cv_ld_version_script_option=yes -else - hurd_cv_ld_version_script_option=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_ld_version_script_option" >&5 -$as_echo "$hurd_cv_ld_version_script_option" >&6; } - -# See if libc was built with --enable-libio. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libio" >&5 -$as_echo_n "checking for libio... " >&6; } -if test "${hurd_cv_libio+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -#ifndef _STDIO_USES_IOSTREAM -# error No libio found. -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - hurd_cv_libio=yes -else - hurd_cv_libio=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_libio" >&5 -$as_echo "$hurd_cv_libio" >&6; } - -# The versions of the symbols in libthreads have to match those in -# libc.so. Since the symbols in a libc that includes libio will be -# versioned differently from the ones in a libc that uses stdio, this -# isn't easy to accomplish. Instead we leave things unversioned if -# libio isn't found. -if test $hurd_cv_libio = yes; then - VERSIONING=$hurd_cv_ld_version_script_option -else - VERSIONING=no -fi - - -# Check if libc contains getgrouplist and/or uselocale. -for ac_func in getgrouplist uselocale -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -# From glibc HEAD, 2007-11-07. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline" >&5 -$as_echo_n "checking for -fgnu89-inline... " >&6; } -if test "${libc_cv_gnu89_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <<EOF -int foo; -#ifdef __GNUC_GNU_INLINE__ -main () { return 0;} -#else -#error -#endif -EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline - -o conftest.s conftest.c 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then - libc_cv_gnu89_inline=yes -else - libc_cv_gnu89_inline=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gnu89_inline" >&5 -$as_echo "$libc_cv_gnu89_inline" >&6; } -if test $libc_cv_gnu89_inline = yes; then - libc_cv_gnu89_inline=-fgnu89-inline -else - libc_cv_gnu89_inline= -fi - - - -# Insist on libparted unless the user declines explicitely - -# Check whether --with-parted was given. -if test "${with_parted+set}" = set; then : - withval=$with_parted; -else - with_parted=yes -fi - - -PARTED_LIBS= - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "x$with_parted" != xno; then : - - ac_fn_c_check_header_mongrel "$LINENO" "parted/parted.h" "ac_cv_header_parted_parted_h" "$ac_includes_default" -if test "x$ac_cv_header_parted_parted_h" = x""yes; then : - $as_echo "#define HAVE_PARTED_PARTED_H 1" >>confdefs.h - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Please install required libraries or use --without-parted. -See \`config.log' for more details" "$LINENO" 5; } - -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ped_device_read in -lparted" >&5 -$as_echo_n "checking for ped_device_read in -lparted... " >&6; } -if test "${ac_cv_lib_parted_ped_device_read+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lparted $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ped_device_read (); -int -main () -{ -return ped_device_read (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_parted_ped_device_read=yes -else - ac_cv_lib_parted_ped_device_read=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_parted_ped_device_read" >&5 -$as_echo "$ac_cv_lib_parted_ped_device_read" >&6; } -if test "x$ac_cv_lib_parted_ped_device_read" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPARTED 1 -_ACEOF - - LIBS="-lparted $LIBS" - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Please install required libraries or use --without-parted. -See \`config.log' for more details" "$LINENO" 5; } - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 -$as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char uuid_generate (); -int -main () -{ -return uuid_generate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_uuid_uuid_generate=yes -else - ac_cv_lib_uuid_uuid_generate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF - - LIBS="-luuid $LIBS" - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Please install required libraries or use --without-parted. -See \`config.log' for more details" "$LINENO" 5; } - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBS="-ldl $LIBS" - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Please install required libraries or use --without-parted. -See \`config.log' for more details" "$LINENO" 5; } - -fi - - PARTED_LIBS="-lparted -luuid -ldl" - -fi - - -# Check whether --enable-boot-store-types was given. -if test "${enable_boot_store_types+set}" = set; then : - enableval=$enable_boot_store_types; -fi -if test -z "$enable_boot_store_types"; then - boot_store_types='device remap gunzip bunzip2' - test -z "$PARTED_LIBS" || boot_store_types="$boot_store_types part" -elif test "x$enable_boot_store_types" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: you probably wanted --disable-static-progs" >&5 -$as_echo "$as_me: WARNING: you probably wanted --disable-static-progs" >&2;} -else - boot_store_types="$enable_boot_store_types" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking boot store types" >&5 -$as_echo_n "checking boot store types... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_store_types" >&5 -$as_echo "$boot_store_types" >&6; } - -# Check for ncursesw, which is needed for the console-curses client. - - # Check whether --enable-ncursesw was given. -if test "${enable_ncursesw+set}" = set; then : - enableval=$enable_ncursesw; -else - enable_ncursesw=yes -fi - - if test "$enable_ncursesw" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncursesw" >&5 -$as_echo_n "checking for initscr in -lncursesw... " >&6; } -if test "${ac_cv_lib_ncursesw_initscr+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncursesw $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char initscr (); -int -main () -{ -return initscr (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ncursesw_initscr=yes -else - ac_cv_lib_ncursesw_initscr=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_initscr" >&5 -$as_echo "$ac_cv_lib_ncursesw_initscr" >&6; } -if test "x$ac_cv_lib_ncursesw_initscr" = x""yes; then : - LIBNCURSESW="-lncursesw" -fi - - if test "$LIBNCURSESW"; then - -# Check whether --with-ncursesw-include-dir was given. -if test "${with_ncursesw_include_dir+set}" = set; then : - withval=$with_ncursesw_include_dir; -fi - if test "${with_ncursesw_include_dir+set}" = set; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncursesw include dir" >&5 -$as_echo_n "checking for ncursesw include dir... " >&6; } - case "$with_ncursesw_include_dir" in - no|none) - hurd_cv_includedir_ncursesw=none;; - *) - hurd_cv_includedir_ncursesw="$with_ncursesw_include_dir";; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_includedir_ncursesw" >&5 -$as_echo "$hurd_cv_includedir_ncursesw" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncursesw include dir" >&5 -$as_echo_n "checking for ncursesw include dir... " >&6; } -if test "${hurd_cv_includedir_ncursesw+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do - if test -d $D/ncursesw; then - hurd_cv_includedir_ncursesw="$D/ncursesw" - break - fi - test "$hurd_cv_includedir_ncursesw" \ - || hurd_cv_includedir_ncursesw=none - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_includedir_ncursesw" >&5 -$as_echo "$hurd_cv_includedir_ncursesw" >&6; } - fi - if test "$hurd_cv_includedir_ncursesw" = none; then - NCURSESW_INCLUDE="" - else - NCURSESW_INCLUDE="-I$hurd_cv_includedir_ncursesw" - fi - fi - fi - - - -# Check for Sun RPC headers and library. -ac_fn_c_check_header_mongrel "$LINENO" "rpc/types.h" "ac_cv_header_rpc_types_h" "$ac_includes_default" -if test "x$ac_cv_header_rpc_types_h" = x""yes; then : - HAVE_SUN_RPC=yes -else - HAVE_SUN_RPC=no -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clnt_create" >&5 -$as_echo_n "checking for library containing clnt_create... " >&6; } -if test "${ac_cv_search_clnt_create+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clnt_create (); -int -main () -{ -return clnt_create (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clnt_create=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_clnt_create+set}" = set; then : - break -fi -done -if test "${ac_cv_search_clnt_create+set}" = set; then : - -else - ac_cv_search_clnt_create=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clnt_create" >&5 -$as_echo "$ac_cv_search_clnt_create" >&6; } -ac_res=$ac_cv_search_clnt_create -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - : -else - HAVE_SUN_RPC=no -fi - - - -if test -f ./$ac_unique_file; then - # Configuring in source directory; don't create any Makefiles. - makefiles= -else - # We are configuring in a separate build tree. - # Create a Makefile in the top-level build directory and - # one for each subdirectory Makefile in the source. - makefiles="Makeconf:build.mkcf.in \ - `cd $srcdir; for file in Makefile */Makefile; do \ - echo ${file}:build.mk.in; done`" -fi - -ac_config_files="$ac_config_files config.make ${makefiles}" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by GNU Hurd $as_me 0.3, which was -generated by GNU Autoconf 2.67. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to <bug-hurd@gnu.org>. -GNU Hurd home page: <http://www.gnu.org/software/hurd/>. -General help using GNU software: <http://www.gnu.org/gethelp/>." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -GNU Hurd config.status 0.3 -configured by $0, generated by GNU Autoconf 2.67, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;; - "${makefiles}") CONFIG_FILES="$CONFIG_FILES ${makefiles}" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/libdde_linux26/lib/src/arch/l4/softirq.c b/libdde_linux26/lib/src/arch/l4/softirq.c index 21b36d17..247a414f 100644 --- a/libdde_linux26/lib/src/arch/l4/softirq.c +++ b/libdde_linux26/lib/src/arch/l4/softirq.c @@ -177,6 +177,7 @@ static void tasklet_hi_action(struct softirq_action *a) /** Run softirq handlers */ +asmlinkage void __do_softirq(void) { int retries = MAX_SOFTIRQ_RETRIES; @@ -205,6 +206,7 @@ void __do_softirq(void) } +asmlinkage void do_softirq(void) { unsigned long flags; diff --git a/libpthread/ChangeLog b/libpthread/ChangeLog deleted file mode 100644 index e991eac7..00000000 --- a/libpthread/ChangeLog +++ /dev/null @@ -1,6 +0,0 @@ -51839d398b0f9885a17ab5c0768b8dec4dd9eb79 is the last commit imported from CVS. -All commits after that one have valid author and committer information. - -Use this to examine the change log for earlier changes: - - $ git show 51839d398b0f9885a17ab5c0768b8dec4dd9eb79:ChangeLog diff --git a/libpthread/Makefile b/libpthread/Makefile deleted file mode 100644 index a1801f5c..00000000 --- a/libpthread/Makefile +++ /dev/null @@ -1,249 +0,0 @@ -# -# Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007, -# 2008, 2011 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, 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, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -dir := libpthread -makemode := library - -MICROKERNEL := mach -SYSDEPS := lockfile.c - -LCLHDRS := - -SRCS := pt-attr.c pt-attr-destroy.c pt-attr-getdetachstate.c \ - pt-attr-getguardsize.c pt-attr-getinheritsched.c \ - pt-attr-getschedparam.c pt-attr-getschedpolicy.c pt-attr-getscope.c \ - pt-attr-getstack.c pt-attr-getstackaddr.c pt-attr-getstacksize.c \ - pt-attr-init.c pt-attr-setdetachstate.c pt-attr-setguardsize.c \ - pt-attr-setinheritsched.c pt-attr-setschedparam.c \ - pt-attr-setschedpolicy.c pt-attr-setscope.c pt-attr-setstack.c \ - pt-attr-setstackaddr.c pt-attr-setstacksize.c \ - \ - pt-barrier-destroy.c pt-barrier-init.c pt-barrier-wait.c \ - pt-barrier.c pt-barrierattr-destroy.c pt-barrierattr-init.c \ - pt-barrierattr-getpshared.c pt-barrierattr-setpshared.c \ - \ - pt-destroy-specific.c pt-init-specific.c \ - pt-key-create.c pt-key-delete.c \ - pt-getspecific.c pt-setspecific.c \ - \ - pt-once.c \ - \ - pt-alloc.c \ - pt-create.c \ - pt-getattr.c \ - pt-equal.c \ - pt-dealloc.c \ - pt-detach.c \ - pt-exit.c \ - pt-initialize.c \ - pt-join.c \ - pt-self.c \ - pt-sigmask.c \ - pt-spin-inlines.c \ - pt-cleanup.c \ - pt-setcancelstate.c \ - pt-setcanceltype.c \ - pt-testcancel.c \ - pt-cancel.c \ - \ - pt-mutexattr.c \ - pt-mutexattr-destroy.c pt-mutexattr-init.c \ - pt-mutexattr-getprioceiling.c pt-mutexattr-getprotocol.c \ - pt-mutexattr-getpshared.c pt-mutexattr-gettype.c \ - pt-mutexattr-setprioceiling.c pt-mutexattr-setprotocol.c \ - pt-mutexattr-setpshared.c pt-mutexattr-settype.c \ - \ - pt-mutex-init.c pt-mutex-destroy.c \ - pt-mutex-lock.c pt-mutex-trylock.c pt-mutex-timedlock.c \ - pt-mutex-unlock.c \ - pt-mutex-transfer-np.c \ - pt-mutex-getprioceiling.c pt-mutex-setprioceiling.c \ - \ - pt-rwlock-attr.c \ - pt-rwlockattr-init.c pt-rwlockattr-destroy.c \ - pt-rwlockattr-getpshared.c pt-rwlockattr-setpshared.c \ - \ - pt-rwlock-init.c pt-rwlock-destroy.c \ - pt-rwlock-rdlock.c pt-rwlock-tryrdlock.c \ - pt-rwlock-trywrlock.c pt-rwlock-wrlock.c \ - pt-rwlock-timedrdlock.c pt-rwlock-timedwrlock.c \ - pt-rwlock-unlock.c \ - \ - pt-cond.c \ - pt-condattr-init.c pt-condattr-destroy.c \ - pt-condattr-getclock.c pt-condattr-getpshared.c \ - pt-condattr-setclock.c pt-condattr-setpshared.c \ - \ - pt-cond-destroy.c pt-cond-init.c \ - pt-cond-brdcast.c \ - pt-cond-signal.c \ - pt-cond-wait.c \ - pt-cond-timedwait.c \ - \ - pt-stack-alloc.c \ - pt-thread-alloc.c \ - pt-thread-dealloc.c \ - pt-thread-start.c \ - pt-thread-halt.c \ - pt-startup.c \ - \ - pt-getconcurrency.c pt-setconcurrency.c \ - \ - pt-block.c \ - pt-timedblock.c \ - pt-wakeup.c \ - pt-docancel.c \ - pt-sysdep.c \ - pt-setup.c \ - pt-machdep.c \ - pt-spin.c \ - \ - pt-sigstate-init.c \ - pt-sigstate-destroy.c \ - pt-sigstate.c \ - \ - pt-atfork.c \ - pt-kill.c \ - pt-getcpuclockid.c \ - \ - pt-getschedparam.c pt-setschedparam.c pt-setschedprio.c \ - pt-yield.c \ - \ - sem-close.c sem-destroy.c sem-getvalue.c sem-init.c sem-open.c \ - sem-post.c sem-timedwait.c sem-trywait.c sem-unlink.c \ - sem-wait.c \ - \ - cthreads-compat.c \ - $(SYSDEPS) - -OBJS = $(addsuffix .o,$(basename $(notdir $(SRCS)))) - -OTHERTAGS = - -libname = libpthread - -sysdeps_headers = \ - pthread.h \ - pthread/pthread.h \ - pthread/pthreadtypes.h \ - semaphore.h \ - \ - bits/pthread.h \ - bits/pthread-np.h \ - bits/mutex.h \ - bits/condition.h \ - bits/condition-attr.h \ - bits/spin-lock.h \ - bits/spin-lock-inline.h \ - bits/cancelation.h \ - bits/thread-attr.h \ - bits/barrier-attr.h \ - bits/barrier.h \ - bits/thread-specific.h \ - bits/once.h \ - bits/mutex-attr.h \ - bits/rwlock.h \ - bits/rwlock-attr.h \ - bits/semaphore.h - -SYSDEP_PATH = $(srcdir)/sysdeps/$(MICROKERNEL)/hurd/ia32 \ - $(srcdir)/sysdeps/$(MICROKERNEL)/ia32 \ - $(srcdir)/sysdeps/ia32 \ - $(srcdir)/sysdeps/$(MICROKERNEL)/hurd \ - $(srcdir)/sysdeps/$(MICROKERNEL) \ - $(srcdir)/sysdeps/hurd \ - $(srcdir)/sysdeps/generic \ - $(srcdir)/sysdeps/posix \ - $(srcdir)/pthread \ - $(srcdir)/include - -VPATH += $(SYSDEP_PATH) - -HURDLIBS = ihash - -installhdrs := -installhdrsubdir := . - -include ../Makeconf - -CPPFLAGS += \ - -DENABLE_TLS \ - $(addprefix -I, $(SYSDEP_PATH)) \ - -imacros $(srcdir)/include/libc-symbols.h \ - -imacros $(srcdir)/not-in-libc.h - - -install: install-headers $(libdir)/libpthread2.a $(libdir)/libpthread2_pic.a -install-headers: $(addprefix $(includedir)/, $(sysdeps_headers)) - -# XXX: If $(libdir)/libpthread2.a is installed and -# $(libdir)/libpthread is not, we can have some issues. -.PHONY: $(libdir)/libpthread.a $(libdir)/libpthread_pic.a - -# XXX: These rules are a hack. But it is better than messing with -# ../Makeconf at the moment. Note that the linker scripts -# $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten -# when building in $(srcdir) and not a seperate build directory. -$(libdir)/libpthread2.a: $(libdir)/libpthread.a - mv $< $@ - $(INSTALL_DATA) $(srcdir)/libpthread.a $< - -$(libdir)/libpthread2_pic.a: $(libdir)/libpthread_pic.a - mv $< $@ - $(INSTALL_DATA) $(srcdir)/libpthread_pic.a $< - -.PHONY: $(addprefix $(includedir)/, $(sysdeps_headers)) - -$(addprefix $(includedir)/, $(sysdeps_headers)): - @set -e; \ - t="$@"; \ - t=$${t#$(includedir)/}; \ - header_ok=0; \ - for dir in $(SYSDEP_PATH); \ - do \ - if test -e "$$dir/$$t"; \ - then \ - tdir=`dirname "$@"`; \ - if test ! -e $$tdir; \ - then \ - mkdir $$tdir; \ - fi; \ - echo $(INSTALL_DATA) "$$dir/$$t" "$@"; \ - $(INSTALL_DATA) "$$dir/$$t" "$@"; \ - header_ok=1; \ - break; \ - fi; \ - done; \ - if test "$${header_ok}" -ne 1; \ - then \ - echo; \ - echo '*** 'The header file \`$@\' is required, but not \ -provided, by; \ - echo '*** 'this configuration. Please report this to the \ -maintainer.; \ - echo; \ - false; \ - fi - -# ifeq ($(VERSIONING),yes) -# -# # Adding this dependency gets it included in the command line, -# # where ld will read it as a linker script. -# $(libname).so.$(hurd-version): $(srcdir)/$(libname).map -# -# endif diff --git a/libpthread/Makefile.am b/libpthread/Makefile.am deleted file mode 100644 index e1c062c1..00000000 --- a/libpthread/Makefile.am +++ /dev/null @@ -1,168 +0,0 @@ -# Makefile.am - Makefile template for libpthread. -# Copyright (C) 2003, 2008 Free Software Foundation, Inc. -# -# This file is part of the GNU Hurd. -# -# The GNU Hurd is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# The GNU Hurd 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -if ARCH_IA32 - arch=ia32 -endif -if ARCH_POWERPC - arch=powerpc -endif - -# The source files are scattered over several directories. Add -# all these directories to the vpath. -SYSDEP_PATH = $(srcdir)/sysdeps/l4/hurd/${arch} \ - $(srcdir)/sysdeps/l4/${arch} \ - $(srcdir)/sysdeps/${arch} \ - $(srcdir)/sysdeps/l4/hurd \ - $(srcdir)/sysdeps/l4 \ - $(srcdir)/sysdeps/hurd \ - $(srcdir)/sysdeps/generic \ - $(srcdir)/sysdeps/posix \ - $(srcdir)/pthread \ - $(srcdir)/signal \ - $(srcdir)/include -vpath %.c $(SYSDEP_PATH) - -AM_CPPFLAGS = $(USER_CPPFLAGS) -I$(srcdir)/pthread \ - $(addprefix -I, $(SYSDEP_PATH)) -imacros $(srcdir)/include/libc-symbols.h -AM_CFLAGS = $(USER_CFLAGS) - -# Sources. -SYSDEPS := lockfile.c - -if ! ENABLE_TESTS -noinst_LIBRARIES = libpthread.a -endif - -libpthread_a_SOURCES = pt-attr.c pt-attr-destroy.c pt-attr-getdetachstate.c \ - pt-attr-getguardsize.c pt-attr-getinheritsched.c \ - pt-attr-getschedparam.c pt-attr-getschedpolicy.c pt-attr-getscope.c \ - pt-attr-getstack.c pt-attr-getstackaddr.c pt-attr-getstacksize.c \ - pt-attr-init.c pt-attr-setdetachstate.c pt-attr-setguardsize.c \ - pt-attr-setinheritsched.c pt-attr-setschedparam.c \ - pt-attr-setschedpolicy.c pt-attr-setscope.c pt-attr-setstack.c \ - pt-attr-setstackaddr.c pt-attr-setstacksize.c pt-attr.c \ - pt-barrier-destroy.c pt-barrier-init.c pt-barrier-wait.c \ - pt-barrier.c pt-barrierattr-destroy.c pt-barrierattr-init.c \ - pt-barrierattr-getpshared.c pt-barrierattr-setpshared.c \ - pt-destroy-specific.c pt-init-specific.c \ - pt-key-create.c pt-key-delete.c \ - pt-getspecific.c pt-setspecific.c \ - pt-once.c \ - pt-alloc.c \ - pt-create.c \ - pt-getattr.c \ - pt-pool-np.c \ - pt-equal.c \ - pt-dealloc.c \ - pt-detach.c \ - pt-exit.c \ - pt-initialize.c \ - pt-join.c \ - pt-self.c \ - pt-sigmask.c \ - pt-spin-inlines.c \ - pt-cleanup.c \ - pt-setcancelstate.c \ - pt-setcanceltype.c \ - pt-testcancel.c \ - pt-cancel.c \ - pt-mutexattr.c \ - pt-mutexattr-destroy.c pt-mutexattr-init.c \ - pt-mutexattr-getprioceiling.c pt-mutexattr-getprotocol.c \ - pt-mutexattr-getpshared.c pt-mutexattr-gettype.c \ - pt-mutexattr-setprioceiling.c pt-mutexattr-setprotocol.c \ - pt-mutexattr-setpshared.c pt-mutexattr-settype.c \ - pt-mutex-init.c pt-mutex-destroy.c \ - pt-mutex-lock.c pt-mutex-trylock.c pt-mutex-timedlock.c \ - pt-mutex-unlock.c \ - pt-mutex-transfer-np.c \ - pt-mutex-getprioceiling.c pt-mutex-setprioceiling.c \ - pt-rwlock-attr.c \ - pt-rwlockattr-init.c pt-rwlockattr-destroy.c \ - pt-rwlockattr-getpshared.c pt-rwlockattr-setpshared.c \ - pt-rwlock-init.c pt-rwlock-destroy.c \ - pt-rwlock-rdlock.c pt-rwlock-tryrdlock.c \ - pt-rwlock-trywrlock.c pt-rwlock-wrlock.c \ - pt-rwlock-timedrdlock.c pt-rwlock-timedwrlock.c \ - pt-rwlock-unlock.c \ - pt-cond.c \ - pt-condattr-init.c pt-condattr-destroy.c \ - pt-condattr-getclock.c pt-condattr-getpshared.c \ - pt-condattr-setclock.c pt-condattr-setpshared.c \ - pt-cond-destroy.c pt-cond-init.c \ - pt-cond-brdcast.c \ - pt-cond-signal.c \ - pt-cond-wait.c \ - pt-cond-timedwait.c \ - pt-stack-alloc.c \ - pt-thread-alloc.c \ - pt-thread-dealloc.c \ - pt-thread-start.c \ - pt-thread-halt.c \ - pt-startup.c \ - pt-getconcurrency.c pt-setconcurrency.c \ - pt-block.c \ - pt-timedblock.c \ - pt-wakeup.c \ - pt-docancel.c \ - pt-sysdep.c \ - pt-setup.c \ - pt-machdep.c \ - pt-spin.c \ - pt-sigstate-init.c \ - pt-sigstate-destroy.c \ - pt-sigstate.c \ - pt-atfork.c \ - pt-kill.c \ - pt-getcpuclockid.c \ - pt-getschedparam.c pt-setschedparam.c pt-setschedprio.c \ - pt-yield.c \ - sem-close.c sem-init.c sem-timedwait.c sem-wait.c \ - sem-destroy.c sem-open.c sem-trywait.c sem-getvalue.c \ - sem-post.c sem-unlink.c \ - \ - pt-setactivity-np.c \ - \ - kill.c \ - killpg.c \ - pt-kill-siginfo-np.c \ - raise.c \ - sigaction.c \ - sigaddset.c \ - sigaltstack.c \ - sigdelset.c \ - sigemptyset.c \ - sigfillset.c \ - sig-internal.c \ - sig-internal.h \ - siginterrupt.c \ - sigismember.c \ - signal.c \ - signal-dispatch.c \ - signal.h \ - sigpending.c \ - sigprocmask.c \ - sigsuspend.c \ - sigtimedwait.c \ - sigwait.c \ - sigwaiter.c \ - sigwaitinfo.c \ - signal-dispatch-lowlevel.c \ - sigprocmask.c diff --git a/libpthread/TODO b/libpthread/TODO deleted file mode 100644 index d7e54da6..00000000 --- a/libpthread/TODO +++ /dev/null @@ -1,177 +0,0 @@ --*- Mode: outline -*- - -* Interfaces -** All interfaces specified by IEEE Std 1003.1-2001 are present, however, - pthread_kill and pthread_sigmask are defined in <pthread.h> and not - <signal.h> as they should be. Once we are compiled with glibc, - this should be eaiser. - -* Test cases. Can never have enough. - -* Ports - Port to other kernels (e.g. Linux and FreeBSD) and test on other - platforms. - -* Implementation details -** pthread_atfork - This cannot be implemented without either changing glibc to export - some hooks (c.f. libc/sysdeps/mach/hurd/fork.c) or by providing a - custom fork implementation that wraps the origial using dlopen et - al. - -** Scheduling and priorities - - We do not support scheduling right now in any way what so ever. - - This affects: - pthread_attr_getinheritsched - pthread_attr_setinheritsched - pthread_attr_getschedparam - pthread_attr_setschedparam - pthread_attr_getschedpolicy - pthread_attr_setschedpolicy - pthread_attr_getscope - pthread_attr_setscope - - pthread_mutexattr_getprioceiling - pthread_mutexattr_setprioceiling - pthread_mutexattr_getprotocol - pthread_mutexattr_setprotocol - pthread_mutex_getprioceiling - pthread_mutex_setprioceiling - - pthread_setschedprio - pthread_getschedparam - pthread_setschedparam - -** Alternate stacks - - Supporting alternate stacks (via pthread_attr_getstackaddr, - pthread_attr_setstackaddr, pthread_attr_getstack, - pthread_attr_setstack, pthread_attr_getstacksize and - pthread_attr_setstacksize) is no problem as long as they are of the - correct size and have the correct alignment. This is due to - limitations in the Hurd TSD implementation - (c.f. <hurd/threadvar.h>). - -** Cancelation -*** Cancelation points - The only cancelation points are pthread_join, pthread_cond_wait, - pthead_cond_timedwait and pthread_testcancel. Need to explore if - the hurd_sigstate->cancel_hook (c.f. <hurd/signal.h>) provides the - desired semantics. If not, must either wrap the some functions - using dlsym or wait until integration with glibc. -*** Async cancelation - We inject a new IP into the cancelled (running) thread and then - run the cancelation handlers - (c.f. sysdeps/mach/hurd/pt-docancel.c). The handlers need to have - access to the stack as they may use local variables. I think that - this method may leave the frame pointer in a corrupted state if - the thread was in, for instance, the middle of a function call. - The robustness needs to be confirmed. - -** Process Shared Attribute - - Currently, there is no real support for the process shared - attribute. spinlocks work because we just use a test and set loop, - however, barriers, conditions mutexes and rwlocks, however, signal - wakeups via ports of which the names are process local. - - We could have some process local data that is hashed to via the - address of the data structure. Then the first thread that blocks - per process would spin on the shared memory area and all others - would then block as normal. When the resource became available, - the first thread would signal the other local threads as necessary. - Alternatively, there could be some server, however, this opens a - new question: what can we use as an authentication agent. - -** Locking algorithm - - When a thread blocks, it puts itself on a queue and then waits for - a message on a thread local port. The thread which eventually does - the wakeup sends a message to the waiter thereby waking it up. If - the wakeup is a broadcast wakeup (e.g. pthread_cond_broadcast, - pthread_barrier_wait and pthread_rdlock_unlock), the thread must - send O(N) messages where N is the number of waiting threads. If - all the threads instead received on a lock local (rather than - thread local) port then the thread which eventually does the wake - need just do one operation, mach_port_destroy and all of the - waiting threads would wakeup and get MACH_RCV_PORT_DIED back from - mach_msg. Note that the trade off is that the port must be - recreated. This needs to be benchmarked. - - A possible problem with this is scheduling priorities. There may - be a preference for certain threads to wakeup before others - (especially if we are not doing a broadcast, for instance, - pthread_mutex_unlock and pthread_cond_signal). If we take this - approach, the kernel chooses which threads are awakened. If we - find that the kernel makes the wrong choices, we can still overcome - this by merging the two algorithms: have a list of ports sorted in - priority order and the waker does a mach_port_destroy on each as - appropriate. - -** Barriers - - Barriers can be very slow and the contention can be very high. The - above algorithm is very appealing, however, this may be augmented - with an initial number of spins and yields. It is expected that - all of the threads reach the barrier within close succession, thus - queuing a message may be more expensive. This needs to be - benchmarked. - -** Clocks -*** pthread_condattr_setclock allows a process to specify a clock for - use with pthread_cond_timedwaits. What is the correct default for - this, right now, we use CLOCK_REALTIME, however, we are really - using the system clock which, if I understand correctly, is - completely different. -*** Could we even use other clocks? mach_msg uses a relative time against - the system clock. -*** pthread_getcpuclockid just returns CLOCK_THREAD_CPUTIME_ID if defined. - Is this the correct behavior? - -** Timed Blocking -*** pthread_cond_timedwait, pthead_mutex_timedlock, pthread_rwlock_timedrdlock - and pthread_rwlock_timedwrlock all take absolute times. We need - to convert them to relative times for mach_msg. Is there a way - around this? How will clock skew affect us? - -** weak aliases - Use them consistently and correctly and start by reading - http://sources.redhat.com/ml/libc-alpha/2002-08/msg00278.html. - -** TLS - Support for TLS is only implemented for Mach/Hurd (x86). - -* L4 Specific Issues -** Stack -*** Size - The stack size is defined to be a single page in - sysdeps/l4/hurd/pt-sysdep.h. Once we are able to setup regions, - this can be expanded to two megs as suggested by the Mach version. - Until then, however, we need to allocate too much physical memory. -*** Deallocation - __thread_stack_dealloc currently does not deallocate the stack. - For a proper implementation, we need a working memory manager. - -** Scheduling -*** yield - [L4] We cannot use yield for spin locks as L4 only yields to threads of - priority which are greater than or equal to the yielding thread. - If there are threads of lower priority, they are not considered; - the yielding thread is just placed back on the processor. This - introduces priority inversion quite quickly. L4 will not add a - priority suppression function call. As such, we need to do - an ipc with a small time out and then use exponential back off to - do the actual waiting. This sucks. - -** Stub code - [L4] We include <task_client.h> in pt-start.c, however, we need a library - so we do not have to play with the corba stuff. - -** Root server and Task server -*** Getting the tids. - pt-start.c has a wonderfully evil hack that will never work well. - -** Paging - We set the pager to the root server. Evil. Fix this in pt-start.c. diff --git a/libpthread/headers.m4 b/libpthread/headers.m4 deleted file mode 100644 index 5a58b9bf..00000000 --- a/libpthread/headers.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# headers.m4 - Autoconf snippets to install links for header files. -# Copyright 2003, 2008 Free Software Foundation, Inc. -# Written by Marcus Brinkmann <marcus@gnu.org>. -# -# This file is free software; as a special exception the author gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. -# -# This file is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -AC_CONFIG_LINKS([ - sysroot/include/pthread.h:libpthread/include/pthread.h - sysroot/include/pthread/pthread.h:libpthread/include/pthread/pthread.h - sysroot/include/pthread/pthreadtypes.h:libpthread/include/pthread/pthreadtypes.h - sysroot/include/bits/memory.h:libpthread/sysdeps/${arch}/bits/memory.h - sysroot/include/bits/spin-lock.h:libpthread/sysdeps/${arch}/bits/spin-lock.h - sysroot/include/bits/spin-lock-inline.h:libpthread/sysdeps/${arch}/bits/spin-lock-inline.h - sysroot/include/bits/pthreadtypes.h:libpthread/sysdeps/generic/bits/pthreadtypes.h - sysroot/include/bits/barrier-attr.h:libpthread/sysdeps/generic/bits/barrier-attr.h - sysroot/include/bits/barrier.h:libpthread/sysdeps/generic/bits/barrier.h - sysroot/include/bits/cancelation.h:libpthread/sysdeps/generic/bits/cancelation.h - sysroot/include/bits/condition-attr.h:libpthread/sysdeps/generic/bits/condition-attr.h - sysroot/include/bits/condition.h:libpthread/sysdeps/generic/bits/condition.h - sysroot/include/bits/mutex-attr.h:libpthread/sysdeps/generic/bits/mutex-attr.h - sysroot/include/bits/mutex.h:libpthread/sysdeps/generic/bits/mutex.h - sysroot/include/bits/once.h:libpthread/sysdeps/generic/bits/once.h - sysroot/include/bits/pthread.h:libpthread/sysdeps/generic/bits/pthread.h - sysroot/include/bits/rwlock-attr.h:libpthread/sysdeps/generic/bits/rwlock-attr.h - sysroot/include/bits/rwlock.h:libpthread/sysdeps/generic/bits/rwlock.h - sysroot/include/bits/thread-attr.h:libpthread/sysdeps/generic/bits/thread-attr.h - sysroot/include/bits/thread-barrier.h:libpthread/sysdeps/generic/bits/thread-barrier.h - sysroot/include/bits/thread-specific.h:libpthread/sysdeps/generic/bits/thread-specific.h - sysroot/include/bits/pthread-np.h:libpthread/sysdeps/l4/hurd/bits/pthread-np.h - sysroot/include/semaphore.h:libpthread/include/semaphore.h - sysroot/include/bits/semaphore.h:libpthread/sysdeps/generic/bits/semaphore.h - sysroot/include/signal.h:libpthread/signal/signal.h -]) - -AC_CONFIG_COMMANDS_POST([ - mkdir -p sysroot/lib libpthread && - ln -sf ../../libpthread/libpthread.a sysroot/lib/ && - touch libpthread/libpthread.a -]) diff --git a/libpthread/include/libc-symbols.h b/libpthread/include/libc-symbols.h deleted file mode 100644 index 54dd6e26..00000000 --- a/libpthread/include/libc-symbols.h +++ /dev/null @@ -1,395 +0,0 @@ -/* Support macros for making weak and strong aliases for symbols, - and for using symbol sets and linker warnings with GNU ld. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2008 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LIBC_SYMBOLS_H -#define _LIBC_SYMBOLS_H 1 - -/* This file's macros are included implicitly in the compilation of every - file in the C library by -imacros. - - We include config.h which is generated by configure. - It should define for us the following symbols: - - * HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'. - * ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'. - * HAVE_GNU_LD if using GNU ld, with support for weak symbols in a.out, - and for symbol set and warning messages extensions in a.out and ELF. - * HAVE_ELF if using ELF, which supports weak symbols using `.weak'. - * HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'. - * HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'. - - */ - -/* This is defined for the compilation of all C library code. features.h - tests this to avoid inclusion of stubs.h while compiling the library, - before stubs.h has been generated. Some library code that is shared - with other packages also tests this symbol to see if it is being - compiled as part of the C library. We must define this before including - config.h, because it makes some definitions conditional on whether libc - itself is being compiled, or just some generator program. */ -// #define _LIBC 1 - -/* Enable declarations of GNU extensions, since we are compiling them. */ -#define _GNU_SOURCE 1 -/* And we also need the data for the reentrant functions. */ -#define _REENTRANT 1 - -// #include <config.h> -#define HAVE_ASM_WEAK_DIRECTIVE -#define HAVE_WEAK_SYMBOLS -#define HAVE_ASM_SET_DIRECTIVE -#define HAVE_BUILTIN_EXPECT -#define HAVE_GNU_LD -#define HAVE_ELF -#define HAVE_SECTION_QUOTES -#define HAVE_VISIBILITY_ATTRIBUTE -#define HAVE_ASM_PREVIOUS_DIRECTIVE -// #define SHARED - -/* The symbols in all the user (non-_) macros are C symbols. - HAVE_GNU_LD without HAVE_ELF implies a.out. */ - -#if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE -# define HAVE_WEAK_SYMBOLS -#endif - -#ifndef __SYMBOL_PREFIX -# ifdef NO_UNDERSCORES -# define __SYMBOL_PREFIX -# else -# define __SYMBOL_PREFIX "_" -# endif -#endif - -#ifndef C_SYMBOL_NAME -# ifdef NO_UNDERSCORES -# define C_SYMBOL_NAME(name) name -# else -# define C_SYMBOL_NAME(name) _##name -# endif -#endif - -#ifndef ASM_LINE_SEP -# define ASM_LINE_SEP ; -#endif - -#ifndef C_SYMBOL_DOT_NAME -# define C_SYMBOL_DOT_NAME(name) .##name -#endif - -#ifndef __ASSEMBLER__ -/* GCC understands weak symbols and aliases; use its interface where - possible, instead of embedded assembly language. */ - -/* Define ALIASNAME as a strong alias for NAME. */ -# define strong_alias(name, aliasname) _strong_alias(name, aliasname) -# define _strong_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((alias (#name))); - -/* This comes between the return type and function name in - a function definition to make that definition weak. */ -# define weak_function __attribute__ ((weak)) -# define weak_const_function __attribute__ ((weak, __const__)) - -# ifdef HAVE_WEAK_SYMBOLS - -/* Define ALIASNAME as a weak alias for NAME. - If weak aliases are not available, this defines a strong alias. */ -# define weak_alias(name, aliasname) _weak_alias (name, aliasname) -# define _weak_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); - -/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ -# define weak_extern(symbol) _weak_extern (symbol) -# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE -# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); -# else -# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); -# endif - -# else - -# define weak_alias(name, aliasname) strong_alias(name, aliasname) -# define weak_extern(symbol) /* Nothing. */ - -# endif - -#else /* __ASSEMBLER__ */ - -# ifdef HAVE_ASM_SET_DIRECTIVE -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) -# else -# ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) -# else -# define strong_alias(original, alias) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) -# endif -# endif - -# ifdef HAVE_WEAK_SYMBOLS -# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE -# define weak_alias(original, alias) \ - .weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) -# define weak_extern(symbol) \ - .weakext C_SYMBOL_NAME (symbol) - -# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ - -# ifdef HAVE_ASM_GLOBAL_DOT_NAME -# define weak_alias(original, alias) \ - .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) -# else -# define weak_alias(original, alias) \ - .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ - C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) -# endif - -# define weak_extern(symbol) \ - .weak C_SYMBOL_NAME (symbol) - -# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */ - -# else /* ! HAVE_WEAK_SYMBOLS */ - -# define weak_alias(original, alias) strong_alias(original, alias) -# define weak_extern(symbol) /* Nothing */ -# endif /* ! HAVE_WEAK_SYMBOLS */ - -#endif /* __ASSEMBLER__ */ - -/* On some platforms we can make internal function calls (i.e., calls of - functions not exported) a bit faster by using a different calling - convention. */ -#ifndef internal_function -# define internal_function /* empty */ -#endif - -/* Prepare for the case that `__builtin_expect' is not available. */ -#ifndef HAVE_BUILTIN_EXPECT -# define __builtin_expect(expr, val) (expr) -#endif - -/* Determine the return address. */ -#define RETURN_ADDRESS(nr) \ - __builtin_extract_return_addr (__builtin_return_address (nr)) - -/* When a reference to SYMBOL is encountered, the linker will emit a - warning message MSG. */ -#ifdef HAVE_GNU_LD -# ifdef HAVE_ELF - -/* We want the .gnu.warning.SYMBOL section to be unallocated. */ -# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE -# define __make_section_unallocated(section_string) \ - asm (".section " section_string "\n\t.previous"); -# elif defined HAVE_ASM_POPSECTION_DIRECTIVE -# define __make_section_unallocated(section_string) \ - asm (".pushsection " section_string "\n\t.popsection"); -# else -# define __make_section_unallocated(section_string) -# endif - -/* Tacking on "\n\t#" to the section name makes gcc put it's bogus - section attributes on what looks like a comment to the assembler. */ -# ifdef HAVE_SECTION_QUOTES -# define link_warning(symbol, msg) \ - __make_section_unallocated (".gnu.warning." #symbol) \ - static const char __evoke_link_warning_##symbol[] \ - __attribute__ ((unused, section (".gnu.warning." #symbol "\"\n\t#\""))) \ - = msg; -# else -# define link_warning(symbol, msg) \ - __make_section_unallocated (".gnu.warning." #symbol) \ - static const char __evoke_link_warning_##symbol[] \ - __attribute__ ((unused, section (".gnu.warning." #symbol "\n\t#"))) = msg; -# endif -# else /* Not ELF: a.out */ -# ifdef HAVE_XCOFF -/* XCOFF does not support .stabs. - The native aix linker will remove the .stab and .stabstr sections - The gnu linker will have a fatal error if there is a relocation for - symbol in the .stab section. Silently disable this macro. */ -# define link_warning(symbol, msg) -# else -# define link_warning(symbol, msg) \ - asm (".stabs \"" msg "\",30,0,0,0\n\t" \ - ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n"); -# endif /* XCOFF */ -# endif -#else -/* We will never be heard; they will all die horribly. */ -# define link_warning(symbol, msg) -#endif - -/* A canned warning for sysdeps/stub functions. */ -#define stub_warning(name) \ - link_warning (name, \ - "warning: " #name " is not implemented and will always fail") - -/* - -*/ - -#ifdef HAVE_GNU_LD - -/* Symbol set support macros. */ - -# ifdef HAVE_ELF - -/* Make SYMBOL, which is in the text segment, an element of SET. */ -# define text_set_element(set, symbol) _elf_set_element(set, symbol) -/* Make SYMBOL, which is in the data segment, an element of SET. */ -# define data_set_element(set, symbol) _elf_set_element(set, symbol) -/* Make SYMBOL, which is in the bss segment, an element of SET. */ -# define bss_set_element(set, symbol) _elf_set_element(set, symbol) - -/* These are all done the same way in ELF. - There is a new section created for each set. */ -# ifdef SHARED -/* When building a shared library, make the set section writable, - because it will need to be relocated at run time anyway. */ -# define _elf_set_element(set, symbol) \ - static const void *__elf_set_##set##_element_##symbol##__ \ - __attribute__ ((unused, section (#set))) = &(symbol) -# else -# define _elf_set_element(set, symbol) \ - static const void *const __elf_set_##set##_element_##symbol##__ \ - __attribute__ ((unused, section (#set))) = &(symbol) -# endif - -/* Define SET as a symbol set. This may be required (it is in a.out) to - be able to use the set's contents. */ -# define symbol_set_define(set) symbol_set_declare(set) - -/* Declare SET for use in this module, if defined in another module. */ -# define symbol_set_declare(set) \ - extern void *const __start_##set __attribute__ ((__weak__)); \ - extern void *const __stop_##set __attribute__ ((__weak__)); \ - weak_extern (__start_##set) weak_extern (__stop_##set) - -/* Return a pointer (void *const *) to the first element of SET. */ -# define symbol_set_first_element(set) (&__start_##set) - -/* Return true iff PTR (a void *const *) has been incremented - past the last element in SET. */ -# define symbol_set_end_p(set, ptr) ((ptr) >= &__stop_##set) - -# else /* Not ELF: a.out. */ - -# ifdef HAVE_XCOFF -/* XCOFF does not support .stabs. - The native aix linker will remove the .stab and .stabstr sections - The gnu linker will have a fatal error if there is a relocation for - symbol in the .stab section. Silently disable these macros. */ -# define text_set_element(set, symbol) -# define data_set_element(set, symbol) -# define bss_set_element(set, symbol) -# else -# define text_set_element(set, symbol) \ - asm (".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol) -# define data_set_element(set, symbol) \ - asm (".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol) -# define bss_set_element(set, symbol) ?error Must use initialized data. -# endif /* XCOFF */ -# define symbol_set_define(set) void *const (set)[1]; -# define symbol_set_declare(set) extern void *const (set)[1]; - -# define symbol_set_first_element(set) &(set)[1] -# define symbol_set_end_p(set, ptr) (*(ptr) == 0) - -# endif /* ELF. */ -#else -/* We cannot do anything in generial. */ -# define text_set_element(set, symbol) asm ("") -# define data_set_element(set, symbol) asm ("") -# define bss_set_element(set, symbol) asm ("") -# define symbol_set_define(set) void *const (set)[1]; -# define symbol_set_declare(set) extern void *const (set)[1]; - -# define symbol_set_first_element(set) &(set)[1] -# define symbol_set_end_p(set, ptr) (*(ptr) == 0) -#endif /* Have GNU ld. */ - -#if DO_VERSIONING -# define symbol_version(real, name, version) \ - _symbol_version(real, name, version) -# define default_symbol_version(real, name, version) \ - _default_symbol_version(real, name, version) -# ifdef __ASSEMBLER__ -# define _symbol_version(real, name, version) \ - .symver real, name##@##version -# define _default_symbol_version(real, name, version) \ - .symver real, name##@##@##version -# else -# define _symbol_version(real, name, version) \ - __asm__ (".symver " #real "," #name "@" #version) -# define _default_symbol_version(real, name, version) \ - __asm__ (".symver " #real "," #name "@@" #version) -# endif -#else -# define symbol_version(real, name, version) -# define default_symbol_version(real, name, version) \ - strong_alias(real, name) -#endif - -#if defined HAVE_VISIBILITY_ATTRIBUTE && defined SHARED -# define attribute_hidden __attribute__ ((visibility ("hidden"))) -#else -# define attribute_hidden -#endif - -/* Handling on non-exported internal names. We have to do this only - for shared code. */ -#ifdef SHARED -# define INTUSE(name) name##_internal -# define INTDEF(name) strong_alias (name, name##_internal) -# define INTVARDEF(name) \ - _INTVARDEF (name, name##_internal) -# if defined HAVE_VISIBILITY_ATTRIBUTE -# define _INTVARDEF(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((alias (#name), \ - visibility ("hidden"))); -# else -# define _INTVARDEF(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((alias (#name))); -# endif -# define INTDEF2(name, newname) strong_alias (name, newname##_internal) -# define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal) -#else -# define INTUSE(name) name -# define INTDEF(name) -# define INTVARDEF(name) -# define INTDEF2(name, newname) -# define INTVARDEF2(name, newname) -#endif - -#endif /* libc-symbols.h */ diff --git a/libpthread/include/pthread.h b/libpthread/include/pthread.h deleted file mode 100644 index 1d4d3c7b..00000000 --- a/libpthread/include/pthread.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _PTHREAD_H -#include <pthread/pthread.h> - -extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); -extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); - -#endif diff --git a/libpthread/include/pthread/pthread.h b/libpthread/include/pthread/pthread.h deleted file mode 100644 index cd32fb22..00000000 --- a/libpthread/include/pthread/pthread.h +++ /dev/null @@ -1,755 +0,0 @@ -/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * POSIX Threads Extension: ??? <pthread.h> - */ - -#ifndef _PTHREAD_H -#define _PTHREAD_H 1 - -#include <features.h> - -#include <sys/cdefs.h> -#ifndef __extern_inline -/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 - inline semantics, unless -fgnu89-inline is used. */ -# if !defined __cplusplus || __GNUC_PREREQ (4,3) -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus -# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) -# if __GNUC_PREREQ (4,3) -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) -# else -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__)) -# endif -# else -# define __extern_inline extern __inline -# define __extern_always_inline extern __always_inline -# endif -# endif -#endif - -#include <sched.h> -#include <time.h> - -__BEGIN_DECLS - -#include <pthread/pthreadtypes.h> - -#include <bits/pthread.h> - -/* Possible values for the process shared attribute. */ -#define PTHREAD_PROCESS_PRIVATE __PTHREAD_PROCESS_PRIVATE -#define PTHREAD_PROCESS_SHARED __PTHREAD_PROCESS_SHARED - - -/* Thread attributes. */ - -/* Possible values for the inheritsched attribute. */ -#define PTHREAD_EXPLICIT_SCHED __PTHREAD_EXPLICIT_SCHED -#define PTHREAD_INHERIT_SCHED __PTHREAD_INHERIT_SCHED - -/* Possible values for the `contentionscope' attribute. */ -#define PTHREAD_SCOPE_SYSTEM __PTHREAD_SCOPE_SYSTEM -#define PTHREAD_SCOPE_PROCESS __PTHREAD_SCOPE_PROCESS - -/* Possible values for the `detachstate' attribute. */ -#define PTHREAD_CREATE_JOINABLE __PTHREAD_CREATE_JOINABLE -#define PTHREAD_CREATE_DETACHED __PTHREAD_CREATE_DETACHED - -#include <bits/thread-attr.h> - -/* Initialize the thread attribute object in *ATTR to the default - values. */ -extern int pthread_attr_init (pthread_attr_t *attr); - -/* Destroy the thread attribute object in *ATTR. */ -extern int pthread_attr_destroy (pthread_attr_t *attr); - - -/* Return the value of the inheritsched attribute in *ATTR in - *INHERITSCHED. */ -extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict attr, - int *__restrict inheritsched); - -/* Set the value of the inheritsched attribute in *ATTR to - INHERITSCHED. */ -extern int pthread_attr_setinheritsched (pthread_attr_t *attr, - int inheritsched); - - -/* Return the value of the schedparam attribute in *ATTR in *PARAM. */ -extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict attr, - struct sched_param *__restrict param); - -/* Set the value of the schedparam attribute in *ATTR to PARAM. */ -extern int pthread_attr_setschedparam (pthread_attr_t *__restrict attr, - const struct sched_param *__restrict param); - - -/* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */ -extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict attr, - int *__restrict policy); - -/* Set the value of the schedpolicy attribute in *ATTR to POLICY. */ -extern int pthread_attr_setschedpolicy (pthread_attr_t *attr, - int policy); - - -/* Return the value of the contentionscope attribute in *ATTR in - *CONTENTIONSCOPE. */ -extern int pthread_attr_getscope (const pthread_attr_t *__restrict attr, - int *__restrict contentionscope); - -/* Set the value of the contentionscope attribute in *ATTR to - CONTENTIONSCOPE. */ -extern int pthread_attr_setscope (pthread_attr_t *attr, - int contentionscope); - - -/* Return the value of the stackaddr attribute in *ATTR in - *STACKADDR. */ -extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr); - -/* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */ -extern int pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr); - - -#ifdef __USE_XOPEN2K -/* Return the value of the stackaddr and stacksize attributes in *ATTR - in *STACKADDR and *STACKSIZE respectively. */ -extern int pthread_attr_getstack (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr, - size_t *__restrict stacksize); - -/* Set the value of the stackaddr and stacksize attributes in *ATTR to - STACKADDR and STACKSIZE respectively. */ -extern int pthread_attr_setstack (pthread_attr_t *attr, - void *stackaddr, - size_t stacksize); -#endif - - -/* Return the value of the detachstate attribute in *ATTR in - *DETACHSTATE. */ -extern int pthread_attr_getdetachstate (const pthread_attr_t *attr, - int *detachstate); - -/* Set the value of the detachstate attribute in *ATTR to - DETACHSTATE. */ -extern int pthread_attr_setdetachstate (pthread_attr_t *attr, - int detachstate); - - -/* Return the value of the guardsize attribute in *ATTR in - *GUARDSIZE. */ -extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict attr, - size_t *__restrict guardsize); - -/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */ -extern int pthread_attr_setguardsize (pthread_attr_t *attr, - size_t guardsize); - - -/* Return the value of the stacksize attribute in *ATTR in - *STACKSIZE. */ -extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict attr, - size_t *__restrict stacksize); - -/* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */ -extern int pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize); - -#ifdef __USE_GNU -/* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread THREAD. It shall be called on an uninitialized ATTR - and destroyed with pthread_attr_destroy when no longer needed. */ -extern int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr); -#endif - - -/* Create a thread with attributes given by ATTR, executing - START_ROUTINE with argument ARG. */ -extern int pthread_create (pthread_t *__restrict __threadp, - __const pthread_attr_t *__restrict __attr, - void *(*__start_routine)(void *), - void *__restrict __arg); - -/* Terminate the current thread and make STATUS available to any - thread that might join us. */ -extern void pthread_exit (void *__status) __attribute__ ((noreturn)); - -/* Make calling thread wait for termination of thread THREAD. Return - the exit status of the thread in *STATUS. */ -extern int pthread_join (pthread_t __threadp, void **__status); - -/* Indicate that the storage for THREAD can be reclaimed when it - terminates. */ -extern int pthread_detach (pthread_t __threadp); - -/* Compare thread IDs T1 and T2. Return nonzero if they are equal, 0 - if they are not. */ -extern int pthread_equal (pthread_t __t1, pthread_t __t2); - -# ifdef __USE_EXTERN_INLINES - -__extern_inline int -pthread_equal (pthread_t __t1, pthread_t __t2) -{ - return __pthread_equal (__t1, __t2); -} - -# endif /* Use extern inlines. */ - - -/* Return the thread ID of the calling thread. */ -extern pthread_t pthread_self (void); - - -/* Mutex attributes. */ - -#define PTHREAD_PRIO_NONE_NP __PTHREAD_PRIO_NONE -#define PTHREAD_PRIO_INHERIT_NP __PTHREAD_PRIO_INHERIT -#define PTHREAD_PRIO_PROTECT_NP __PTHREAD_PRIO_PROTECT -#ifdef __USE_UNIX98 -#define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE_NP -#define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT_NP -#define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT_NP -#endif - -#define PTHREAD_MUTEX_TIMED_NP __PTHREAD_MUTEX_TIMED -#define PTHREAD_MUTEX_ERRORCHECK_NP __PTHREAD_MUTEX_ERRORCHECK -#define PTHREAD_MUTEX_RECURSIVE_NP __PTHREAD_MUTEX_RECURSIVE -#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 -#define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP -#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP -#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP -#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL -#endif -#ifdef __USE_GNU -/* For compatibility. */ -#define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_TIMED_NP -#endif - -#include <bits/mutex-attr.h> - -/* Initialize the mutex attribute object in *ATTR to the default - values. */ -extern int pthread_mutexattr_init(pthread_mutexattr_t *attr); - -/* Destroy the mutex attribute structure in *ATTR. */ -extern int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); - - -#ifdef __USE_UNIX98 -/* Return the value of the prioceiling attribute in *ATTR in - *PRIOCEILING. */ -extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict attr, - int *__restrict prioceiling); - -/* Set the value of the prioceiling attribute in *ATTR to - PRIOCEILING. */ -extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, - int prioceiling); - - -/* Return the value of the protocol attribute in *ATTR in - *PROTOCOL. */ -extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict attr, - int *__restrict protocol); - -/* Set the value of the protocol attribute in *ATTR to PROTOCOL. */ -extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, - int protocol); -#endif - - -/* Return the value of the process shared attribute in *ATTR in - *PSHARED. */ -extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict attr, - int *__restrict pshared); - -/* Set the value of the process shared attribute in *ATTR to - PSHARED. */ -extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, - int pshared); - - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 -/* Return the value of the type attribute in *ATTR in *TYPE. */ -extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict attr, - int *__restrict type); - -/* Set the value of the type attribute in *ATTR to TYPE. */ -extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, - int type); -#endif - - -/* Mutexes. */ - -#include <bits/mutex.h> - -#define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER -/* Static initializer for recursive mutexes. */ - -#ifdef __USE_GNU -# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ - __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER -# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ - __PTHREAD_RECURSIVE_MUTEX_INITIALIZER -#endif - -/* Create a mutex with attributes given by ATTR and store it in - *__MUTEX. */ -extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, - const pthread_mutexattr_t *__restrict attr); - -/* Destroy the mutex __MUTEX. */ -extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex); - -/* Wait until lock for MUTEX becomes available and lock it. */ -extern int pthread_mutex_lock (pthread_mutex_t *__mutex); - -/* Try to lock MUTEX. */ -extern int pthread_mutex_trylock (pthread_mutex_t *__mutex); - -#ifdef __USE_XOPEN2K -/* Try to lock MUTEX, block until *ABSTIME if it is already held. */ -extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict mutex, - const struct timespec *__restrict abstime); -#endif - -/* Unlock MUTEX. */ -extern int pthread_mutex_unlock (pthread_mutex_t *__mutex); - -/* Transfer ownership of the mutex MUTEX to the thread TID. The - caller must own the lock. */ -extern int __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, - pthread_t tid); - - -#ifdef __USE_UNIX98 -/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ -extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict mutex, - int *__restrict prioceiling); - -/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO - and return the old priority ceiling in *OLDPRIO. Before returning, - release the mutex. */ -extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex, - int prio, int *__restrict oldprio); -#endif - - - -/* Condition attributes. */ - -#include <bits/condition-attr.h> - -/* Initialize the condition attribute in *ATTR to the default - values. */ -extern int pthread_condattr_init (pthread_condattr_t *attr); - -/* Destroy the condition attribute structure in *ATTR. */ -extern int pthread_condattr_destroy (pthread_condattr_t *attr); - - -#ifdef __USE_XOPEN2K -/* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */ -extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict attr, - __clockid_t *__restrict clock_id); - -/* Set the value of the clock attribute in *ATTR to CLOCK_ID. */ -extern int pthread_condattr_setclock (pthread_condattr_t *attr, - __clockid_t clock_id); -#endif - - -/* Return the value of the process shared attribute in *ATTR in - *PSHARED. */ -extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict attr, - int *__restrict pshared); - -/* Set the value of the process shared attribute in *ATTR to - PSHARED. */ -extern int pthread_condattr_setpshared (pthread_condattr_t *attr, - int pshared); - - -/* Condition variables. */ - -#include <bits/condition.h> - -#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER - -extern int pthread_cond_init (pthread_cond_t *__restrict cond, - const pthread_condattr_t *__restrict attr); - -extern int pthread_cond_destroy (pthread_cond_t *cond); - -/* Unblock at least one of the threads that are blocked on condition - variable COND. */ -extern int pthread_cond_signal (pthread_cond_t *__cond); - -/* Unblock all threads that are blocked on condition variable COND. */ -extern int pthread_cond_broadcast (pthread_cond_t *__cond); - -/* Block on condition variable COND. MUTEX should be held by the - calling thread. On success, MUTEX will be held by the calling - thread. */ -extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, - pthread_mutex_t *__restrict __mutex); - -/* Block on condition variable COND. MUTEX should be held by the - calling thread. On success, MUTEX will be held by the calling - thread. If the time specified by ABSTIME passes, ETIMEDOUT is - returned, and MUTEX will nevertheless be held. */ -extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, - pthread_mutex_t *__restrict __mutex, - __const struct timespec *__restrict __abstime); - - -/* Spin locks. */ - -#ifdef __USE_XOPEN2K - -# include <bits/spin-lock.h> - -#define PTHREAD_SPINLOCK_INITIALIZER __PTHREAD_SPIN_LOCK_INITIALIZER - -/* Destroy the spin lock object LOCK. */ -extern int pthread_spin_destroy (pthread_spinlock_t *__lock); - -/* Initialize the spin lock object LOCK. PSHARED determines whether - the spin lock can be operated upon by multiple processes. */ -extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared); - -/* Lock the spin lock object LOCK. If the lock is held by another - thread spin until it becomes available. */ -extern int pthread_spin_lock (pthread_spinlock_t *__lock); - -/* Lock the spin lock object LOCK. Fail if the lock is held by - another thread. */ -extern int pthread_spin_trylock (pthread_spinlock_t *__lock); - -/* Unlock the spin lock object LOCK. */ -extern int pthread_spin_unlock (pthread_spinlock_t *__lock); - -# ifdef __USE_EXTERN_INLINES - -# include <bits/spin-lock-inline.h> - -__extern_inline int -pthread_spin_destroy (pthread_spinlock_t *__lock) -{ - return __pthread_spin_destroy (__lock); -} - -__extern_inline int -pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) -{ - return __pthread_spin_init (__lock, __pshared); -} - -__extern_inline int -pthread_spin_lock (pthread_spinlock_t *__lock) -{ - return __pthread_spin_lock (__lock); -} - -__extern_inline int -pthread_spin_trylock (pthread_spinlock_t *__lock) -{ - return __pthread_spin_trylock (__lock); -} - -__extern_inline int -pthread_spin_unlock (pthread_spinlock_t *__lock) -{ - return __pthread_spin_unlock (__lock); -} - -# endif /* Use extern inlines. */ - -#endif /* XPG6. */ - - -/* rwlock attributes. */ - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K - -#include <bits/rwlock-attr.h> - -/* Initialize rwlock attribute object in *ATTR to the default - values. */ -extern int pthread_rwlockattr_init (pthread_rwlockattr_t *attr); - -/* Destroy the rwlock attribute object in *ATTR. */ -extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr); - - -/* Return the value of the process shared attribute in *ATTR in - *PSHARED. */ -extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict attr, - int *__restrict pshared); - -/* Set the value of the process shared atrribute in *ATTR to - PSHARED. */ -extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, - int pshared); - - -/* rwlocks. */ - -#include <bits/rwlock.h> - -#define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER -/* Create a rwlock object with attributes given by ATTR and strore the - result in *RWLOCK. */ -extern int pthread_rwlock_init (pthread_rwlock_t *__restrict rwlock, - const pthread_rwlockattr_t *__restrict attr); - -/* Destroy the rwlock *RWLOCK. */ -extern int pthread_rwlock_destroy (pthread_rwlock_t *rwlock); - -/* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock); - -/* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock); - -# ifdef __USE_XOPEN2K -/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if - it is already held. */ -extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); -# endif - -/* Acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock); - -/* Try to acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock); - -# ifdef __USE_XOPEN2K -/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if - it is already held. */ -extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); -# endif - -/* Release the lock held by the current thread on *RWLOCK. */ -extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); - -#endif /* __USE_UNIX98 || __USE_XOPEN2K */ - - - -/* Cancelation. */ - -/* Register a cleanup handler. */ -extern void pthread_cleanup_push (void (*routine) (void *), void *arg); - -/* Unregister a cleanup handler. */ -extern void pthread_cleanup_pop (int execute); - -#include <bits/cancelation.h> - -#define pthread_cleanup_push(rt, rtarg) __pthread_cleanup_push(rt, rtarg) -#define pthread_cleanup_pop(execute) __pthread_cleanup_pop(execute) - -#define PTHREAD_CANCEL_DISABLE 0 -#define PTHREAD_CANCEL_ENABLE 1 - -/* Return the calling thread's cancelation state in *OLDSTATE and set - its state to STATE. */ -extern int pthread_setcancelstate (int state, int *oldstate); - -#define PTHREAD_CANCEL_DEFERRED 0 -#define PTHREAD_CANCEL_ASYNCHRONOUS 1 - -/* Return the calling thread's cancelation type in *OLDTYPE and set - its type to TYPE. */ -extern int pthread_setcanceltype (int type, int *oldtype); - -/* Value returned by pthread_join if the target thread was - canceled. */ -#define PTHREAD_CANCELED ((void *) -1) - -/* Cancel THEAD. */ -extern int pthread_cancel (pthread_t thread); - -/* Add an explicit cancelation point. */ -extern void pthread_testcancel (void); - - -/* Barriers attributes. */ - -#ifdef __USE_XOPEN2K - -#include <bits/barrier-attr.h> - -/* Initialize barrier attribute object in *ATTR to the default - values. */ -extern int pthread_barrierattr_init (pthread_barrierattr_t *attr); - -/* Destroy the barrier attribute object in *ATTR. */ -extern int pthread_barrierattr_destroy (pthread_barrierattr_t *attr); - - -/* Return the value of the process shared attribute in *ATTR in - *PSHARED. */ -extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict attr, - int *__restrict pshared); - -/* Set the value of the process shared atrribute in *ATTR to - PSHARED. */ -extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, - int pshared); - - -/* Barriers. */ - -#include <bits/barrier.h> - -/* Returned by pthread_barrier_wait to exactly one thread each time a - barrier is passed. */ -#define PTHREAD_BARRIER_SERIAL_THREAD -1 - -/* Initialize barrier BARRIER. */ -extern int pthread_barrier_init (pthread_barrier_t *__restrict barrier, - const pthread_barrierattr_t *__restrict attr, - unsigned count); - -/* Destroy barrier BARRIER. */ -extern int pthread_barrier_destroy (pthread_barrier_t *barrier); - -/* Wait on barrier BARRIER. */ -extern int pthread_barrier_wait (pthread_barrier_t *barrier); - -#endif /* __USE_XOPEN2K */ - - - -/* Thread specific data. */ - -#include <bits/thread-specific.h> - -/* Create a thread specific data key in KEY visible to all threads. - On thread destruction, DESTRUCTOR shall be called with the thread - specific data associate with KEY if it is not NULL. */ -extern int pthread_key_create (pthread_key_t *key, - void (*destructor) (void *)); - -/* Delete the thread specific data key KEY. The associated destructor - function is not called. */ -extern int pthread_key_delete (pthread_key_t key); - -/* Return the caller thread's thread specific value of KEY. */ -extern void *pthread_getspecific (pthread_key_t key); - -/* Set the caller thread's thread specific value of KEY to VALUE. */ -extern int pthread_setspecific (pthread_key_t key, const void *value); - - -/* Dynamic package initialization. */ - -#include <bits/once.h> - -#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT - -/* Call INIT_ROUTINE if this function has never been called with - *ONCE_CONTROL, otherwise do nothing. */ -extern int pthread_once (pthread_once_t *once_control, - void (*init_routine) (void)); - - -/* Concurrency. */ - -#ifdef __USE_UNIX98 -/* Set the desired concurrency level to NEW_LEVEL. */ -extern int pthread_setconcurrency (int new_level); - -/* Get the current concurrency level. */ -extern int pthread_getconcurrency (void); -#endif - - -/* Forking. */ - -/* Register the function PREPARE to be run before the process forks, - the function PARENT to be run after a fork in the parent and the - function CHILD to be run in the child after the fork. If no - handling is desired then any of PREPARE, PARENT and CHILD may be - NULL. The prepare handles will be called in the reverse order - which they were registered and the parent and child handlers in the - order in which they were registered. */ -extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), - void (*child) (void)); - - -/* Signals (should be in <signal.h>). */ - -/* Send signal SIGNO to thread THREAD. */ -extern int pthread_kill (pthread_t thread, int signo); - - -/* Time. */ - -#ifdef __USE_XOPEN2K -/* Return the thread cpu clock. */ -extern int pthread_getcpuclockid (pthread_t thread, __clockid_t *clock); -#endif - - -/* Scheduling. */ - -/* Return thread THREAD's scheduling paramters. */ -extern int pthread_getschedparam (pthread_t thread, int *__restrict policy, - struct sched_param *__restrict param); - -/* Set thread THREAD's scheduling paramters. */ -extern int pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param); - -/* Set thread THREAD's scheduling priority. */ -extern int pthread_setschedprio (pthread_t thread, int prio); - -#ifdef __USE_GNU -/* Yield the processor to another thread or process. - This function is similar to the POSIX `sched_yield' function but - might be differently implemented in the case of a m-on-n thread - implementation. */ -extern int pthread_yield (void); -#endif - - -/* Kernel-specific interfaces. */ - -#include <bits/pthread-np.h> - - -__END_DECLS - -#endif /* pthread.h */ diff --git a/libpthread/include/pthread/pthreadtypes.h b/libpthread/include/pthread/pthreadtypes.h deleted file mode 100644 index 33bd0099..00000000 --- a/libpthread/include/pthread/pthreadtypes.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * POSIX Threads Extension: ??? <pthreadtypes.h> - */ - -#ifndef _PTHREADTYPES_H -#define _PTHREADTYPES_H 1 - -#include <features.h> - -#include <bits/types.h> - -__BEGIN_DECLS - -#include <bits/pthread.h> -typedef __pthread_t pthread_t; - -/* Possible values for the process shared attribute. */ -enum __pthread_process_shared - { - __PTHREAD_PROCESS_PRIVATE = 0, - __PTHREAD_PROCESS_SHARED - }; - -/* Possible values for the inheritsched attribute. */ -enum __pthread_inheritsched - { - __PTHREAD_EXPLICIT_SCHED = 0, - __PTHREAD_INHERIT_SCHED - }; - -/* Possible values for the `contentionscope' attribute. */ -enum __pthread_contentionscope - { - __PTHREAD_SCOPE_SYSTEM = 0, - __PTHREAD_SCOPE_PROCESS - }; - -/* Possible values for the `detachstate' attribute. */ -enum __pthread_detachstate - { - __PTHREAD_CREATE_JOINABLE = 0, - __PTHREAD_CREATE_DETACHED - }; - -#include <bits/thread-attr.h> -typedef struct __pthread_attr pthread_attr_t; - -enum __pthread_mutex_protocol - { - __PTHREAD_PRIO_NONE= 0, - __PTHREAD_PRIO_INHERIT, - __PTHREAD_PRIO_PROTECT - }; - -enum __pthread_mutex_type - { - __PTHREAD_MUTEX_TIMED, - __PTHREAD_MUTEX_ERRORCHECK, - __PTHREAD_MUTEX_RECURSIVE - }; - -#include <bits/mutex-attr.h> -typedef struct __pthread_mutexattr pthread_mutexattr_t; - -#include <bits/mutex.h> -typedef struct __pthread_mutex pthread_mutex_t; - -#include <bits/condition-attr.h> -typedef struct __pthread_condattr pthread_condattr_t; - -#include <bits/condition.h> -typedef struct __pthread_cond pthread_cond_t; - -#ifdef __USE_XOPEN2K -# include <bits/spin-lock.h> -typedef __pthread_spinlock_t pthread_spinlock_t; -#endif /* XPG6. */ - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K - -#include <bits/rwlock-attr.h> -typedef struct __pthread_rwlockattr pthread_rwlockattr_t; - -#include <bits/rwlock.h> -typedef struct __pthread_rwlock pthread_rwlock_t; - -#endif /* __USE_UNIX98 || __USE_XOPEN2K */ - -#ifdef __USE_XOPEN2K - -#include <bits/barrier-attr.h> -typedef struct __pthread_barrierattr pthread_barrierattr_t; - -#include <bits/barrier.h> -typedef struct __pthread_barrier pthread_barrier_t; - -#endif /* __USE_XOPEN2K */ - -#include <bits/thread-specific.h> -typedef __pthread_key pthread_key_t; - -#include <bits/once.h> -typedef struct __pthread_once pthread_once_t; - -__END_DECLS - -#endif /* pthreadtypes.h */ diff --git a/libpthread/include/semaphore.h b/libpthread/include/semaphore.h deleted file mode 100644 index 657e796e..00000000 --- a/libpthread/include/semaphore.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2005, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SEMAPHORE_H -#define _SEMAPHORE_H 1 - -#include <features.h> - -__BEGIN_DECLS - -#include <bits/semaphore.h> - -#define SEM_FAILED ((void *) 0) - -typedef struct __semaphore sem_t; - -/* Initialize semaphore *SEM with value VALUE. */ -extern int sem_init (sem_t *sem, int pshared, unsigned value); - -/* Destroy semaphore *SEM created with sem_init. */ -extern int sem_destroy (sem_t *sem); - -/* Store the value of semaphore *SEM in *VALUE. */ -extern int sem_getvalue (sem_t *__restrict sem, int *__restrict value); - -/* Perform a down operation on semaphore *SEM. */ -extern int sem_wait (sem_t *sem); - -/* Perform a down operation on semaphore *SEM if it can be done so - without blocking. */ -extern int sem_trywait (sem_t *sem); - -#ifdef __USE_XOPEN2K -/* Perform a down operation on semaphore *SEM but don't wait longer - than TIMEOUT. */ -extern int sem_timedwait (sem_t *__restrict sem, - const struct timespec *__restrict timeout); -#endif - -/* Perform an up operation on semaphore *SEM. */ -extern int sem_post (sem_t *sem); - -/* Open a named semaphore. */ -extern sem_t *sem_open (const char *name, int open_flags, ...); - -/* Close a semaphore returned by sem_open. */ -extern int sem_close (sem_t *sem); - -/* Unlink a named semaphore. */ -extern int sem_unlink (const char *name); - -__END_DECLS - -#endif /* semaphore.h */ diff --git a/libpthread/include/set-hooks.h b/libpthread/include/set-hooks.h deleted file mode 100644 index 9ed71b32..00000000 --- a/libpthread/include/set-hooks.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Macros for using symbol sets for running lists of functions. - Copyright (C) 1994, 1995, 1997, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SET_HOOKS_H -#define _SET_HOOKS_H 1 - -#define __need_size_t -#include <stddef.h> -// #include <sys/cdefs.h> -#define __unbounded - -#ifdef symbol_set_define -/* Define a hook variable called NAME. Functions put on this hook take - arguments described by PROTO. Use `text_set_element (NAME, FUNCTION)' - from gnu-stabs.h to add a function to the hook. */ - -# define DEFINE_HOOK(NAME, PROTO) \ - typedef void __##NAME##_hook_function_t PROTO; \ - symbol_set_define (NAME) - -# define DECLARE_HOOK(NAME, PROTO) \ - typedef void __##NAME##_hook_function_t PROTO;\ - symbol_set_declare (NAME) - -/* Run all the functions hooked on the set called NAME. - Each function is called like this: `function ARGS'. */ - -# define RUN_HOOK(NAME, ARGS) \ -do { \ - void *const *__unbounded ptr; \ - for (ptr = symbol_set_first_element (NAME); \ - ! symbol_set_end_p (NAME, ptr); ++ptr) \ - (*(__##NAME##_hook_function_t *) *ptr) ARGS; \ -} while (0) - -/* Define a hook variable with NAME and PROTO, and a function called RUNNER - which calls each function on the hook in turn, with ARGS. */ - -# define DEFINE_HOOK_RUNNER(name, runner, proto, args) \ -DEFINE_HOOK (name, proto); \ -extern void runner proto; void runner proto { RUN_HOOK (name, args); } - -#else - -/* The system does not provide necessary support for this. */ -# define DEFINE_HOOK(NAME, PROTO) - -# define DECLARE_HOOK(NAME, PROTO) - -# define RUN_HOOK(NAME, ARGS) - -# define DEFINE_HOOK_RUNNER(name, runner, proto, args) - -#endif - -#endif /* set-hooks.h */ diff --git a/libpthread/libpthread.a b/libpthread/libpthread.a deleted file mode 100644 index d0e689e9..00000000 --- a/libpthread/libpthread.a +++ /dev/null @@ -1,20 +0,0 @@ -/* pthread initializer is weak in glibc. It must be included if glibc - is to start threading. */ -EXTERN(_cthread_init_routine) - -/* Weak references in glibc that must be filled if glibc is to be - thread safe. */ -EXTERN(cthread_detach) -EXTERN(cthread_fork) -EXTERN(cthread_keycreate) -EXTERN(cthread_getspecific) -EXTERN(__libc_getspecific) -EXTERN(cthread_setspecific) -EXTERN(__mutex_lock_solid) -EXTERN(__mutex_unlock_solid) -/* For libio stream locking. */ -EXTERN(_cthreads_flockfile) -EXTERN(_cthreads_funlockfile) -EXTERN(_cthreads_ftrylockfile) - -GROUP(-lpthread2 -lihash) diff --git a/libpthread/libpthread_pic.a b/libpthread/libpthread_pic.a deleted file mode 100644 index 5673b4e7..00000000 --- a/libpthread/libpthread_pic.a +++ /dev/null @@ -1,20 +0,0 @@ -/* pthread initializer is weak in glibc. It must be included if glibc - is to start threading. */ -EXTERN(_cthread_init_routine) - -/* Weak references in glibc that must be filled if glibc is to be - thread safe. */ -EXTERN(cthread_detach) -EXTERN(cthread_fork) -EXTERN(cthread_keycreate) -EXTERN(cthread_getspecific) -EXTERN(__libc_getspecific) -EXTERN(cthread_setspecific) -EXTERN(__mutex_lock_solid) -EXTERN(__mutex_unlock_solid) -/* For libio stream locking. */ -EXTERN(_cthreads_flockfile) -EXTERN(_cthreads_funlockfile) -EXTERN(_cthreads_ftrylockfile) - -GROUP(-lpthread2_pic -lihash_pic) diff --git a/libpthread/lockfile.c b/libpthread/lockfile.c deleted file mode 100644 index 040cbfb4..00000000 --- a/libpthread/lockfile.c +++ /dev/null @@ -1,65 +0,0 @@ -/* lockfile - Handle locking and unlocking of streams. Hurd cthreads version. - Copyright (C) 2000,01,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <cthreads.h> -#include <pthread.h> /* Must come before <stdio.h>! */ -#include <stdio.h> - -#ifdef _STDIO_USES_IOSTREAM - -void -_cthreads_flockfile (_IO_FILE *fp) -{ - _IO_lock_lock (*fp->_lock); -} - -void -_cthreads_funlockfile (_IO_FILE *fp) -{ - _IO_lock_unlock (*fp->_lock); -} - -int -_cthreads_ftrylockfile (_IO_FILE *fp) -{ - return __libc_lock_trylock_recursive (*fp->_lock); -} - -# undef _IO_flockfile -# undef _IO_funlockfile -# undef _IO_ftrylockfile -# undef flockfile -# undef funlockfile -# undef ftrylockfile - -void _IO_flockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_flockfile"))); -void _IO_funlockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_funlockfile"))); -int _IO_ftrylockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_ftrylockfile"))); - -void flockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_flockfile"))); -void funlockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_funlockfile"))); -int ftrylockfile (_IO_FILE *) - __attribute__ ((alias ("_cthreads_ftrylockfile"))); - -#endif /* _STDIO_USES_IOSTREAM */ diff --git a/libpthread/not-in-libc.h b/libpthread/not-in-libc.h deleted file mode 100644 index 516d4d13..00000000 --- a/libpthread/not-in-libc.h +++ /dev/null @@ -1,11 +0,0 @@ -#define __mach_port_insert_right mach_port_insert_right -#define __mach_port_allocate mach_port_allocate -#define __mig_init mig_init -#define __thread_create thread_create -#define __thread_get_state thread_get_state -#define __thread_resume thread_resume -#define __thread_set_state thread_set_state -#define __thread_terminate thread_terminate -#define __vm_allocate vm_allocate -#define __vm_deallocate vm_deallocate -#define __sched_yield sched_yield diff --git a/libpthread/pt-yield.c b/libpthread/pt-yield.c deleted file mode 100644 index 27848bb7..00000000 --- a/libpthread/pt-yield.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Yield the processor to another thread or process. - Copyright (C) 2010 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <sched.h> - -int pthread_yield(void) -{ - return sched_yield (); -} diff --git a/libpthread/pthread/Versions b/libpthread/pthread/Versions deleted file mode 100644 index e4b4e8bf..00000000 --- a/libpthread/pthread/Versions +++ /dev/null @@ -1,15 +0,0 @@ -libc { - GLIBC_2.2 { - # XXX - __vm_deallocate; __mach_port_insert_right; __mach_reply_port; - __mig_init; __vm_allocate; - - # functions used in inline functions or macros - __pthread_spin_destroy; __pthread_spin_init; __pthread_spin_lock; - _pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock; - - # p* - pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; - pthread_spin_trylock; pthread_spin_unlock; - } -} diff --git a/libpthread/pthread/cthreads-compat.c b/libpthread/pthread/cthreads-compat.c deleted file mode 100644 index cbe8170e..00000000 --- a/libpthread/pthread/cthreads-compat.c +++ /dev/null @@ -1,107 +0,0 @@ -/* Compatibility routines for cthreads. - Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <pthread.h> - -typedef void *cthread_t; -typedef void *(*cthread_fn_t) (void *arg); -typedef int cthread_key_t; - -#define CTHREAD_KEY_INVALID (cthread_key_t) -1 - -void -cthread_detach (cthread_t thread) -{ - int err; - - err = pthread_detach ((pthread_t) thread); - assert_perror (err); -} - -cthread_t -cthread_fork (cthread_fn_t func, void *arg) -{ - pthread_t thread; - int err; - - err = pthread_create (&thread, NULL, func, arg); - assert_perror (err); - - return (cthread_t) thread; -} - -int -cthread_keycreate (cthread_key_t *key) -{ - error_t err; - - err = pthread_key_create (key, 0); - if (err) - { - errno = err; - *key = CTHREAD_KEY_INVALID; - err = -1; - } - - return err; -} - -int -cthread_getspecific (cthread_key_t key, void **val) -{ - *val = pthread_getspecific (key); - return 0; -} - -void * -__libc_getspecific (cthread_key_t key) -{ - return pthread_getspecific (key); -} - -int -cthread_setspecific (cthread_key_t key, void *val) -{ - error_t err; - - err = pthread_setspecific (key, (const void *) val); - if (err) - { - errno = err; - err = -1; - } - - return err; -} - -void -__mutex_lock_solid (void *lock) -{ - __pthread_mutex_lock (lock); -} - -void -__mutex_unlock_solid (void *lock) -{ - if (__pthread_spin_trylock (lock) != 0) - /* Somebody already got the lock, that one will manage waking up others */ - return; - __pthread_mutex_unlock (lock); -} diff --git a/libpthread/pthread/pt-alloc.c b/libpthread/pthread/pt-alloc.c deleted file mode 100644 index 6af2da92..00000000 --- a/libpthread/pthread/pt-alloc.c +++ /dev/null @@ -1,215 +0,0 @@ -/* Allocate a new thread structure. - Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> -#include <stdlib.h> -#include <string.h> - -#include <pt-internal.h> - -/* This braindamage is necessary because the standard says that some - of the threads functions "shall fail" if "No thread could be found - corresponding to that specified by the given thread ID." */ - -/* Thread ID lookup table. */ -struct __pthread **__pthread_threads; - -/* The size of the thread ID lookup table. */ -int __pthread_max_threads; - -/* The total number of thread IDs currently in use, or on the list of - available thread IDs. */ -int __pthread_num_threads; - -/* A lock for the table, and the other variables above. */ -pthread_rwlock_t __pthread_threads_lock; - -/* List of thread structures corresponding to free thread IDs. */ -struct __pthread *__pthread_free_threads; -pthread_mutex_t __pthread_free_threads_lock; - -static inline error_t -initialize_pthread (struct __pthread *new, int recycling) -{ - error_t err; - - err = __pthread_init_specific (new); - if (err) - return err; - - new->cancel_state = PTHREAD_CANCEL_ENABLE; - new->cancel_type = PTHREAD_CANCEL_DEFERRED; - new->cancel_pending = 0; - - if (recycling) - /* Since we are recycling PTHREAD, we can assume certains things - about PTHREAD's current state and save some cycles by not - rewriting the memory. */ - return 0; - - new->stack = 0; - - new->state_lock = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; - new->state_cond = (pthread_cond_t) PTHREAD_COND_INITIALIZER; - - new->cancelation_handlers = 0; - - new->next = 0; - new->prevp = 0; - - return 0; -} - - -/* Allocate a new thread structure and its pthread thread ID (but not - a kernel thread). */ -int -__pthread_alloc (struct __pthread **pthread) -{ - error_t err; - - struct __pthread *new; - struct __pthread **threads; - struct __pthread **old_threads; - int max_threads; - int new_max_threads; - - pthread_mutex_lock (&__pthread_free_threads_lock); - for (new = __pthread_free_threads; new; new = new->next) - { - /* There is no need to take NEW->STATE_LOCK: if NEW is on this - list, then it is protected by __PTHREAD_FREE_THREADS_LOCK - except in __pthread_dealloc where after it is added to the - list (with the lock held), it drops the lock and then sets - NEW->STATE and immediately stops using NEW. */ - if (new->state == PTHREAD_TERMINATED) - { - __pthread_dequeue (new); - break; - } - } - pthread_mutex_unlock (&__pthread_free_threads_lock); - - if (new) - { - /* The thread may still be running. Make sure it is stopped. - If this is the case, then the thread is either at the end of - __pthread_dealloc or in __pthread_thread_halt. In both - cases, we are interrupt it. */ - __pthread_thread_halt (new); - - err = initialize_pthread (new, 1); - if (! err) - *pthread = new; - return err; - } - - /* Allocate a new thread structure. */ - new = malloc (sizeof (struct __pthread)); - if (new == NULL) - return ENOMEM; - - err = initialize_pthread (new, 0); - if (err) - { - free (new); - return err; - } - - retry: - pthread_rwlock_wrlock (&__pthread_threads_lock); - - if (__pthread_num_threads < __pthread_max_threads) - { - /* We have a free slot. Use the slot number plus one as the - thread ID for the new thread. */ - new->thread = 1 + __pthread_num_threads++; - __pthread_threads[new->thread - 1] = NULL; - - pthread_rwlock_unlock (&__pthread_threads_lock); - - *pthread = new; - return 0; - } -#ifdef PTHREAD_THREADS_MAX - else if (__pthread_num_threads >= PTHREAD_THREADS_MAX) - { - /* We have reached the limit on the number of threads per process. */ - pthread_rwlock_unlock (&__pthread_threads_lock); - - free (new); - return EAGAIN; - } -#endif - - /* We are going to enlarge the threads table. Save its current - size. We're going to release the lock before doing the necessary - memory allocation, since that's a potentially blocking operation. */ - max_threads = __pthread_max_threads; - - pthread_rwlock_unlock (&__pthread_threads_lock); - - /* Allocate a new lookup table that's twice as large. */ - new_max_threads - = max_threads > 0 ? max_threads * 2 : _POSIX_THREAD_THREADS_MAX; - threads = malloc (new_max_threads * sizeof (struct __pthread *)); - if (threads == NULL) - { - free (new); - return ENOMEM; - } - - pthread_rwlock_wrlock (&__pthread_threads_lock); - - /* Check if nobody else has already enlarged the table. */ - if (max_threads != __pthread_max_threads) - { - /* Yep, they did. */ - pthread_rwlock_unlock (&__pthread_threads_lock); - - /* Free the newly allocated table and try again to allocate a slot. */ - free (threads); - goto retry; - } - - /* Copy over the contents of the old table. */ - memcpy (threads, __pthread_threads, - __pthread_max_threads * sizeof (struct __pthread *)); - - /* Save the location of the old table. We want to deallocate its - storage after we released the lock. */ - old_threads = __pthread_threads; - - /* Replace the table with the new one. */ - __pthread_max_threads = new_max_threads; - __pthread_threads = threads; - - /* And allocate ourselves one of the newly created slots. */ - new->thread = 1 + __pthread_num_threads++; - __pthread_threads[new->thread - 1] = NULL; - - pthread_rwlock_unlock (&__pthread_threads_lock); - - free (old_threads); - - *pthread = new; - return 0; -} diff --git a/libpthread/pthread/pt-cancel.c b/libpthread/pthread/pt-cancel.c deleted file mode 100644 index d19c557d..00000000 --- a/libpthread/pthread/pt-cancel.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Cancel a thread. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -int -pthread_cancel (pthread_t t) -{ - int err = 0; - struct __pthread *p; - - p = __pthread_getid (t); - if (! p) - return ESRCH; - - p->cancel_pending = 1; - if (p->cancel_state == PTHREAD_CANCEL_ENABLE - && p->cancel_type == PTHREAD_CANCEL_ASYNCHRONOUS) - err = __pthread_do_cancel (p); - - return err; -} diff --git a/libpthread/pthread/pt-cleanup.c b/libpthread/pthread/pt-cleanup.c deleted file mode 100644 index 58865aa4..00000000 --- a/libpthread/pthread/pt-cleanup.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Add a cancelation handler to the stack. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -struct __pthread_cancelation_handler ** -__pthread_get_cleanup_stack (void) -{ - return &_pthread_self ()->cancelation_handlers; -} diff --git a/libpthread/pthread/pt-create.c b/libpthread/pthread/pt-create.c deleted file mode 100644 index 346c6979..00000000 --- a/libpthread/pthread/pt-create.c +++ /dev/null @@ -1,217 +0,0 @@ -/* Thread creation. - Copyright (C) 2000, 2002, 2005, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> -#include <signal.h> - -#include <bits/atomic.h> - -#include <pt-internal.h> - -#ifdef HAVE_USELOCALE -# include <locale.h> -#endif - -/* The total number of pthreads currently active. This is defined - here since it would be really stupid to have a threads-using - program that doesn't call `pthread_create'. */ -__atomic_t __pthread_total; - - -/* The entry-point for new threads. */ -static void -entry_point (void *(*start_routine)(void *), void *arg) -{ -#ifdef HAVE_USELOCALE - /* A fresh thread needs to be bound to the global locale. */ - uselocale (LC_GLOBAL_LOCALE); -#endif - - __pthread_startup (); - - pthread_exit (start_routine (arg)); -} - -/* Create a thread with attributes given by ATTR, executing - START_ROUTINE with argument ARG. */ -int -pthread_create (pthread_t *thread, const pthread_attr_t *attr, - void *(*start_routine)(void *), void *arg) -{ - int err; - struct __pthread *pthread; - - err = __pthread_create_internal (&pthread, attr, start_routine, arg); - if (! err) - *thread = pthread->thread; - - return err; -} - -/* Internal version of pthread_create. See comment in - pt-internal.h. */ -int -__pthread_create_internal (struct __pthread **thread, - const pthread_attr_t *attr, - void *(*start_routine)(void *), void *arg) -{ - int err; - struct __pthread *pthread; - const struct __pthread_attr *setup; - sigset_t sigset; - - /* Allocate a new thread structure. */ - err = __pthread_alloc (&pthread); - if (err) - goto failed; - - /* Use the default attributes if ATTR is NULL. */ - setup = attr ? attr : &__pthread_default_attr; - - /* Initialize the thread state. */ - pthread->state = (setup->detachstate == PTHREAD_CREATE_DETACHED - ? PTHREAD_DETACHED : PTHREAD_JOINABLE); - - /* If the user supplied a stack, it is not our responsibility to - setup a stack guard. */ - if (setup->stackaddr) - pthread->guardsize = 0; - else - pthread->guardsize = (setup->guardsize <= setup->stacksize - ? setup->guardsize : setup->stacksize); - - /* Find a stack. There are several scenarios: if a detached thread - kills itself, it has no way to deallocate its stack, thus it - leaves PTHREAD->stack set to true. We try to reuse it here, - however, if the user supplied a stack, we cannot use the old one. - Right now, we simply deallocate it. */ - if (pthread->stack) - { - if (setup->stackaddr != __pthread_default_attr.stackaddr) - { - __pthread_stack_dealloc (pthread->stackaddr, - pthread->stacksize); - pthread->stackaddr = setup->stackaddr; - pthread->stacksize = setup->stacksize; - } - } - else - { - err = __pthread_stack_alloc (&pthread->stackaddr, - setup->stacksize); - if (err) - goto failed_stack_alloc; - - pthread->stacksize = setup->stacksize; - pthread->stack = 1; - } - - /* Allocate the kernel thread and other required resources. */ - err = __pthread_thread_alloc (pthread); - if (err) - goto failed_thread_alloc; - -#ifdef ENABLE_TLS - pthread->tcb = _dl_allocate_tls (NULL); - if (!pthread->tcb) - goto failed_thread_tls_alloc; - pthread->tcb->tcb = pthread->tcb; -#endif /* ENABLE_TLS */ - - /* And initialize the rest of the machine context. This may include - additional machine- and system-specific initializations that - prove convenient. */ - err = __pthread_setup (pthread, entry_point, start_routine, arg); - if (err) - goto failed_setup; - - /* Initialize the system-specific signal state for the new - thread. */ - err = __pthread_sigstate_init (pthread); - if (err) - goto failed_sigstate; - - /* Set the new thread's signal mask and set the pending signals to - empty. POSIX says: "The signal mask shall be inherited from the - creating thread. The set of signals pending for the new thread - shall be empty." If the currnet thread is not a pthread then we - just inherit the process' sigmask. */ - if (__pthread_num_threads == 1) - err = sigprocmask (0, 0, &sigset); - else - err = __pthread_sigstate (_pthread_self (), 0, 0, &sigset, 0); - assert_perror (err); - - err = __pthread_sigstate (pthread, SIG_SETMASK, &sigset, 0, 1); - assert_perror (err); - - /* Increase the total number of threads. We do this before actually - starting the new thread, since the new thread might immediately - call `pthread_exit' which decreases the number of threads and - calls `exit' if the number of threads reaches zero. Increasing - the number of threads from within the new thread isn't an option - since this thread might return and call `pthread_exit' before the - new thread runs. */ - __atomic_inc (&__pthread_total); - - /* Store a pointer to this thread in the thread ID lookup table. We - could use __thread_setid, however, we only lock for reading as no - other thread should be using this entry (we also assume that the - store is atomic). */ - pthread_rwlock_rdlock (&__pthread_threads_lock); - __pthread_threads[pthread->thread - 1] = pthread; - pthread_rwlock_unlock (&__pthread_threads_lock); - - /* At this point it is possible to guess our pthread ID. We have to - make sure that all functions taking a pthread_t argument can - handle the fact that this thread isn't really running yet. */ - - /* Schedule the new thread. */ - err = __pthread_thread_start (pthread); - if (err) - goto failed_starting; - - /* At this point the new thread is up and running. */ - - *thread = pthread; - - return 0; - - failed_starting: - __pthread_setid (pthread->thread, NULL); - __atomic_dec (&__pthread_total); - failed_sigstate: - __pthread_sigstate_destroy (pthread); - failed_setup: -#ifdef ENABLE_TLS - _dl_deallocate_tls (pthread->tcb, 1); - failed_thread_tls_alloc: -#endif /* ENABLE_TLS */ - __pthread_thread_dealloc (pthread); - __pthread_thread_halt (pthread); - failed_thread_alloc: - __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize); - pthread->stack = 0; - failed_stack_alloc: - __pthread_dealloc (pthread); - failed: - return err; -} diff --git a/libpthread/pthread/pt-dealloc.c b/libpthread/pthread/pt-dealloc.c deleted file mode 100644 index 92fe1fda..00000000 --- a/libpthread/pthread/pt-dealloc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Deallocate a thread structure. - Copyright (C) 2000, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <pthread.h> -#include <stdlib.h> - -#include <pt-internal.h> - -/* List of thread structures corresponding to free thread IDs. */ -extern struct __pthread *__pthread_free_threads; -extern pthread_mutex_t __pthread_free_threads_lock; - - -/* Deallocate the thread structure for PTHREAD. */ -void -__pthread_dealloc (struct __pthread *pthread) -{ - assert (pthread->state != PTHREAD_TERMINATED); - - /* Withdraw this thread from the thread ID lookup table. */ - __pthread_setid (pthread->thread, NULL); - - /* Mark the thread as terminated. We broadcast the condition - here to prevent pthread_join from waiting for this thread to - exit where it was never really started. Such a call to - pthread_join is completely bogus, but unfortunately allowed - by the standards. */ - __pthread_mutex_lock (&pthread->state_lock); - if (pthread->state != PTHREAD_EXITED) - pthread_cond_broadcast (&pthread->state_cond); - __pthread_mutex_unlock (&pthread->state_lock); - - /* We do not actually deallocate the thread structure, but add it to - a list of re-usable thread structures. */ - pthread_mutex_lock (&__pthread_free_threads_lock); - __pthread_enqueue (&__pthread_free_threads, pthread); - pthread_mutex_unlock (&__pthread_free_threads_lock); - - /* Setting PTHREAD->STATE to PTHREAD_TERMINATED makes this TCB - available for reuse. After that point, we can no longer assume - that PTHREAD is valid. - - Note that it is safe to not lock this update to PTHREAD->STATE: - the only way that it can now be accessed is in __pthread_alloc, - which reads this variable. */ - pthread->state = PTHREAD_TERMINATED; -} diff --git a/libpthread/pthread/pt-detach.c b/libpthread/pthread/pt-detach.c deleted file mode 100644 index 1e42c452..00000000 --- a/libpthread/pthread/pt-detach.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Detach a thread. - Copyright (C) 2000, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <errno.h> -#include <pthread.h> -#include <stddef.h> - -#include <pt-internal.h> - -/* Indicate that the storage for THREAD can be reclaimed when it - terminates. */ -int -pthread_detach (pthread_t thread) -{ - struct __pthread *pthread; - int err = 0; - - /* Lookup the thread structure for THREAD. */ - pthread = __pthread_getid (thread); - if (pthread == NULL) - return ESRCH; - - __pthread_mutex_lock (&pthread->state_lock); - - switch (pthread->state) - { - case PTHREAD_JOINABLE: - /* THREAD still running. Mark it as detached such that its - resources can be reclaimed as soon as the thread exits. */ - pthread->state = PTHREAD_DETACHED; - - /* Broadcast the condition. This will make threads that are - waiting to join THREAD continue with hopefully disastrous - consequences instead of blocking indefinitely. */ - pthread_cond_broadcast (&pthread->state_cond); - __pthread_mutex_unlock (&pthread->state_lock); - break; - - case PTHREAD_EXITED: - /* THREAD has already exited. Make sure that nobody can - reference it anymore, and mark it as terminated. */ - - __pthread_mutex_unlock (&pthread->state_lock); - - /* Make sure the thread is not running before we remove its - stack. (The only possibility is that it is in a call to - __pthread_thread_halt itself, but that is enough to cause a - sigsegv.) */ - __pthread_thread_halt (pthread); - - /* Destroy the stack, the kernel resources and the control - block. */ - assert (pthread->stack); - __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize); - pthread->stack = 0; - - __pthread_thread_dealloc (pthread); - - __pthread_dealloc (pthread); - break; - - case PTHREAD_TERMINATED: - /* Pretend THREAD wasn't there in the first place. */ - __pthread_mutex_unlock (&pthread->state_lock); - err = ESRCH; - break; - - default: - /* Thou shalt not detach non-joinable threads! */ - __pthread_mutex_unlock (&pthread->state_lock); - err = EINVAL; - break; - } - - return err; -} diff --git a/libpthread/pthread/pt-exit.c b/libpthread/pthread/pt-exit.c deleted file mode 100644 index c01efda0..00000000 --- a/libpthread/pthread/pt-exit.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Thread termination. - Copyright (C) 2000, 2002, 2005, 2007, 2011 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> -#include <stdlib.h> - -#include <pt-internal.h> - -#include <bits/atomic.h> - - -/* Terminate the current thread and make STATUS available to any - thread that might join it. */ -void -pthread_exit (void *status) -{ - struct __pthread *self = _pthread_self (); - struct __pthread_cancelation_handler **handlers; - int oldstate; - - /* Run any cancelation handlers. According to POSIX, the - cancellation cleanup handlers should be called with cancellation - disabled. */ - pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate); - - for (handlers = __pthread_get_cleanup_stack (); - *handlers; - *handlers = (*handlers)->next) - (*handlers)->handler ((*handlers)->arg); - - pthread_setcancelstate (oldstate, &oldstate); - - /* Destory any thread specific data. */ - __pthread_destroy_specific (self); - - /* Destroy any signal state. */ - __pthread_sigstate_destroy (self); - - /* Decrease the number of threads. We use an atomic operation to - make sure that only the last thread calls `exit'. */ - if (__atomic_dec_and_test (&__pthread_total)) - /* We are the last thread. */ - exit (0); - - /* Note that after this point the process can be terminated at any - point if another thread calls `pthread_exit' and happens to be - the last thread. */ - - __pthread_mutex_lock (&self->state_lock); - - if (self->cancel_state == PTHREAD_CANCEL_ENABLE && self->cancel_pending) - status = PTHREAD_CANCELED; - -#ifdef ENABLE_TLS - if (self->tcb) - _dl_deallocate_tls (self->tcb, 1); -#endif /* ENABLE_TLS */ - - switch (self->state) - { - default: - assert (! "Consistency error: unexpected self->state"); - abort (); - break; - - case PTHREAD_DETACHED: - /* Make sure that nobody can reference this thread anymore, and - mark it as terminated. Our thread ID will immediately become - available for re-use. For obvious reasons, we cannot - deallocate our own stack. However, it will eventually be - reused when this thread structure is recycled. */ - __pthread_mutex_unlock (&self->state_lock); - - __pthread_dealloc (self); - - break; - - case PTHREAD_JOINABLE: - /* We need to stay around for a while since another thread - might want to join us. */ - self->state = PTHREAD_EXITED; - - /* We need to remember the exit status. A thread joining us - might ask for it. */ - self->status = status; - - /* Broadcast the condition. This will wake up threads that are - waiting to join us. */ - pthread_cond_broadcast (&self->state_cond); - __pthread_mutex_unlock (&self->state_lock); - - break; - } - - /* Note that after this point the resources used by this thread can - be freed at any moment if another thread joins or detaches us. - This means that before freeing any resources, such a thread - should make sure that this thread is really halted. */ - - __pthread_thread_halt (self); - - /* NOTREACHED */ - abort (); -} diff --git a/libpthread/pthread/pt-getattr.c b/libpthread/pthread/pt-getattr.c deleted file mode 100644 index 24599c6e..00000000 --- a/libpthread/pthread/pt-getattr.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Thread attributes retrieval. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <pthread.h> - -#include <pt-internal.h> - -/* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread THREAD. It shall be called on an uninitialized ATTR - and destroyed with pthread_attr_destroy when no longer needed. */ -int -pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) -{ - struct __pthread *pthread; - - pthread = __pthread_getid(thread); - if (pthread == NULL) - return ESRCH; - - /* Some attributes (schedparam, inheritsched, contentionscope and schedpolicy) - are not supported yet, so fill them with our default values. */ - *attr = __pthread_default_attr; - - attr->stackaddr = pthread->stackaddr; - attr->stacksize = pthread->stacksize; - attr->guardsize = pthread->guardsize; - attr->detachstate = (pthread->state == PTHREAD_DETACHED - ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE); - - return 0; -} diff --git a/libpthread/pthread/pt-initialize.c b/libpthread/pthread/pt-initialize.c deleted file mode 100644 index cf32b8b5..00000000 --- a/libpthread/pthread/pt-initialize.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Initialize pthreads library. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <string.h> - -#include <pt-internal.h> -#include <set-hooks.h> - -DEFINE_HOOK (__pthread_init, (void)); - -/* Initialize the pthreads library. */ -void -__pthread_initialize (void) -{ - RUN_HOOK (__pthread_init, ()); -} diff --git a/libpthread/pthread/pt-internal.h b/libpthread/pthread/pt-internal.h deleted file mode 100644 index 3f69d2dd..00000000 --- a/libpthread/pthread/pt-internal.h +++ /dev/null @@ -1,317 +0,0 @@ -/* Internal defenitions for pthreads library. - Copyright (C) 2000, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_INTERNAL_H -#define _PT_INTERNAL_H 1 - -#include <pthread.h> -#include <stddef.h> -#include <sched.h> -#include <signal.h> -#include <assert.h> - -#include <bits/atomic.h> - -#include <pt-key.h> - -#include <pt-sysdep.h> -#include <pt-machdep.h> - -/* Thread state. */ -enum pthread_state -{ - /* The thread is running and joinable. */ - PTHREAD_JOINABLE = 0, - /* The thread is running and detached. */ - PTHREAD_DETACHED, - /* A joinable thread exited and its return code is available. */ - PTHREAD_EXITED, - /* The thread structure is unallocated and available for reuse. */ - PTHREAD_TERMINATED -}; - -#ifndef PTHREAD_KEY_MEMBERS -# define PTHREAD_KEY_MEMBERS -#endif - -#ifndef PTHREAD_SYSDEP_MEMBERS -# define PTHREAD_SYSDEP_MEMBERS -#endif - -#ifdef ENABLE_TLS -/* Type of the TCB. */ -typedef struct -{ - void *tcb; /* Points to this structure. */ - void *dtv; /* Vector of pointers to TLS data. */ - thread_t self; /* This thread's control port. */ -} tcbhead_t; -#endif /* ENABLE_TLS */ - -/* This structure describes a POSIX thread. */ -struct __pthread -{ - /* Thread ID. */ - pthread_t thread; - - /* Cancellation. */ - int cancel_state; - int cancel_type; - int cancel_pending; - struct __pthread_cancelation_handler *cancelation_handlers; - - /* Thread stack. */ - void *stackaddr; - size_t stacksize; - size_t guardsize; /* Included in STACKSIZE (i.e. total - stack memory is STACKSIZE, not - STACKSIZE + GUARDSIZE). */ - int stack; /* Nonzero if the stack was allocated. */ - - /* Exit status. */ - void *status; - - /* Thread state. */ - enum pthread_state state; - pthread_mutex_t state_lock; /* Locks the state. */ - pthread_cond_t state_cond; /* Signalled when the state changes. */ - - /* Thread context. */ - struct pthread_mcontext mcontext; - - PTHREAD_KEY_MEMBERS - - PTHREAD_SYSDEP_MEMBERS - -#ifdef ENABLE_TLS - tcbhead_t *tcb; -#endif /* ENABLE_TLS */ - - struct __pthread *next, **prevp; -}; - -/* Enqueue an element THREAD on the queue *HEAD. */ -static inline void -__pthread_enqueue (struct __pthread **head, struct __pthread *thread) -{ - assert (thread->prevp == 0); - - thread->next = *head; - thread->prevp = head; - if (*head) - (*head)->prevp = &thread->next; - *head = thread; -} - -/* Dequeue the element THREAD from the queue it is connected to. */ -static inline void -__pthread_dequeue (struct __pthread *thread) -{ - assert (thread); - - if (thread->next) - thread->next->prevp = thread->prevp; - *thread->prevp = thread->next; - thread->prevp = 0; -} - -/* Iterate over QUEUE storing each element in ELEMENT. */ -#define __pthread_queue_iterate(queue, element) \ - for (struct __pthread *__pdi_next = (queue); \ - ((element) = __pdi_next) \ - && ((__pdi_next = __pdi_next->next), \ - 1); \ - ) - -/* Iterate over QUEUE dequeuing each element, storing it in - ELEMENT. */ -#define __pthread_dequeuing_iterate(queue, element) \ - for (struct __pthread *__pdi_next = (queue); \ - ((element) = __pdi_next) \ - && ((__pdi_next = __pdi_next->next), \ - ((element)->prevp = 0), \ - 1); \ - ) - -/* The total number of threads currently active. */ -extern __atomic_t __pthread_total; - -/* The total number of thread IDs currently in use, or on the list of - available thread IDs. */ -extern int __pthread_num_threads; - -/* Concurrency hint. */ -extern int __pthread_concurrency; - -/* Array of __pthread structures and its lock. Indexed by the pthread - id minus one. (Why not just use the pthread id? Because some - brain-dead users of the pthread interface incorrectly assume that 0 - is an invalid pthread id.) */ -extern struct __pthread **__pthread_threads; -extern pthread_rwlock_t __pthread_threads_lock; - -#define __pthread_getid(thread) \ - ({ struct __pthread *__t; \ - pthread_rwlock_rdlock (&__pthread_threads_lock); \ - __t = __pthread_threads[thread - 1]; \ - pthread_rwlock_unlock (&__pthread_threads_lock); \ - __t; }) - -#define __pthread_setid(thread, pthread) \ - pthread_rwlock_wrlock (&__pthread_threads_lock); \ - __pthread_threads[thread - 1] = pthread; \ - pthread_rwlock_unlock (&__pthread_threads_lock); - -/* Similar to pthread_self, but returns the thread descriptor instead - of the thread ID. */ -#ifndef _pthread_self -extern struct __pthread *_pthread_self (void); -#endif - - -/* Initialize the pthreads library. */ -extern void __pthread_initialize (void); - -/* Internal version of pthread_create. Rather than return the new - tid, we return the whole __pthread structure in *PTHREAD. */ -extern int __pthread_create_internal (struct __pthread **__restrict pthread, - const pthread_attr_t *__restrict attr, - void *(*start_routine)(void *), - void *__restrict arg); - -/* Allocate a new thread structure and a pthread thread ID (but not a - kernel thread or a stack). */ -extern int __pthread_alloc (struct __pthread **thread); - -/* Deallocate the thread structure. This is the dual of - __pthread_alloc (N.B. it does not call __pthread_stack_alloc nor - __pthread_thread_halt). */ -extern void __pthread_dealloc (struct __pthread *thread); - - -/* Allocate a stack of size STACKSIZE. The stack base shall be - returned in *STACKADDR. */ -extern int __pthread_stack_alloc (void **stackaddr, size_t stacksize); - -/* Deallocate the stack STACKADDR of size STACKSIZE. */ -extern void __pthread_stack_dealloc (void *stackaddr, size_t stacksize); - - -/* Setup thread THREAD's context. */ -extern int __pthread_setup (struct __pthread *__restrict thread, - void (*entry_point)(void *(*)(void *), - void *), - void *(*start_routine)(void *), - void *__restrict arg); - - -/* Allocate a kernel thread (and any miscellaneous system dependent - resources) for THREAD; it must not be placed on the run queue. */ -extern int __pthread_thread_alloc (struct __pthread *thread); - -/* Deallocate any kernel resources associated with THREAD. The thread - must not be running (that is, if __pthread_thread_start was called, - __pthread_thread_halt must first be called). This function will - never be called by a thread on itself. In the case that a thread - exits, its thread structure will be cached and cleaned up - later. */ -extern void __pthread_thread_dealloc (struct __pthread *thread); - -/* Start THREAD making it eligible to run. */ -extern int __pthread_thread_start (struct __pthread *thread); - -/* Stop the kernel thread associated with THREAD. This function may - be called by two threads in parallel. In particular, by the thread - itself and another thread trying to join it. This function must be - implemented such that this is safe. */ -extern void __pthread_thread_halt (struct __pthread *thread); - - -/* Called by a thread just before it calls the provided start - routine. */ -extern void __pthread_startup (void); - -/* Block THREAD. */ -extern void __pthread_block (struct __pthread *thread); - -/* Block THREAD until *ABSTIME is reached. */ -extern error_t __pthread_timedblock (struct __pthread *__restrict thread, - const struct timespec *__restrict abstime); - -/* Wakeup THREAD. */ -extern void __pthread_wakeup (struct __pthread *thread); - - -/* Perform a cancelation. */ -extern int __pthread_do_cancel (struct __pthread *thread); - - -/* Initialize the thread specific data structures. THREAD must be the - calling thread. */ -extern error_t __pthread_init_specific (struct __pthread *thread); - -/* Call the destructors on all of the thread specific data in THREAD. - THREAD must be the calling thread. */ -extern void __pthread_destroy_specific (struct __pthread *thread); - - -/* Initialize newly create thread *THREAD's signal state data - structures. */ -extern error_t __pthread_sigstate_init (struct __pthread *thread); - -/* Destroy the signal state data structures associcated with thread - *THREAD. */ -extern void __pthread_sigstate_destroy (struct __pthread *thread); - -/* Modify thread *THREAD's signal state. */ -extern error_t __pthread_sigstate (struct __pthread *__restrict thread, int how, - const sigset_t *__restrict set, - sigset_t *__restrict oset, - int clear_pending); - - -/* Default thread attributes. */ -extern const struct __pthread_attr __pthread_default_attr; - -/* Default barrier attributes. */ -extern const struct __pthread_barrierattr __pthread_default_barrierattr; - -/* Default mutex attributes. */ -extern const struct __pthread_mutexattr __pthread_default_mutexattr; - -/* Default rdlock attributes. */ -const struct __pthread_rwlockattr __pthread_default_rwlockattr; - -/* Default condition attributes. */ -const struct __pthread_condattr __pthread_default_condattr; - - -#ifdef ENABLE_TLS - -/* From glibc. */ - -/* Dynamic linker TLS allocation. */ -extern void *_dl_allocate_tls(void *); - -/* Dynamic linker TLS deallocation. */ -extern void _dl_deallocate_tls(void *, int); - -#endif /* ENABLE_TLS */ - -#endif /* pt-internal.h */ diff --git a/libpthread/pthread/pt-join.c b/libpthread/pthread/pt-join.c deleted file mode 100644 index 153058b5..00000000 --- a/libpthread/pthread/pt-join.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Wait for thread termination. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <errno.h> -#include <pthread.h> -#include <stddef.h> - -#include <pt-internal.h> - -/* Make calling thread wait for termination of thread THREAD. Return - the exit status of the thread in *STATUS. */ -int -pthread_join (pthread_t thread, void **status) -{ - struct __pthread *pthread; - int err = 0; - - /* Lookup the thread structure for THREAD. */ - pthread = __pthread_getid (thread); - if (pthread == NULL) - return ESRCH; - - __pthread_mutex_lock (&pthread->state_lock); - pthread_cleanup_push ((void (*)(void *)) __pthread_mutex_unlock, - &pthread->state_lock); - - while (pthread->state == PTHREAD_JOINABLE) - pthread_cond_wait (&pthread->state_cond, &pthread->state_lock); - - pthread_cleanup_pop (0); - - switch (pthread->state) - { - case PTHREAD_EXITED: - __pthread_mutex_unlock (&pthread->state_lock); - - /* THREAD has already exited. Salvage its exit status. */ - if (status) - *status = pthread->status; - - /* Make sure the thread is not running before we remove its - stack. (The only possibility is that it is in a call to - __pthread_thread_halt itself, but that is enough to cause a - sigsegv.) */ - __pthread_thread_halt (pthread); - - /* Destroy the stack, the kernel resources and the control - block. */ - assert (pthread->stack); - __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize); - pthread->stack = 0; - - __pthread_thread_dealloc (pthread); - - __pthread_dealloc (pthread); - break; - - case PTHREAD_TERMINATED: - /* Pretend THREAD wasn't there in the first place. */ - __pthread_mutex_unlock (&pthread->state_lock); - err = ESRCH; - break; - - default: - /* Thou shalt not join non-joinable threads! */ - __pthread_mutex_unlock (&pthread->state_lock); - err = EINVAL; - break; - } - - return err; -} diff --git a/libpthread/pthread/pt-self.c b/libpthread/pthread/pt-self.c deleted file mode 100644 index 49768643..00000000 --- a/libpthread/pthread/pt-self.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Get calling thread's ID. - Copyright (C) 2000, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -/* Return the thread ID of the calling thread. */ -pthread_t -pthread_self (void) -{ - struct __pthread *self = _pthread_self (); - assert (self); - - return self->thread; -} diff --git a/libpthread/pthread/pt-setcancelstate.c b/libpthread/pthread/pt-setcancelstate.c deleted file mode 100644 index e2d81833..00000000 --- a/libpthread/pthread/pt-setcancelstate.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set the cancel state for the calling thread. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -int -pthread_setcancelstate (int state, int *oldstate) -{ - struct __pthread *p = _pthread_self (); - - switch (state) - { - default: - return EINVAL; - case PTHREAD_CANCEL_ENABLE: - case PTHREAD_CANCEL_DISABLE: - break; - } - - if (oldstate) - *oldstate = p->cancel_state; - p->cancel_state = state; - - return 0; -} diff --git a/libpthread/pthread/pt-setcanceltype.c b/libpthread/pthread/pt-setcanceltype.c deleted file mode 100644 index 3ce4259c..00000000 --- a/libpthread/pthread/pt-setcanceltype.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Set the cancel type for the calling thread. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -int -pthread_setcanceltype (int type, int *oldtype) -{ - struct __pthread *p = _pthread_self (); - - switch (type) - { - default: - return EINVAL; - case PTHREAD_CANCEL_DEFERRED: - case PTHREAD_CANCEL_ASYNCHRONOUS: - break; - } - - if (oldtype) - *oldtype = p->cancel_type; - p->cancel_type = type; - - return 0; -} diff --git a/libpthread/pthread/pt-sigmask.c b/libpthread/pthread/pt-sigmask.c deleted file mode 100644 index 1b53873e..00000000 --- a/libpthread/pthread/pt-sigmask.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Get or set a thread's signal mask. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <signal.h> - -#include <pt-internal.h> - -int -pthread_sigmask (int how, const sigset_t *set, - sigset_t *oset) -{ - struct __pthread *self = _pthread_self (); - - /* Do not clear SELF's pending signals. */ - return __pthread_sigstate (self, how, set, oset, 0); -} diff --git a/libpthread/pthread/pt-spin-inlines.c b/libpthread/pthread/pt-spin-inlines.c deleted file mode 100644 index cfb21dd3..00000000 --- a/libpthread/pthread/pt-spin-inlines.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* <bits/spin-lock.h> declares some extern inline functions. These - functions are declared additionally here for use when inlining is - not possible. */ - -#define _FORCE_INLINES -#define __PT_SPIN_INLINE /* empty */ - -#include <pthread.h> - -/* Weak aliases for the spin lock functions. Note that - pthread_spin_lock is left out deliberately. We already provide an - implementation for it in pt-spin.c. */ -weak_alias (__pthread_spin_destroy, pthread_spin_destroy); -weak_alias (__pthread_spin_init, pthread_spin_init); -weak_alias (__pthread_spin_trylock, pthread_spin_trylock); -weak_alias (__pthread_spin_unlock, pthread_spin_unlock); diff --git a/libpthread/pthread/pt-testcancel.c b/libpthread/pthread/pt-testcancel.c deleted file mode 100644 index 01f1ac9c..00000000 --- a/libpthread/pthread/pt-testcancel.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Add an explicit cancelation point. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -void -pthread_testcancel (void) -{ - struct __pthread *p = _pthread_self (); - - if (p->cancel_state == PTHREAD_CANCEL_ENABLE && p->cancel_pending) - pthread_exit (PTHREAD_CANCELED); -} diff --git a/libpthread/signal/README b/libpthread/signal/README deleted file mode 100644 index 5487e2e3..00000000 --- a/libpthread/signal/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory provides a signal implementation, which is appropriate -for operating systems where signals are managed at user-level. It is -up to the run-time to catch the signals and forward them to the -implementation via, e.g., the pthread_kill_info_np call. diff --git a/libpthread/signal/TODO b/libpthread/signal/TODO deleted file mode 100644 index 1148abb3..00000000 --- a/libpthread/signal/TODO +++ /dev/null @@ -1,29 +0,0 @@ -Unimplemented Functionality ---------------------------- - -We don't support interruptible functions. That is, if a signal is -delivered when a thread is in e.g. the write system call, then the -write function should be interrupted and return EINTR when the signal -handler is finished. To realize this behavior, we could have a thread -local interruptible flag and a setjmp buffer. A function that is -interruptible would fill the jump buffer and set the interruptible -flag. If a signal comes in and the interruptible flag is set, rather -than resuming the thread, we longjmp to the buffer. - -If a signal action has set the SA_SIGINFO, the third argument must be -a pointer to a ucontext describing the thread's interrupted state; -this implementation passes NULL. This isn't as bad as it sounds as -the the ucontext family of functions are marked obsolete in SUSv3 with -the advisory that any use of them should be replaced by the use of -pthread functionality (cf. makecontext rationale). - -stop and continue signals are not implemented (as we need to stop all -threads, this requires being in bed with libpthread). - -Implementation is not yet cancellation-safe. - -There are not even stubs for sighold, sigingore, sigpause, sigrelse, -however, according to posix: "Use of any of these functions is -unspecified in a multi-threaded process." - -Implement sigtimedwait, sigqueue.
\ No newline at end of file diff --git a/libpthread/signal/kill.c b/libpthread/signal/kill.c deleted file mode 100644 index 27c9c32a..00000000 --- a/libpthread/signal/kill.c +++ /dev/null @@ -1,70 +0,0 @@ -/* kill.c - Generic kill implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -kill (pid_t pid, int signo) -{ - if (pid != getpid ()) - { - errno = EOPNOTSUPP; - return -1; - } - - /* "Signals generated for the process shall be delivered to exactly - one of those threads within the process which is in a call to a - sigwait() function selecting that signal or has not blocked - delivery of the signal. If there are no threads in a call to a - sigwait() function selecting that signal, and if all threads - within the process block delivery of the signal, the signal shall - remaing pending on the process" (2.4.1). */ - - /* First, see if there is a waiter, which is interested in this - signal. */ - pthread_mutex_lock (&sig_lock); - - struct sigwaiter *waiter; - for (waiter = sigwaiters; waiter; waiter = waiter->next) - if ((waiter->signals & sigmask (signo))) - /* Got a winner. */ - { - sigdelset (&process_pending, signo); - - pthread_mutex_lock (&waiter->ss->lock); - sigdelset (&waiter->ss->pending, signo); - - memset (&waiter->info, 0, sizeof (waiter->info)); - waiter->info.si_signo = signo; - - sigwaiter_unblock (waiter); - - return 0; - } - - pthread_mutex_unlock (&sig_lock); - - /* XXX: We just generate the signal for the current thread. If the - current thread has blocked the signal, the correct thing to do is - to iterate over all the other threads and find on that hasn't - blocked it. */ - return pthread_kill (pthread_self (), signo); -} - diff --git a/libpthread/signal/pt-kill-siginfo-np.c b/libpthread/signal/pt-kill-siginfo-np.c deleted file mode 100644 index 9bdf6cc4..00000000 --- a/libpthread/signal/pt-kill-siginfo-np.c +++ /dev/null @@ -1,88 +0,0 @@ -/* pthread-kill-siginfo-np.c - Generic pthread_kill_siginfo_np implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "pt-internal.h" -#include "sig-internal.h" - -int -pthread_kill_siginfo_np (pthread_t tid, siginfo_t si) -{ - int sig = si.si_signo; - - if (sig < 0 || sig >= NSIG) - return EINVAL; - - if (sig == 0) - return 0; - - struct signal_state *ss = &__pthread_getid (tid)->ss; - - pthread_mutex_lock (&sig_lock); - pthread_mutex_lock (&ss->lock); - - if (ss->sigwaiter && (ss->sigwaiter->signals & sigmask (si.si_signo))) - /* The thread is in a call to sigwait. */ - { - ss->sigwaiter->info = si; - sigwaiter_unblock (ss->sigwaiter); - return 0; - } - - pthread_mutex_unlock (&sig_lock); - - if (ss->actions[sig - 1].sa_handler == (void *) SIG_IGN - || (ss->actions[sig - 1].sa_handler == (void *) SIG_DFL - && default_action (sig) == sig_ignore)) - /* It is unclear (to me) what is supposed to happen when a signal - is generated for a thread, which is blocking that signal and - ignoring it. POSIX does say that when the action associated - with a pending, blocked signal is set to SIG_IGN, the pending - signal is to be cleared. Thus, it makes sense that any signal - set to ignore is discarded at generation. */ - { - pthread_mutex_unlock (&ss->lock); - return 0; - } - - - if ((sigmask (sig) & ss->blocked)) - /* The signal is blocked. Mark it pending. */ - { - ss->pending |= sigmask (sig); - pthread_mutex_unlock (&ss->lock); - return 0; - } - - if (pthread_self () == tid - && (! (ss->actions[si.si_signo - 1].sa_flags & SA_ONSTACK) - || (ss->stack.ss_flags & SS_DISABLE) - || (ss->stack.ss_flags & SS_ONSTACK))) - /* We are sending a signal to ourself and we don't use an - alternate stack. */ - signal_dispatch (ss, &si); - else - signal_dispatch_lowlevel (ss, tid, si); - - /* Don't unlock ss: signal_dispatch and signal_dispatch_lowlevel - assume ownership of the lock. */ - - return 0; -} - diff --git a/libpthread/signal/sig-internal.c b/libpthread/signal/sig-internal.c deleted file mode 100644 index f73f38b4..00000000 --- a/libpthread/signal/sig-internal.c +++ /dev/null @@ -1,26 +0,0 @@ -/* sig-internal.c - Signal state functions. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -pthread_mutex_t sig_lock = PTHREAD_MUTEX_INITIALIZER; - -sigset_t process_pending; -siginfo_t process_pending_info[NSIG]; diff --git a/libpthread/signal/sig-internal.h b/libpthread/signal/sig-internal.h deleted file mode 100644 index 6c86c796..00000000 --- a/libpthread/signal/sig-internal.h +++ /dev/null @@ -1,177 +0,0 @@ -/* sig-internal.h - Internal signal handling interface. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef SIG_INTERNAL_H -#define SIG_INTERNAL_H - -#include <signal.h> - -#include <sig-sysdep.h> - -#define sigmask(sig) (1ULL << (sig - 1)) -#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) | \ - sigmask (SIGSTOP) | sigmask (SIGTSTP)) - -/* General lock. Protects PROCESS_PENDING, PROCESS_PENDING_INFO, - SIGWAITERS. */ -extern pthread_mutex_t sig_lock; - -/* "Signals generated for the process shall be delivered to exactly - one of those threads within the process which is in a call to a - sigwait() function selecting that signal or has not blocked - delivery of the signal. If there are no threads in a call to a - sigwait() function selecting that signal, and if all threads within - the process block delivery of the signal, the signal shall remaing - pending on the process" (2.4.1). - - This variable is protected by SIG_LOCK. */ -extern sigset_t process_pending; -extern siginfo_t process_pending_info[NSIG]; - -struct sigwaiter; - -/* The per-thread signal state. */ -struct signal_state -{ - /* Protects the following fields. STACK.SA_FLAGS may be accessed - using atomic operations. */ - pthread_mutex_t lock; - - /* Pending signals. */ - sigset_t pending; - - /* Blocked signals (i.e., the signal mask). */ - sigset_t blocked; - - stack_t stack; - struct sigaction actions[NSIG]; - siginfo_t info[NSIG]; - - /* If the thread is blocked in a call to sigwait. */ - struct sigwaiter *sigwaiter; -}; - -#define PTHREAD_SIGNAL_MEMBERS struct signal_state ss; - -/* Arranges for thread TID to call signal_dispatch. Must not be - called if TID is the caller and an alternate stack is not required. - In this case, the caller should call signal_dispatch directly. */ -extern void signal_dispatch_lowlevel (struct signal_state *ss, - pthread_t tid, siginfo_t si); - -/* This is the signal handler entry point. A thread is forced into - this state when it receives a signal. We need to save the thread's - state and then invoke the high-level signal dispatcher. SS->LOCK - is locked by the caller. */ -extern void signal_dispatch (struct signal_state *ss, siginfo_t *si); - -#ifndef SIGNAL_DISPATCH_ENTRY -#define SIGNAL_DISPATCH_ENTRY -#endif - -#ifndef SIGNAL_DISPATCH_EXIT -#define SIGNAL_DISPATCH_EXIT -#endif - -/* When a thread calls sigwait and a requested signal is not pending, - it allocates the following structure, fills it in, adds it to - sigwaiters and sleeps. */ -struct sigwaiter -{ - struct sigwaiter *next; - struct sigwaiter *prev; - - /* Thread's signal state. */ - struct signal_state *ss; - - /* Signals this thread is waiting for. */ - sigset_t signals; - - /* The selected signal is returned here. The waiter also - futex_waits on this info.si_signo. */ - siginfo_t info; -}; - -/* This variable is protected by SIG_LOCK. */ -extern struct sigwaiter *sigwaiters; - -/* Block the caller waiting for a signal in set SET. SIG_LOCK and - SS->LOCK must be held and will be unlocked by this function before - blocking. */ -extern siginfo_t sigwaiter_block (struct signal_state *ss, - const sigset_t *restrict set); - -/* Unblock the waiter WAITER. SIG_LOCK and WAITER->SS->LOCK must be - held. Both will be dropped on return. */ -extern void sigwaiter_unblock (struct sigwaiter *waiter); - -enum sig_action { sig_core, sig_terminate, sig_ignore, sig_cont, sig_stop }; - -static inline enum sig_action -default_action (int signo) -{ - switch (signo) - { - case SIGABRT: - case SIGBUS: - case SIGFPE: - case SIGILL: - case SIGQUIT: - case SIGSEGV: - case SIGSTKFLT: - case SIGSYS: - case SIGTRAP: - case SIGXCPU: - case SIGXFSZ: - return sig_core; - - case SIGALRM: - case SIGHUP: - case SIGINT: - case SIGIO: /* Perhaps ignore? */ - case SIGKILL: - case SIGPIPE: - case SIGPROF: - case SIGTERM: - case SIGUSR1: - case SIGUSR2: - case SIGVTALRM: - return sig_terminate; - - case SIGCHLD: - case SIGPWR: - case SIGURG: - case SIGWINCH: - return sig_ignore; - - case SIGCONT: - return sig_cont; - - case SIGSTOP: - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - return sig_stop; - } - - panic ("Unknown signal number: %d", signo); -} - -#endif diff --git a/libpthread/signal/sigaction.c b/libpthread/signal/sigaction.c deleted file mode 100644 index 0126c99d..00000000 --- a/libpthread/signal/sigaction.c +++ /dev/null @@ -1,72 +0,0 @@ -/* sigaction.c - Generic sigaction implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" -#include "pt-internal.h" - -int -sigaction (int sig, const struct sigaction *restrict sa, - struct sigaction *restrict osa) -{ - if (sig <= 0 || sig >= NSIG) - { - errno = EINVAL; - return -1; - } - - struct signal_state *ss = &_pthread_self ()->ss; - - pthread_mutex_lock (&ss->lock); - - if (osa) - *osa = ss->actions[sig - 1]; - - if (sa) - { - ss->actions[sig - 1] = *sa; - - /* "The SIGKILL and SIGSTOP signals shall not be added to the - signal mask using this mechanism; this restriction shall be - enforced by the system without causing an error to be - indicated" (sigaction). */ - sigdelset (&ss->blocked, SIGKILL); - sigdelset (&ss->blocked, SIGSTOP); - - /* A "signal shall remain pending on the process until it is - unblocked, it is accepted when ..., or the action associated - with it is set to ignore the signal" (2.4.1). - - "Setting a signal action to SIG_DFL for a signal that is - pending, and whose default action is to ignore the signal, - ..., shall cause the pending signal to be discarded, whether - or not it is blocked" (2.4.3). */ - if (sa->sa_handler == SIG_IGN - || (sa->sa_handler == SIG_DFL && default_action (sig) == sig_ignore)) - { - sigdelset (&ss->pending, sig); - sigdelset (&process_pending, sig); - } - } - - pthread_mutex_unlock (&ss->lock); - - return 0; -} - diff --git a/libpthread/signal/sigaltstack.c b/libpthread/signal/sigaltstack.c deleted file mode 100644 index 8334811a..00000000 --- a/libpthread/signal/sigaltstack.c +++ /dev/null @@ -1,69 +0,0 @@ -/* sigaltstack.c - Generic sigaltstack implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" -#include "pt-internal.h" - -int -sigaltstack (const stack_t *restrict stack, stack_t *restrict old) -{ - int err = 0; - struct signal_state *ss = &_pthread_self ()->ss; - - pthread_mutex_lock (&ss->lock); - - if (old) - *old = ss->stack; - - if (stack) - { - if (stack->ss_size < MINSIGSTKSZ) - { - err = ENOMEM; - goto out; - } - - if ((stack->ss_flags & ~(SS_DISABLE))) - /* Flags contains a value other than SS_DISABLE. */ - { - err = EINVAL; - goto out; - } - - if ((ss->stack.ss_flags & SS_ONSTACK)) - /* Stack in use. */ - { - err = EPERM; - goto out; - } - - ss->stack = *stack; - } - - out: - pthread_mutex_unlock (&ss->lock); - - if (err) - { - errno = err; - return -1; - } - return 0; -} diff --git a/libpthread/signal/signal-dispatch.c b/libpthread/signal/signal-dispatch.c deleted file mode 100644 index 40440b70..00000000 --- a/libpthread/signal/signal-dispatch.c +++ /dev/null @@ -1,117 +0,0 @@ -/* signal-dispatch.c - Signal dispatcher. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -/* This is the signal handler entry point. A thread is forced into - this state when it receives a signal. We need to save the thread's - state and then invoke the high-level signal dispatcher. SS->LOCK - is locked by the caller. */ -void -signal_dispatch (struct signal_state *ss, siginfo_t *si) -{ - SIGNAL_DISPATCH_ENTRY; - - int signo = si->si_signo; - - assert (signo > 0 && signo < NSIG); - assert (pthread_mutex_trylock (&ss->lock) == EBUSY); - - do - { - if ((sigmask (signo) & STOPSIGS)) - /* Stop signals clear a pending SIGCONT even if they - are handled or ignored (but not if preempted). */ - { - sigdelset (&ss->pending, SIGCONT); - sigdelset (&process_pending, SIGCONT); - } - else if ((signo == SIGCONT)) - /* Even if handled or ignored (but not preempted), SIGCONT - clears stop signals and resumes the process. */ - { - ss->pending &= ~STOPSIGS; - process_pending &= ~STOPSIGS; - } - - void (*handler)(int, siginfo_t *, void *) - = ss->actions[signo - 1].sa_sigaction; - - /* Reset to SIG_DFL if requested. SIGILL and SIGTRAP cannot - be automatically reset when delivered; the system silently - enforces this restriction (sigaction). */ - if (ss->actions[signo - 1].sa_flags & SA_RESETHAND - && signo != SIGILL && signo != SIGTRAP) - ss->actions[signo - 1].sa_handler = SIG_DFL; - - sigset_t orig_blocked = ss->blocked; - /* Block requested signals while running the handler. */ - ss->blocked |= ss->actions[signo - 1].sa_mask; - - /* Block SIGNO unless we're asked not to. */ - if (! (ss->actions[signo - 1].sa_flags & (SA_RESETHAND | SA_NODEFER))) - sigaddset (&ss->blocked, signo); - - sigdelset (&ss->pending, signo); - pthread_mutex_unlock (&ss->lock); - - pthread_mutex_lock (&sig_lock); - sigdelset (&process_pending, signo); - pthread_mutex_unlock (&sig_lock); - - if (handler == (void *) SIG_DFL) - { - enum sig_action action = default_action (signo); - - if (action == sig_terminate || action == sig_core) - _exit (128 + signo); - - if (action == sig_stop) - /* XXX: Implement me. */ - panic ("Stopping process unimplemented."); - - if (action == sig_cont) - /* XXX: Implement me. */; - panic ("Continuing process unimplemented."); - } - else if (handler == (void *) SIG_IGN) - ; - else - handler (signo, si, NULL); - - pthread_mutex_lock (&ss->lock); - - /* "When a thread's signal mask is changed in a signal-catching - function that is installed by sigaction(), the restoration of - the signal mask on return from the signal-catching function - overrides that change (see sigaction())" (sigprocmask). */ - ss->blocked = orig_blocked; - - sigset_t pending = ~ss->blocked & ss->pending; - if (! pending) - pending = ~ss->blocked & process_pending; - signo = l4_lsb64 (pending); - } - while (signo); - - pthread_mutex_unlock (&ss->lock); - - SIGNAL_DISPATCH_EXIT; -} diff --git a/libpthread/signal/signal.h b/libpthread/signal/signal.h deleted file mode 100644 index a33d995c..00000000 --- a/libpthread/signal/signal.h +++ /dev/null @@ -1,275 +0,0 @@ -/* signal.h - Signal handling interface. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _SIGNAL_H -#define _SIGNAL_H 1 - -#include <stdint.h> -#include <sys/types.h> - -typedef volatile int sig_atomic_t; - -typedef uint64_t sigset_t; - -int sigaddset (sigset_t *, int); -int sigdelset (sigset_t *, int); -int sigemptyset (sigset_t *); -int sigfillset (sigset_t *); -int sigismember (const sigset_t *, int); - -/* These values are consistent with Linux. */ -#define SIGRTMIN 34 -#define SIGRTMAX 64 - -enum - { - SIGHUP = 1, -#define SIGHUP SIGHUP - SIGINT, -#define SIGINT SIGINT - SIGQUIT, -#define SIGQUIT SIGQUIT - SIGILL, -#define SIGILL SIGILL - SIGTRAP, -#define SIGTRAP SIGTRAP - SIGABRT, -#define SIGABRT SIGABRT - SIGBUS, -#define SIGBUS SIGBUS - SIGFPE, -#define SIGFPE SIGFPE - SIGKILL, -#define SIGKILL SIGKILL - SIGUSR1, -#define SIGUSR1 SIGUSR1 - SIGSEGV, -#define SIGSEGV SIGSEGV - SIGUSR2, -#define SIGUSR2 SIGUSR2 - SIGPIPE, -#define SIGPIPE SIGPIPE - SIGALRM, -#define SIGALRM SIGALRM - SIGTERM, -#define SIGTERM SIGTERM - SIGSTKFLT, -#define SIGSTKFLT SIGSTKFLT - SIGCHLD, -#define SIGCHLD SIGCHLD - SIGCONT, -#define SIGCONT SIGCONT - SIGSTOP, -#define SIGSTOP SIGSTOP - SIGTSTP, -#define SIGTSTP SIGTSTP - SIGTTIN, -#define SIGTTIN SIGTTIN - SIGTTOU, -#define SIGTTOU SIGTTOU - SIGURG, -#define SIGURG SIGURG - SIGXCPU, -#define SIGXCPU SIGXCPU - SIGXFSZ, -#define SIGXFSZ SIGXFSZ - SIGVTALRM, -#define SIGVTALRM SIGVTALRM - SIGPROF, -#define SIGPROF SIGPROF - SIGWINCH, -#define SIGWINCH SIGWINCH - SIGIO, -#define SIGIO SIGIO - SIGPWR, -#define SIGPWR SIGPWR - SIGSYS, -#define SIGSYS SIGSYS - NSIG - }; - -/* The resulting set is the union of the current set and the signal - set pointed to by the argument set. */ -#define SIG_BLOCK 1 -/* The resulting set is the intersection of the current set and the - complement of the signal set pointed to by the argument set. */ -#define SIG_UNBLOCK 2 -/* The resulting set is the signal set pointed to by the argument - set. */ -#define SIG_SETMASK 3 - -int pthread_sigmask (int how, const sigset_t *mask, sigset_t *old); -int sigprocmask (int how, const sigset_t *restrict mask, - sigset_t *restrict old); - -/* Return set of pending signals. */ -int sigpending(sigset_t *set); - -union sigval -{ - int sival_int; - void *sival_ptr; -}; - -#define SIG_DFL ((void (*)(int)) (0)) -#define SIG_ERR ((void (*)(int)) (-1)) -#define SIG_IGN ((void (*)(int)) (1)) - -/* Causes signal delivery to occur on an alternate stack. */ -#define SA_ONSTACK (1 << 0) -/* Do not generate SIGCHLD when children stop or stopped children - continue. */ -#define SA_NOCLDSTOP (1 << 1) -/* Causes signal dispositions to be set to SIG_DFL on entry to signal - handlers. */ -#define SA_RESETHAND (1 << 2) -/* Causes certain functions to become restartable. */ -#define SA_RESTART (1 << 3) -/* Causes extra information to be passed to signal handlers at the - time of receipt of a signal. */ -#define SA_SIGINFO (1 << 4) -/* Causes implementations not to create zombie processes on child - death. */ -#define SA_NOCLDWAIT (1 << 5) -/* Causes signal not to be automatically blocked on entry to - signal handler. */ -#define SA_NODEFER (1 << 6) - -typedef struct -{ - int si_signo; - int si_code; - int si_errno; - pid_t si_pid; - uid_t si_uid; - void *si_addr; - int si_status; - long si_band; - union sigval si_value; -} siginfo_t; - -struct sigaction -{ - union - { - /* Pointer to a signal-catching function or one of the macros - SIG_IGN or SIG_DFL. */ - void (*sa_handler)(int); - - /* Pointer to a signal-catching function. */ - void (*sa_sigaction)(int, siginfo_t *, void *); - }; - - /* Set of signals to be blocked during execution of the signal - handling function. */ - sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; -}; - -int sigaction (int signo, const struct sigaction *restrict newaction, - struct sigaction *restrict oldaction); - -void (*signal (int signo, void (*handler)(int)))(int); -void (*bsd_signal (int signo, void (*handler)(int)))(int); - -/* Process is executing on an alternate signal stack. */ -#define SS_ONSTACK (1 << 0) -/* Alternate signal stack is disabled. */ -#define SS_DISABLE (1 << 1) - -/* Minimum stack size for a signal handler. */ -#define MINSIGSTKSZ PAGESIZE -/* Default size in bytes for the alternate signal stack. */ -#define SIGSTKSZ (16 * PAGESIZE) - -typedef struct -{ - void *ss_sp; - size_t ss_size; - int ss_flags; -} stack_t; - -int sigaltstack(const stack_t *restrict stack, stack_t *restrict old); - -#include <pthread.h> - -/* Send SIGNO to the process PID. */ -int kill(pid_t pid, int signo); - -/* Send SIGNO to the process group PG. */ -int killpg(pid_t pg, int signo); - -/* Send SIGNO to thread TID. */ -int pthread_kill(pthread_t tid, int signo); - -/* Send a signal to thread TID using SIGINFO. */ -int pthread_kill_siginfo_np (pthread_t tid, siginfo_t siginfo); - -/* Send SIGNO to the calling thread. */ -int raise(int signo); - -typedef struct sigevent -{ - /* Notification type. */ - int sigev_notify; - - /* Signal number. */ - int sigev_signo; - - /* Signal value. */ - union sigval sigev_value; - - /* Notification function. */ - void (*sigev_notify_function) (union sigval); - - /* Notification attributes. */ - pthread_attr_t *sigev_notify_attributes; -} sigevent_t; - -enum - { - SIGEV_NONE = 0, -#define SIGEV_NONE SIGEV_NONE - SIGEV_SIGNAL, -#define SIGEV_SIGNAL SIGEV_SIGNAL - SIGEV_THREAD -#define SIGEV_THREAD SIGEV_THREAD - }; - -#define SIG_HOLD - -int sighold (int); -int sigignore (int); -int siginterrupt (int, int); -int sigpause (int); -int sigqueue (pid_t, int, const union sigval); -int sigrelse (int); -void (*sigset (int, void (*)(int)))(int); -int sigsuspend (const sigset_t *); - -/* Wait for a signal. */ -int sigwait (const sigset_t *restrict set, int *restrict signo); -int sigwaitinfo (const sigset_t *restrict set, siginfo_t *restrict info); -int sigtimedwait (const sigset_t *restrict set, siginfo_t *restrict info, - const struct timespec *restrict timespec); - -#endif diff --git a/libpthread/signal/sigpending.c b/libpthread/signal/sigpending.c deleted file mode 100644 index 609b55d6..00000000 --- a/libpthread/signal/sigpending.c +++ /dev/null @@ -1,38 +0,0 @@ -/* sigpending.c - Generic sigpending implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <sig-internal.h> -#include <pt-internal.h> - -int -sigpending (sigset_t *set) -{ - struct signal_state *ss = &_pthread_self ()->ss; - - pthread_mutex_lock (&ss->lock); - - /* There is no need to lock SIG_LOCK for process_pending since we - just read it, which is atomic. */ - *set = (ss->pending | process_pending) & ss->blocked; - - pthread_mutex_unlock (&ss->lock); - - return 0; -} diff --git a/libpthread/signal/sigsuspend.c b/libpthread/signal/sigsuspend.c deleted file mode 100644 index 73cf12a1..00000000 --- a/libpthread/signal/sigsuspend.c +++ /dev/null @@ -1,29 +0,0 @@ -/* sigsuspend.c - Generic sigsuspend implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigsuspend (const sigset_t *set) -{ - /* XXX: Implement me. */ - errno = EOPNOTSUPP; - return -1; -} diff --git a/libpthread/signal/sigtimedwait.c b/libpthread/signal/sigtimedwait.c deleted file mode 100644 index 52cd0176..00000000 --- a/libpthread/signal/sigtimedwait.c +++ /dev/null @@ -1,30 +0,0 @@ -/* sigtimedwait.c - Generic sigtimedwait implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigtimedwait (const sigset_t *restrict set, siginfo_t *restrict info, - const struct timespec *restrict timeout) -{ - errno = EOPNOTSUPP; - return -1; -} - diff --git a/libpthread/signal/sigwaiter.c b/libpthread/signal/sigwaiter.c deleted file mode 100644 index 8d041ac1..00000000 --- a/libpthread/signal/sigwaiter.c +++ /dev/null @@ -1,91 +0,0 @@ -/* sigwaiter.c - Signal handling functions. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -#include <hurd/futex.h> - -struct sigwaiter *sigwaiters; - -siginfo_t -sigwaiter_block (struct signal_state *ss, const sigset_t *restrict set) -{ - assert (pthread_mutex_trylock (&sig_lock) == EBUSY); - assert (pthread_mutex_trylock (&ss->lock) == EBUSY); - - assert (! ss->sigwaiter); - - struct sigwaiter waiter; - - waiter.next = sigwaiters; - if (waiter.next) - { - assert (! waiter.next->prev); - waiter.next->prev = &waiter; - } - waiter.prev = 0; - sigwaiters = &waiter; - - waiter.ss = ss; - waiter.info.si_signo = 0; - waiter.signals = *set; - - ss->sigwaiter = &waiter; - - pthread_mutex_unlock (&ss->lock); - pthread_mutex_unlock (&sig_lock); - - futex_wait (&waiter.info.si_signo, 0); - -#ifndef NDEBUG - pthread_mutex_lock (&ss->lock); - ss->sigwaiter = 0; - pthread_mutex_unlock (&ss->lock); -#endif - - assert (waiter.info.si_signo); - return waiter.info; -} - -void -sigwaiter_unblock (struct sigwaiter *waiter) -{ - assert (pthread_mutex_trylock (&sig_lock) == EBUSY); - assert (pthread_mutex_trylock (&waiter->ss->lock) == EBUSY); - - struct sigwaiter *prev = waiter->prev; - struct sigwaiter *next = waiter->next; - - if (next) - next->prev = prev; - - if (prev) - prev->next = next; - else - sigwaiters = next; - - sigdelset (&process_pending, waiter->info.si_signo); - sigdelset (&waiter->ss->pending, waiter->info.si_signo); - - pthread_mutex_unlock (&waiter->ss->lock); - pthread_mutex_unlock (&sig_lock); - - futex_wake (&waiter->info.si_signo, 1); -} diff --git a/libpthread/signal/sigwaitinfo.c b/libpthread/signal/sigwaitinfo.c deleted file mode 100644 index 1b47079e..00000000 --- a/libpthread/signal/sigwaitinfo.c +++ /dev/null @@ -1,74 +0,0 @@ -/* sigwaitinfo.c - Generic sigwaitinfo implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <sig-internal.h> -#include <pt-internal.h> - -int -sigwaitinfo (const sigset_t *restrict set, siginfo_t *restrict info) -{ - pthread_mutex_lock (&sig_lock); - - struct signal_state *ss = &_pthread_self ()->ss; - - pthread_mutex_lock (&ss->lock); - - if ((process_pending & *set) || (ss->pending & *set)) - /* There is at least one signal pending. */ - { - bool local = true; - sigset_t extant = process_pending & *set; - if (! extant) - { - local = false; - extant = ss->pending & *set; - } - - assert (extant); - - int signo = l4_msb64 (extant); - - if (info) - { - if (local) - *info = ss->info[signo - 1]; - else - *info = process_pending_info[signo - 1]; - info->si_signo = signo; - } - - sigdelset (&process_pending, signo); - sigdelset (&ss->pending, signo); - - pthread_mutex_unlock (&ss->lock); - pthread_mutex_unlock (&sig_lock); - return 0; - } - - siginfo_t i = sigwaiter_block (ss, set); - assert (i.si_signo); - assert ((sigmask (i.si_signo) & *set)); - - if (info) - *info = i; - - return 0; -} - diff --git a/libpthread/sysdeps/generic/bits/barrier-attr.h b/libpthread/sysdeps/generic/bits/barrier-attr.h deleted file mode 100644 index a9900b71..00000000 --- a/libpthread/sysdeps/generic/bits/barrier-attr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Thread barrier attribute type. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_BARRIER_ATTR_H -#define _BITS_BARRIER_ATTR_H 1 - -enum __pthread_process_shared; - -/* This structure describes the attributes of a POSIX thread barrier. - Note that not all of them are supported on all systems. */ -struct __pthread_barrierattr -{ - enum __pthread_process_shared pshared; -}; - -#endif /* bits/barrier-attr.h */ diff --git a/libpthread/sysdeps/generic/bits/barrier.h b/libpthread/sysdeps/generic/bits/barrier.h deleted file mode 100644 index 5e559312..00000000 --- a/libpthread/sysdeps/generic/bits/barrier.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Thread barrier attribute type. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_BARRIER_H -#define _BITS_BARRIER_H 1 - -#include <bits/spin-lock.h> - -/* This structure describes the attributes of a POSIX barrier. */ -struct __pthread_barrier -{ - __pthread_spinlock_t lock; - struct __pthread *queue; /* List of waiters. */ - unsigned pending; /* Number of that still need to wait on - barrier. */ - unsigned count; /* Number of threads that must wait before - barrier is passed. */ - struct __pthread_barrierattr *attr; - void *data; -}; - - -#endif /* bits/barrier.h */ diff --git a/libpthread/sysdeps/generic/bits/cancelation.h b/libpthread/sysdeps/generic/bits/cancelation.h deleted file mode 100644 index 46486f5e..00000000 --- a/libpthread/sysdeps/generic/bits/cancelation.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Cancelation. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_CANCELATION_H -#define _BITS_CANCELATION_H 1 - -struct __pthread_cancelation_handler -{ - void (*handler)(void *); - void *arg; - struct __pthread_cancelation_handler *next; -}; - -/* Returns the thread local location of the cleanup handler stack. */ -struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); - -#define __pthread_cleanup_push(rt, rtarg) \ - { \ - struct __pthread_cancelation_handler **__handlers \ - = __pthread_get_cleanup_stack (); \ - struct __pthread_cancelation_handler __handler = \ - { \ - (rt), \ - (rtarg), \ - *__handlers \ - }; \ - *__handlers = &__handler; - -#define __pthread_cleanup_pop(execute) \ - if (execute) \ - __handler.handler (__handler.arg); \ - *__handlers = __handler.next; \ - } - -#endif /* _BITS_CANCELATION_H */ diff --git a/libpthread/sysdeps/generic/bits/condition-attr.h b/libpthread/sysdeps/generic/bits/condition-attr.h deleted file mode 100644 index 4cd4e8c4..00000000 --- a/libpthread/sysdeps/generic/bits/condition-attr.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Condition attribute type. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_CONDITION_ATTR_H -#define _BITS_CONDITION_ATTR_H 1 - -#include <bits/types.h> - -enum __pthread_process_shared; - -/* User visible part of a condition attribute variable. */ -struct __pthread_condattr - { - enum __pthread_process_shared pshared; - __clockid_t clock; - }; - -#endif /* bits/condition.h */ diff --git a/libpthread/sysdeps/generic/bits/condition.h b/libpthread/sysdeps/generic/bits/condition.h deleted file mode 100644 index bf13adab..00000000 --- a/libpthread/sysdeps/generic/bits/condition.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Condition type. Generic version. - Copyright (C) 2000, 2005, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_CONDITION_H -#define _BITS_CONDITION_H 1 - -#include <bits/spin-lock.h> - -/* User visible part of a condition variable. */ -struct __pthread_cond - { - __pthread_spinlock_t __lock; - struct __pthread *__queue; - struct __pthread_condattr *__attr; - struct __pthread_condimpl *__impl; - void *__data; - }; - -/* Initializer for a condition variable. */ -#define __PTHREAD_COND_INITIALIZER \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, NULL } - -#endif /* bits/condition.h */ diff --git a/libpthread/sysdeps/generic/bits/mutex-attr.h b/libpthread/sysdeps/generic/bits/mutex-attr.h deleted file mode 100644 index 8514ebe8..00000000 --- a/libpthread/sysdeps/generic/bits/mutex-attr.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Mutex attribute type. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_MUTEX_ATTR_H -#define _BITS_MUTEX_ATTR_H 1 - -enum __pthread_mutex_protocol; -enum __pthread_process_shared; -enum __pthread_mutex_type; - -/* This structure describes the attributes of a POSIX mutex - attribute. */ -struct __pthread_mutexattr -{ - int prioceiling; - enum __pthread_mutex_protocol protocol; - enum __pthread_process_shared pshared; - enum __pthread_mutex_type mutex_type; -}; - -/* Attributes for a recursive mutex. */ -extern const struct __pthread_mutexattr __pthread_errorcheck_mutexattr; -extern const struct __pthread_mutexattr __pthread_recursive_mutexattr; - -#endif /* bits/mutex-attr.h */ diff --git a/libpthread/sysdeps/generic/bits/mutex.h b/libpthread/sysdeps/generic/bits/mutex.h deleted file mode 100644 index c734c393..00000000 --- a/libpthread/sysdeps/generic/bits/mutex.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Mutex type. Generic version. - - Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. - - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_MUTEX_H - -#ifndef __need_pthread_mutex -# define _BITS_MUTEX_H 1 -#endif - -#ifndef __pthread_mutex_defined -# if defined __need_pthread_mutex || defined _BITS_MUTEX_H -# undef __need_pthread_mutex -# define __pthread_mutex_defined - -# include <bits/spin-lock.h> -# include <bits/mutex-attr.h> - -/* User visible part of a mutex. */ -struct __pthread_mutex - { - __pthread_spinlock_t __held; - __pthread_spinlock_t __lock; - /* In cthreads, mutex_init does not initialized thre third - pointer, as such, we cannot rely on its value for anything. */ - char *cthreadscompat1; - struct __pthread *__queue; - struct __pthread_mutexattr *attr; - void *data; - /* Up to this point, we are completely compatible with cthreads - and what libc expects. */ - void *owner; - unsigned locks; - /* If NULL then the default attributes apply. */ - }; - -/* Initializer for a mutex. N.B. this also happens to be compatible - with the cthread mutex initializer. */ -# define __PTHREAD_MUTEX_INITIALIZER \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0, 0 } - -# define __PTHREAD_ERRORCHECK_MUTEXATTR ((struct __pthread_mutexattr *) ((unsigned long) __PTHREAD_MUTEX_ERRORCHECK + 1)) - -# define __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, \ - __PTHREAD_ERRORCHECK_MUTEXATTR, 0, 0, 0 } - -# define __PTHREAD_RECURSIVE_MUTEXATTR ((struct __pthread_mutexattr *) ((unsigned long) __PTHREAD_MUTEX_RECURSIVE + 1)) - -# define __PTHREAD_RECURSIVE_MUTEX_INITIALIZER \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, \ - __PTHREAD_RECURSIVE_MUTEXATTR, 0, 0, 0 } - -# endif -#endif /* Not __pthread_mutex_defined. */ - -#endif /* bits/mutex.h */ diff --git a/libpthread/sysdeps/generic/bits/once.h b/libpthread/sysdeps/generic/bits/once.h deleted file mode 100644 index f4985d6f..00000000 --- a/libpthread/sysdeps/generic/bits/once.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Dynamic package initialization data structures. Generic version. - Copyright (C) 2002, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_ONCE_H -#define _BITS_ONCE_H 1 - -#include <bits/spin-lock.h> - -struct __pthread_once -{ - int run; - __pthread_spinlock_t lock; -}; - -#define __PTHREAD_ONCE_INIT \ - { 0, __PTHREAD_SPIN_LOCK_INITIALIZER } - -#endif /* bits/once.h */ diff --git a/libpthread/sysdeps/generic/bits/pthread-np.h b/libpthread/sysdeps/generic/bits/pthread-np.h deleted file mode 100644 index d5ddbb05..00000000 --- a/libpthread/sysdeps/generic/bits/pthread-np.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Non-portable functions. Generic version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_PTHREAD_NP_H -#define _BITS_PTHREAD_NP_H 1 - -#endif /* bits/pthread-np.h */ diff --git a/libpthread/sysdeps/generic/bits/pthread.h b/libpthread/sysdeps/generic/bits/pthread.h deleted file mode 100644 index 80e6b096..00000000 --- a/libpthread/sysdeps/generic/bits/pthread.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Pthread data structures. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_PTHREAD_H -#define _BITS_PTHREAD_H 1 - -typedef int __pthread_t; - -/* Return true if __T1 and __T2 both name the same thread. Otherwise, - false. */ -extern int -__pthread_equal (__pthread_t __t1, __pthread_t __t2); - -#ifdef __USE_EXTERN_INLINES -__extern_inline int -__pthread_equal (__pthread_t __t1, __pthread_t __t2) -{ - return __t1 == __t2; -} -#endif - -#endif /* bits/pthread.h */ diff --git a/libpthread/sysdeps/generic/bits/pthreadtypes.h b/libpthread/sysdeps/generic/bits/pthreadtypes.h deleted file mode 100644 index e5cbfd2a..00000000 --- a/libpthread/sysdeps/generic/bits/pthreadtypes.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if !defined _BITS_TYPES_H && !defined _PTHREAD_H -# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead." -#endif - -#ifndef _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#include <pthread.h> - -#endif /* bits/pthreadtypes.h */ diff --git a/libpthread/sysdeps/generic/bits/rwlock-attr.h b/libpthread/sysdeps/generic/bits/rwlock-attr.h deleted file mode 100644 index dba99f1d..00000000 --- a/libpthread/sysdeps/generic/bits/rwlock-attr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Thread rwlock attribute type. Generic version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_RWLOCK_ATTR_H -#define _BITS_RWLOCK_ATTR_H 1 - -enum __pthread_process_shared; - -/* This structure describes the attributes of a POSIX thread rwlock. - Note that not all of them are supported on all systems. */ -struct __pthread_rwlockattr -{ - enum __pthread_process_shared pshared; -}; - -#endif /* bits/rwlock-attr.h */ diff --git a/libpthread/sysdeps/generic/bits/rwlock.h b/libpthread/sysdeps/generic/bits/rwlock.h deleted file mode 100644 index af6b1c86..00000000 --- a/libpthread/sysdeps/generic/bits/rwlock.h +++ /dev/null @@ -1,46 +0,0 @@ -/* rwlock type. Generic version. - Copyright (C) 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_RWLOCK_H -#define _BITS_RWLOCK_H - -#include <bits/spin-lock.h> - -/* User visible part of a rwlock. If __held is not held and readers - is 0, then the lock is unlocked. If __held is held and readers is - 0, then the lock is held by a writer. If __held is held and - readers is greater than 0, then the lock is held by READERS - readers. */ -struct __pthread_rwlock - { - __pthread_spinlock_t __held; - __pthread_spinlock_t __lock; - int readers; - struct __pthread *readerqueue; - struct __pthread *writerqueue; - struct __pthread_rwlockattr *__attr; - void *__data; - }; - -/* Initializer for a rwlock. */ -#define __PTHREAD_RWLOCK_INITIALIZER \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, __PTHREAD_SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0 } - - -#endif /* bits/rwlock.h */ diff --git a/libpthread/sysdeps/generic/bits/semaphore.h b/libpthread/sysdeps/generic/bits/semaphore.h deleted file mode 100644 index 5e987c15..00000000 --- a/libpthread/sysdeps/generic/bits/semaphore.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Semaphore type. Generic version. - Copyright (C) 2005, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_SEMAPHORE_H -#define _BITS_SEMAPHORE_H 1 - -#ifndef _SEMAPHORE_H -#error Never include <bits/semaphore.h> directly. -#endif - -#include <pthread.h> - -/* User visible part of a semaphore. */ -struct __semaphore - { - __pthread_spinlock_t __lock; - struct __pthread *__queue; - int __pshared; - int __value; - void *__data; - }; - -/* Initializer for a semaphore. */ -#define __SEMAPHORE_INITIALIZER(pshared, value) \ - { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, (pshared), (value), NULL } - -#endif /* bits/mutex.h */ diff --git a/libpthread/sysdeps/generic/bits/thread-attr.h b/libpthread/sysdeps/generic/bits/thread-attr.h deleted file mode 100644 index f2e55f2b..00000000 --- a/libpthread/sysdeps/generic/bits/thread-attr.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Thread attribute type. Generic version. - Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_THREAD_ATTR_H -#define _BITS_THREAD_ATTR_H 1 - -#define __need_schedparam -#include <bits/sched.h> - -enum __pthread_detachstate; -enum __pthread_inheritsched; -enum __pthread_contentionscope; - -/* This structure describes the attributes of a POSIX thread. Note - that not all of them are supported on all systems. */ -struct __pthread_attr -{ - struct __sched_param schedparam; - void *stackaddr; - size_t stacksize; - size_t guardsize; - enum __pthread_detachstate detachstate; - enum __pthread_inheritsched inheritsched; - enum __pthread_contentionscope contentionscope; - int schedpolicy; -}; - -#endif /* bits/thread-attr.h */ diff --git a/libpthread/sysdeps/generic/bits/thread-specific.h b/libpthread/sysdeps/generic/bits/thread-specific.h deleted file mode 100644 index b42d99e7..00000000 --- a/libpthread/sysdeps/generic/bits/thread-specific.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Thread specific data. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_THREAD_SPECIFIC_H -#define _BITS_THREAD_SPECIFIC_H 1 - -typedef int __pthread_key; - -#endif /* bits/thread-specific.h */ diff --git a/libpthread/sysdeps/generic/killpg.c b/libpthread/sysdeps/generic/killpg.c deleted file mode 100644 index 7f7ed87d..00000000 --- a/libpthread/sysdeps/generic/killpg.c +++ /dev/null @@ -1,27 +0,0 @@ -/* killpg.c - Generic killpg implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -killpg (pid_t pid, int sig) -{ - return kill (-pid, sig); -} diff --git a/libpthread/sysdeps/generic/pt-atfork.c b/libpthread/sysdeps/generic/pt-atfork.c deleted file mode 100644 index 32e1e78c..00000000 --- a/libpthread/sysdeps/generic/pt-atfork.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Register fork handlers. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_atfork (void (*prepare) (void), - void (*parent) (void), - void (*child) (void)) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-attr-destroy.c b/libpthread/sysdeps/generic/pt-attr-destroy.c deleted file mode 100644 index c4b9aa54..00000000 --- a/libpthread/sysdeps/generic/pt-attr-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_attr_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_destroy (pthread_attr_t *attr) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getdetachstate.c b/libpthread/sysdeps/generic/pt-attr-getdetachstate.c deleted file mode 100644 index be406f1d..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getdetachstate.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getdetachstate. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getdetachstate (const pthread_attr_t *attr, - int *detachstate) -{ - *detachstate = attr->detachstate; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getguardsize.c b/libpthread/sysdeps/generic/pt-attr-getguardsize.c deleted file mode 100644 index c1d9f13e..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getguardsize.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getguardsize. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getguardsize (const pthread_attr_t *attr, - size_t *guardsize) -{ - *guardsize = attr->guardsize; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getinheritsched.c b/libpthread/sysdeps/generic/pt-attr-getinheritsched.c deleted file mode 100644 index cca4e3d7..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getinheritsched.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getinheritsched. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getinheritsched (const pthread_attr_t *attr, - int *inheritsched) -{ - *inheritsched = attr->inheritsched; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getschedparam.c b/libpthread/sysdeps/generic/pt-attr-getschedparam.c deleted file mode 100644 index 190cf9d0..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getschedparam.c +++ /dev/null @@ -1,32 +0,0 @@ -/* pthread_attr_getschedparam. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <sched.h> -#include <string.h> - -#include <pt-internal.h> - -int -pthread_attr_getschedparam (const pthread_attr_t *attr, - struct sched_param *param) -{ - memcpy (param, &attr->schedparam, sizeof *param); - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c b/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c deleted file mode 100644 index 4349a238..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getschedpolicy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getschedpolicy (const pthread_attr_t *attr, - int *policy) -{ - *policy = attr->schedpolicy; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getscope.c b/libpthread/sysdeps/generic/pt-attr-getscope.c deleted file mode 100644 index 97198fa5..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getscope.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getscope. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getscope (const pthread_attr_t *attr, - int *contentionscope) -{ - *contentionscope = attr->contentionscope; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getstack.c b/libpthread/sysdeps/generic/pt-attr-getstack.c deleted file mode 100644 index 7beb79f0..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getstack.c +++ /dev/null @@ -1,31 +0,0 @@ -/* pthread_attr_getstack. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getstack (const pthread_attr_t *attr, - void **stackaddr, - size_t *stacksize) -{ - pthread_attr_getstackaddr (attr, stackaddr); - pthread_attr_getstacksize (attr, stacksize); - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getstackaddr.c b/libpthread/sysdeps/generic/pt-attr-getstackaddr.c deleted file mode 100644 index d43eeff7..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getstackaddr.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getstackaddr. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getstackaddr (const pthread_attr_t *attr, - void **stackaddr) -{ - *stackaddr = attr->stackaddr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-getstacksize.c b/libpthread/sysdeps/generic/pt-attr-getstacksize.c deleted file mode 100644 index c1bc6617..00000000 --- a/libpthread/sysdeps/generic/pt-attr-getstacksize.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_getstacksize. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_getstacksize (const pthread_attr_t *attr, - size_t *stacksize) -{ - *stacksize = attr->stacksize; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-init.c b/libpthread/sysdeps/generic/pt-attr-init.c deleted file mode 100644 index 6a930e30..00000000 --- a/libpthread/sysdeps/generic/pt-attr-init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_attr_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_init (pthread_attr_t *attr) -{ - *attr = __pthread_default_attr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setdetachstate.c b/libpthread/sysdeps/generic/pt-attr-setdetachstate.c deleted file mode 100644 index 688ba5d6..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setdetachstate.c +++ /dev/null @@ -1,38 +0,0 @@ -/* pthread_attr_setdetachstate. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setdetachstate (pthread_attr_t *attr, - int detachstate) -{ - switch (detachstate) - { - case PTHREAD_CREATE_DETACHED: - case PTHREAD_CREATE_JOINABLE: - attr->detachstate = detachstate; - break; - default: - return EINVAL; - } - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setguardsize.c b/libpthread/sysdeps/generic/pt-attr-setguardsize.c deleted file mode 100644 index b2ba0f0f..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setguardsize.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_setguardsize. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setguardsize (pthread_attr_t *attr, - size_t guardsize) -{ - attr->guardsize = guardsize; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setinheritsched.c b/libpthread/sysdeps/generic/pt-attr-setinheritsched.c deleted file mode 100644 index e9012c58..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setinheritsched.c +++ /dev/null @@ -1,38 +0,0 @@ -/* pthread_attr_setinheritsched. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setinheritsched (pthread_attr_t *attr, - int inheritsched) -{ - switch (inheritsched) - { - case PTHREAD_INHERIT_SCHED: - case PTHREAD_EXPLICIT_SCHED: - attr->inheritsched = inheritsched; - break; - default: - return EINVAL; - } - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setschedparam.c b/libpthread/sysdeps/generic/pt-attr-setschedparam.c deleted file mode 100644 index 5459f108..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setschedparam.c +++ /dev/null @@ -1,38 +0,0 @@ -/* pthread_attr_getschedparam. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <sched.h> -#include <string.h> - -#include <pt-internal.h> - -int -pthread_attr_setschedparam (pthread_attr_t *attr, - const struct sched_param *param) -{ - if (memcmp (param, &__pthread_default_attr.schedparam, - sizeof *param) == 0) - { - memcpy (&attr->schedparam, param, sizeof *param); - return 0; - } - - return ENOTSUP; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c b/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c deleted file mode 100644 index e481d04c..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c +++ /dev/null @@ -1,42 +0,0 @@ -/* pthread_attr_getschedpolicy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setschedpolicy (pthread_attr_t *attr, - int policy) -{ - switch (policy) - { - case SCHED_OTHER: - attr->schedpolicy = policy; - break; - - case SCHED_FIFO: - case SCHED_RR: - return ENOTSUP; - - default: - return EINVAL; - } - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setscope.c b/libpthread/sysdeps/generic/pt-attr-setscope.c deleted file mode 100644 index c74a4f67..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setscope.c +++ /dev/null @@ -1,41 +0,0 @@ -/* pthread_attr_setscope. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setscope (pthread_attr_t *attr, - int contentionscope) -{ - if (contentionscope == __pthread_default_attr.contentionscope) - { - attr->contentionscope = contentionscope; - return 0; - } - - switch (contentionscope) - { - case PTHREAD_SCOPE_PROCESS: - case PTHREAD_SCOPE_SYSTEM: - return ENOTSUP; - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-attr-setstack.c b/libpthread/sysdeps/generic/pt-attr-setstack.c deleted file mode 100644 index 360d27a3..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setstack.c +++ /dev/null @@ -1,51 +0,0 @@ -/* pthread_attr_setstack. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -int -pthread_attr_setstack (pthread_attr_t *attr, - void *stackaddr, - size_t stacksize) -{ - int err; - size_t s; - - /* pthread_attr_setstack should always succeed, thus we set the size - first as it is more discriminating. */ - pthread_attr_getstacksize (attr, &s); - - err = pthread_attr_setstacksize (attr, stacksize); - if (err) - return err; - - err = pthread_attr_setstackaddr (attr, stackaddr); - if (err) - { - int e = pthread_attr_setstacksize (attr, s); - assert_perror (e); - - return err; - } - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setstackaddr.c b/libpthread/sysdeps/generic/pt-attr-setstackaddr.c deleted file mode 100644 index 431f2d0c..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setstackaddr.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_attr_setstackaddr. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr) -{ - attr->stackaddr = stackaddr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-attr-setstacksize.c b/libpthread/sysdeps/generic/pt-attr-setstacksize.c deleted file mode 100644 index d0e51022..00000000 --- a/libpthread/sysdeps/generic/pt-attr-setstacksize.c +++ /dev/null @@ -1,41 +0,0 @@ -/* pthread_attr_setstacksize. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize) -{ - if (stacksize == __pthread_default_attr.stacksize) - { - attr->stacksize = stacksize; - - /* The guard size cannot be larger than the stack itself, as - such, if the new stack size is smaller than the guard size, - we squash the guard size. */ - if (attr->guardsize > attr->stacksize) - attr->guardsize = attr->stacksize; - - return 0; - } - - return ENOTSUP; -} diff --git a/libpthread/sysdeps/generic/pt-attr.c b/libpthread/sysdeps/generic/pt-attr.c deleted file mode 100644 index 769f292a..00000000 --- a/libpthread/sysdeps/generic/pt-attr.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Default attributes. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <sched.h> -#include <stddef.h> -#include <limits.h> - -#include <pt-internal.h> - -const struct __pthread_attr __pthread_default_attr = -{ - schedparam: { sched_priority: 0 }, - stacksize: PTHREAD_STACK_DEFAULT, - stackaddr: NULL, -#ifdef PAGESIZE - guardsize: PAGESIZE, -#else - guardsize: 0, -#endif /* PAGESIZE */ - detachstate: PTHREAD_CREATE_JOINABLE, - inheritsched: PTHREAD_EXPLICIT_SCHED, - contentionscope: PTHREAD_SCOPE_SYSTEM, - schedpolicy: SCHED_OTHER -}; diff --git a/libpthread/sysdeps/generic/pt-barrier-destroy.c b/libpthread/sysdeps/generic/pt-barrier-destroy.c deleted file mode 100644 index 01b938b4..00000000 --- a/libpthread/sysdeps/generic/pt-barrier-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_barrier_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_barrier_destroy (pthread_barrier_t *barrier) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-barrier-init.c b/libpthread/sysdeps/generic/pt-barrier-init.c deleted file mode 100644 index c42b3bb6..00000000 --- a/libpthread/sysdeps/generic/pt-barrier-init.c +++ /dev/null @@ -1,53 +0,0 @@ -/* pthread_barrier_init. Generic version. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <string.h> -#include <assert.h> - -#include <pt-internal.h> - -int -pthread_barrier_init (pthread_barrier_t *barrier, - const pthread_barrierattr_t *attr, - unsigned count) -{ - if (count == 0) - return EINVAL; - - memset (barrier, 0, sizeof *barrier); - - barrier->lock = PTHREAD_SPINLOCK_INITIALIZER; - barrier->pending = count; - barrier->count = count; - - if (! attr - || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr) == 0)) - /* Use the default attributes. */ - return 0; - - /* Non-default attributes. */ - - barrier->attr = malloc (sizeof *attr); - if (! barrier->attr) - return ENOMEM; - - *barrier->attr = *attr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-barrier-wait.c b/libpthread/sysdeps/generic/pt-barrier-wait.c deleted file mode 100644 index f1de250a..00000000 --- a/libpthread/sysdeps/generic/pt-barrier-wait.c +++ /dev/null @@ -1,61 +0,0 @@ -/* pthread_barrier_wait. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -int -pthread_barrier_wait (pthread_barrier_t *barrier) -{ - __pthread_spin_lock (&barrier->lock); - if (-- barrier->pending == 0) - { - barrier->pending = barrier->count; - - if (barrier->count > 1) - { - struct __pthread *wakeup; - - wakeup = barrier->queue; - barrier->queue = NULL; - __pthread_spin_unlock (&barrier->lock); - - /* We can safely walk the list of waiting threads without - holding the lock since it is decoupled from the barrier - variable now. */ - __pthread_dequeuing_iterate (wakeup, wakeup) - __pthread_wakeup (wakeup); - } - - return PTHREAD_BARRIER_SERIAL_THREAD; - } - else - { - struct __pthread *self = _pthread_self (); - - /* Add ourselves to the list of waiters. */ - __pthread_enqueue (&barrier->queue, self); - __pthread_spin_unlock (&barrier->lock); - - __pthread_block (self); - return 0; - } -} diff --git a/libpthread/sysdeps/generic/pt-barrier.c b/libpthread/sysdeps/generic/pt-barrier.c deleted file mode 100644 index d772719f..00000000 --- a/libpthread/sysdeps/generic/pt-barrier.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Default barrier attributes. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -const struct __pthread_barrierattr __pthread_default_barrierattr = -{ - pshared: PTHREAD_PROCESS_PRIVATE -}; diff --git a/libpthread/sysdeps/generic/pt-barrierattr-destroy.c b/libpthread/sysdeps/generic/pt-barrierattr-destroy.c deleted file mode 100644 index eb396347..00000000 --- a/libpthread/sysdeps/generic/pt-barrierattr-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_barrierattr_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_barrierattr_destroy (pthread_barrierattr_t *attr) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c b/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c deleted file mode 100644 index ed2cdd24..00000000 --- a/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_barrierattr_getpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr, - int *pshared) -{ - *pshared = attr->pshared; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-barrierattr-init.c b/libpthread/sysdeps/generic/pt-barrierattr-init.c deleted file mode 100644 index 45f16cc8..00000000 --- a/libpthread/sysdeps/generic/pt-barrierattr-init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_barrierattr_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_barrierattr_init (pthread_barrierattr_t *attr) -{ - *attr = __pthread_default_barrierattr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c b/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c deleted file mode 100644 index 84ef2df8..00000000 --- a/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c +++ /dev/null @@ -1,39 +0,0 @@ -/* pthread_barrierattr_setpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, - int pshared) -{ - switch (pshared) - { - case PTHREAD_PROCESS_PRIVATE: - attr->pshared = pshared; - return 0; - - case PTHREAD_PROCESS_SHARED: - return ENOTSUP; - - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-cond-brdcast.c b/libpthread/sysdeps/generic/pt-cond-brdcast.c deleted file mode 100644 index 3f55e33e..00000000 --- a/libpthread/sysdeps/generic/pt-cond-brdcast.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Broadcast a condition. Generic version. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -/* Unblock all threads that are blocked on condition variable COND. */ -int -pthread_cond_broadcast (pthread_cond_t *cond) -{ - struct __pthread *wakeup; - - __pthread_spin_lock (&cond->__lock); - - wakeup = cond->__queue; - cond->__queue = NULL; - __pthread_spin_unlock (&cond->__lock); - - /* We can safely walk the list of waiting threads without holding - the lock since it is now decoupled from the condition. */ - __pthread_dequeuing_iterate (wakeup, wakeup) - __pthread_wakeup (wakeup); - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-cond-destroy.c b/libpthread/sysdeps/generic/pt-cond-destroy.c deleted file mode 100644 index eba47784..00000000 --- a/libpthread/sysdeps/generic/pt-cond-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_cond_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_cond_destroy (pthread_cond_t *cond) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-cond-init.c b/libpthread/sysdeps/generic/pt-cond-init.c deleted file mode 100644 index b9e9fb7a..00000000 --- a/libpthread/sysdeps/generic/pt-cond-init.c +++ /dev/null @@ -1,45 +0,0 @@ -/* pthread_cond_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> -#include <string.h> - -#include <pt-internal.h> - -int -pthread_cond_init (pthread_cond_t *cond, - const pthread_condattr_t *attr) -{ - *cond = (pthread_cond_t) __PTHREAD_COND_INITIALIZER; - - if (! attr - || memcmp (attr, &__pthread_default_condattr, sizeof (*attr) == 0)) - /* Use the default attributes. */ - return 0; - - /* Non-default attributes. */ - - cond->__attr = malloc (sizeof *attr); - if (! cond->__attr) - return ENOMEM; - - *cond->__attr = *attr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-cond-signal.c b/libpthread/sysdeps/generic/pt-cond-signal.c deleted file mode 100644 index c5e1bc1d..00000000 --- a/libpthread/sysdeps/generic/pt-cond-signal.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Signal a condition. Generic version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -static int -cond_signal (struct __pthread_cond *cond, int *unblocked) -{ - struct __pthread *wakeup; - - __pthread_spin_lock (&cond->__lock); - wakeup = cond->__queue; - if (wakeup) - __pthread_dequeue (wakeup); - __pthread_spin_unlock (&cond->__lock); - - if (wakeup) - { - /* We found a thread waiting for the condition to be signalled. - Wake it up! */ - __pthread_wakeup (wakeup); - *unblocked = 1; - } - - return 0; -} - -/* Unblock at least one of the threads that are blocked on condition - variable COND. */ -int -pthread_cond_signal (pthread_cond_t *cond) -{ - int unblocked = 0; - - return cond_signal (cond, &unblocked); -} diff --git a/libpthread/sysdeps/generic/pt-cond-timedwait.c b/libpthread/sysdeps/generic/pt-cond-timedwait.c deleted file mode 100644 index c10bdb30..00000000 --- a/libpthread/sysdeps/generic/pt-cond-timedwait.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Wait on a condition. Generic version. - Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime); - -int -pthread_cond_timedwait (pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime) -{ - return __pthread_cond_timedwait_internal (cond, mutex, abstime); -} - -/* Block on condition variable COND until ABSTIME. As a GNU - extension, if ABSTIME is NULL, then wait forever. MUTEX should be - held by the calling thread. On return, MUTEX will be held by the - calling thread. */ -int -__pthread_cond_timedwait_internal (pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime) -{ - error_t err; - int canceltype; - - void cleanup (void *arg) - { - struct __pthread *self = _pthread_self (); - - __pthread_spin_lock (&cond->__lock); - if (self->prevp) - __pthread_dequeue (self); - __pthread_spin_unlock (&cond->__lock); - - pthread_setcanceltype (canceltype, &canceltype); - __pthread_mutex_lock (mutex); - } - - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) - return EINVAL; - - struct __pthread *self = _pthread_self (); - - /* Add ourselves to the list of waiters. */ - __pthread_spin_lock (&cond->__lock); - __pthread_enqueue (&cond->__queue, self); - __pthread_spin_unlock (&cond->__lock); - - __pthread_mutex_unlock (mutex); - - /* Enter async cancelation mode. If cancelation is disabled, then - this does not change anything which is exactly what we want. */ - pthread_cleanup_push (cleanup, 0); - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &canceltype); - - if (abstime) - { - err = __pthread_timedblock (self, abstime); - if (err) - /* We timed out. We may need to disconnect ourself from the - waiter queue. - - FIXME: What do we do if we get a wakeup message before we - disconnect ourself? It may remain until the next time we - block. */ - { - assert (err == ETIMEDOUT); - - __pthread_spin_lock (&mutex->__lock); - if (self->prevp) - __pthread_dequeue (self); - __pthread_spin_unlock (&mutex->__lock); - } - } - else - { - err = 0; - __pthread_block (self); - } - - pthread_cleanup_pop (1); - - return err; -} diff --git a/libpthread/sysdeps/generic/pt-cond-wait.c b/libpthread/sysdeps/generic/pt-cond-wait.c deleted file mode 100644 index a03476df..00000000 --- a/libpthread/sysdeps/generic/pt-cond-wait.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Wait on a condition. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -/* Implemented in pt-cond-timedwait.c. */ -extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime); - - -/* Block on condition variable COND. MUTEX should be held by the - calling thread. On return, MUTEX will be held by the calling - thread. */ -int -pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) -{ - return __pthread_cond_timedwait_internal (cond, mutex, 0); -} diff --git a/libpthread/sysdeps/generic/pt-cond.c b/libpthread/sysdeps/generic/pt-cond.c deleted file mode 100644 index 033e767f..00000000 --- a/libpthread/sysdeps/generic/pt-cond.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Default condition attributes. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <time.h> - -#include <pt-internal.h> - -const struct __pthread_condattr __pthread_default_condattr = -{ - pshared: PTHREAD_PROCESS_PRIVATE, - clock: CLOCK_REALTIME -}; diff --git a/libpthread/sysdeps/generic/pt-condattr-destroy.c b/libpthread/sysdeps/generic/pt-condattr-destroy.c deleted file mode 100644 index c8fd71b9..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_condattr_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_condattr_destroy (pthread_condattr_t *cond) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-condattr-getclock.c b/libpthread/sysdeps/generic/pt-condattr-getclock.c deleted file mode 100644 index 5b9f8893..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-getclock.c +++ /dev/null @@ -1,31 +0,0 @@ -/* pthread_condattr_getclock. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <time.h> - -#include <pt-internal.h> - -int -pthread_condattr_getclock (const pthread_condattr_t *attr, - clockid_t *clock) -{ - *clock = attr->clock; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-condattr-getpshared.c b/libpthread/sysdeps/generic/pt-condattr-getpshared.c deleted file mode 100644 index c072a507..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-getpshared.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_condattr_getpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_condattr_getpshared (const pthread_condattr_t *attr, - int *pshared) -{ - *pshared = attr->pshared; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-condattr-init.c b/libpthread/sysdeps/generic/pt-condattr-init.c deleted file mode 100644 index cf9e1989..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_condattr_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_condattr_init (pthread_condattr_t *attr) -{ - *attr = __pthread_default_condattr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-condattr-setclock.c b/libpthread/sysdeps/generic/pt-condattr-setclock.c deleted file mode 100644 index 984c17e2..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-setclock.c +++ /dev/null @@ -1,33 +0,0 @@ -/* pthread_condattr_setclock. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock) -{ - if (__pthread_default_condattr.clock == clock) - { - attr->clock = clock; - return 0; - } - - return EINVAL; -} diff --git a/libpthread/sysdeps/generic/pt-condattr-setpshared.c b/libpthread/sysdeps/generic/pt-condattr-setpshared.c deleted file mode 100644 index b9f0af83..00000000 --- a/libpthread/sysdeps/generic/pt-condattr-setpshared.c +++ /dev/null @@ -1,39 +0,0 @@ -/* pthread_condattr_setpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_condattr_setpshared (pthread_condattr_t *attr, - int pshared) -{ - switch (pshared) - { - case PTHREAD_PROCESS_PRIVATE: - attr->pshared = pshared; - return 0; - - case PTHREAD_PROCESS_SHARED: - return ENOTSUP; - - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-destroy-specific.c b/libpthread/sysdeps/generic/pt-destroy-specific.c deleted file mode 100644 index b627f872..00000000 --- a/libpthread/sysdeps/generic/pt-destroy-specific.c +++ /dev/null @@ -1,28 +0,0 @@ -/* __pthread_destory_specific. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -void -__pthread_destory_specifc (struct __pthread *thread) -{ - /* Not support, thus there cannot be any. */ - return; -} diff --git a/libpthread/sysdeps/generic/pt-equal.c b/libpthread/sysdeps/generic/pt-equal.c deleted file mode 100644 index 8fbc519c..00000000 --- a/libpthread/sysdeps/generic/pt-equal.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Default attributes. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -/* Return true if __T1 and __T2 both name the same thread. Otherwise, - false. */ -int -pthread_equal (pthread_t __t1, pthread_t __t2) -{ - return __t1 == __t2; -} diff --git a/libpthread/sysdeps/generic/pt-getconcurrency.c b/libpthread/sysdeps/generic/pt-getconcurrency.c deleted file mode 100644 index b55c8eef..00000000 --- a/libpthread/sysdeps/generic/pt-getconcurrency.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Get the current level of desired concurrency. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_getconcurrency (void) -{ - return __pthread_concurrency; -} diff --git a/libpthread/sysdeps/generic/pt-getcpuclockid.c b/libpthread/sysdeps/generic/pt-getcpuclockid.c deleted file mode 100644 index 81f6aabd..00000000 --- a/libpthread/sysdeps/generic/pt-getcpuclockid.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Return a thread's cpu clockid. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <time.h> - -#include <pt-internal.h> - -int -pthread_getcpuclockid (pthread_t thread, clockid_t *clock) -{ -#ifdef CLOCK_THREAD_CPUTIME_ID - *clock = CLOCK_THREAD_CPUTIME_ID; - return 0; -#else - return ENOSYS; -#endif -} diff --git a/libpthread/sysdeps/generic/pt-getschedparam.c b/libpthread/sysdeps/generic/pt-getschedparam.c deleted file mode 100644 index c128d02e..00000000 --- a/libpthread/sysdeps/generic/pt-getschedparam.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Get the scheduling parameters for a thread. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_getschedparam (pthread_t thread, int *policy, - struct sched_param *param) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-getspecific.c b/libpthread/sysdeps/generic/pt-getspecific.c deleted file mode 100644 index 2a7c4a9e..00000000 --- a/libpthread/sysdeps/generic/pt-getspecific.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_getspecific. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_getspecific (pthread_key_t key) -{ - return EINVAL; -} diff --git a/libpthread/sysdeps/generic/pt-init-specific.c b/libpthread/sysdeps/generic/pt-init-specific.c deleted file mode 100644 index 00744fb6..00000000 --- a/libpthread/sysdeps/generic/pt-init-specific.c +++ /dev/null @@ -1,27 +0,0 @@ -/* __pthread_init_specific. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -error_t -__pthread_init_specific (struct __pthread *thread) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-key-create.c b/libpthread/sysdeps/generic/pt-key-create.c deleted file mode 100644 index 7ef4b991..00000000 --- a/libpthread/sysdeps/generic/pt-key-create.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_key_create. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-key-delete.c b/libpthread/sysdeps/generic/pt-key-delete.c deleted file mode 100644 index 6c86f8e2..00000000 --- a/libpthread/sysdeps/generic/pt-key-delete.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_key_delete. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_key_delete (pthread_key_t key) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-key.h b/libpthread/sysdeps/generic/pt-key.h deleted file mode 100644 index 544eb20f..00000000 --- a/libpthread/sysdeps/generic/pt-key.h +++ /dev/null @@ -1,22 +0,0 @@ -/* pthread_key internal declatations. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#define PTHREAD_KEY_MEMBERS diff --git a/libpthread/sysdeps/generic/pt-kill.c b/libpthread/sysdeps/generic/pt-kill.c deleted file mode 100644 index 0dfac344..00000000 --- a/libpthread/sysdeps/generic/pt-kill.c +++ /dev/null @@ -1,32 +0,0 @@ -/* pthread-kill.c - Generic pthread-kill implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -pthread_kill (pthread_t tid, int signo) -{ - siginfo_t si; - memset (&si, 0, sizeof (si)); - si.si_signo = signo; - - return pthread_kill_siginfo_np (tid, si); -} - diff --git a/libpthread/sysdeps/generic/pt-mutex-destroy.c b/libpthread/sysdeps/generic/pt-mutex-destroy.c deleted file mode 100644 index 3bbc73fe..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-destroy.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Destroy a mutex. Generic version. - Copyright (C) 2000, 2002, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <stdlib.h> -#include <assert.h> - -#include <pt-internal.h> - -int -_pthread_mutex_destroy (pthread_mutex_t *mutex) -{ - if (mutex->attr == __PTHREAD_ERRORCHECK_MUTEXATTR - || mutex->attr == __PTHREAD_RECURSIVE_MUTEXATTR) - /* Static attributes. */ - ; - else - free (mutex->attr); - - return 0; -} - -strong_alias (_pthread_mutex_destroy, pthread_mutex_destroy); diff --git a/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c b/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c deleted file mode 100644 index eb51639b..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Get a mutex' priority ceiling. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, - int *prioceiling) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-mutex-init.c b/libpthread/sysdeps/generic/pt-mutex-init.c deleted file mode 100644 index 2f960286..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-init.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Initialize a mutex. Generic version. - Copyright (C) 2000, 2002, 2005, 2006, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <string.h> -#include <stdlib.h> -#include <assert.h> - -#include <pt-internal.h> - -int -_pthread_mutex_init (pthread_mutex_t *mutex, - const pthread_mutexattr_t *attr) -{ - *mutex = (pthread_mutex_t) __PTHREAD_MUTEX_INITIALIZER; - - if (! attr - || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr) == 0)) - /* The default attributes. */ - return 0; - - if (! mutex->attr - || mutex->attr == __PTHREAD_ERRORCHECK_MUTEXATTR - || mutex->attr == __PTHREAD_RECURSIVE_MUTEXATTR) - mutex->attr = malloc (sizeof *attr); - - if (! mutex->attr) - return ENOMEM; - - *mutex->attr = *attr; - return 0; -} - -strong_alias (_pthread_mutex_init, pthread_mutex_init); diff --git a/libpthread/sysdeps/generic/pt-mutex-lock.c b/libpthread/sysdeps/generic/pt-mutex-lock.c deleted file mode 100644 index 528e593f..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-lock.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Lock a mutex. Generic version. - Copyright (C) 2000, 2002, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Implemented in pt-mutex-timedlock.c. */ -extern int __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, - const struct timespec *abstime); - -/* Lock MUTEX, block if we can't get it. */ -int -__pthread_mutex_lock (struct __pthread_mutex *mutex) -{ - return __pthread_mutex_timedlock_internal (mutex, 0); -} - -strong_alias (__pthread_mutex_lock, _pthread_mutex_lock); -strong_alias (__pthread_mutex_lock, pthread_mutex_lock); diff --git a/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c b/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c deleted file mode 100644 index 9fa8e50d..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Set a mutex' priority ceiling. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio, - int *oldprio) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-mutex-timedlock.c b/libpthread/sysdeps/generic/pt-mutex-timedlock.c deleted file mode 100644 index 883e50af..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-timedlock.c +++ /dev/null @@ -1,187 +0,0 @@ -/* Lock a mutex with a timeout. Generic version. - Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -#define LOSE do { * (int *) 0 = 0; } while (1) - -/* Try to lock MUTEX, block until *ABSTIME if it is already held. As - a GNU extension, if TIMESPEC is NULL then wait forever. */ -int -__pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, - const struct timespec *abstime) -{ - struct __pthread *self; - const struct __pthread_mutexattr *attr = mutex->attr; - - if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR) - attr = &__pthread_errorcheck_mutexattr; - if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) - attr = &__pthread_recursive_mutexattr; - - __pthread_spin_lock (&mutex->__lock); - if (__pthread_spin_trylock (&mutex->__held) == 0) - /* Successfully acquired the lock. */ - { -#ifdef ALWAYS_TRACK_MUTEX_OWNER -#ifndef NDEBUG - self = _pthread_self (); - if (self) - /* The main thread may take a lock before the library is fully - initialized, in particular, before the main thread has a - TCB. */ - { - assert (! mutex->owner); - mutex->owner = _pthread_self (); - } -#endif -#endif - - if (attr) - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_RECURSIVE: - mutex->locks = 1; - case PTHREAD_MUTEX_ERRORCHECK: - mutex->owner = _pthread_self (); - break; - - default: - LOSE; - } - - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - - /* The lock is busy. */ - - self = _pthread_self (); - assert (self); - - if (! attr || attr->mutex_type == PTHREAD_MUTEX_NORMAL) - { -#if defined(ALWAYS_TRACK_MUTEX_OWNER) - assert (mutex->owner != self); -#endif - } - else - { - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_ERRORCHECK: - if (mutex->owner == self) - { - __pthread_spin_unlock (&mutex->__lock); - return EDEADLK; - } - break; - - case PTHREAD_MUTEX_RECURSIVE: - if (mutex->owner == self) - { - mutex->locks ++; - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - break; - - default: - LOSE; - } - } - -#if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->mutex_type != PTHREAD_MUTEX_NORMAL) -#endif - assert (mutex->owner); - - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) - return EINVAL; - - /* Add ourselves to the queue. */ - __pthread_enqueue (&mutex->__queue, self); - __pthread_spin_unlock (&mutex->__lock); - - /* Block the thread. */ - if (abstime) - { - error_t err; - - err = __pthread_timedblock (self, abstime); - if (err) - /* We timed out. We may need to disconnect ourself from the - waiter queue. - - FIXME: What do we do if we get a wakeup message before we - disconnect ourself? It may remain until the next time we - block. */ - { - assert (err == ETIMEDOUT); - - __pthread_spin_lock (&mutex->__lock); - if (self->prevp) - __pthread_dequeue (self); - __pthread_spin_unlock (&mutex->__lock); - - return err; - } - } - else - __pthread_block (self); - -#if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->mutex_type != PTHREAD_MUTEX_NORMAL) -#endif - { - assert (mutex->owner == self); - } - - if (attr) - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_RECURSIVE: - assert (mutex->locks == 0); - mutex->locks = 1; - case PTHREAD_MUTEX_ERRORCHECK: - mutex->owner = self; - break; - - default: - LOSE; - } - - return 0; -} - -int -pthread_mutex_timedlock (struct __pthread_mutex *mutex, - const struct timespec *abstime) -{ - return __pthread_mutex_timedlock_internal (mutex, abstime); -} diff --git a/libpthread/sysdeps/generic/pt-mutex-transfer-np.c b/libpthread/sysdeps/generic/pt-mutex-transfer-np.c deleted file mode 100644 index 967f1c7c..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-transfer-np.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Transfer ownership of a mutex. Generic version. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -int -__pthread_mutex_transfer_np (struct __pthread_mutex *mutex, pthread_t tid) -{ - assert (mutex->owner == _pthread_self ()); - - struct __pthread *thread = __pthread_getid (tid); - const struct __pthread_mutexattr *attr = mutex->attr; - - if (! thread) - return ESRCH; - - if (thread == _pthread_self ()) - return 0; - - if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR) - attr = &__pthread_errorcheck_mutexattr; - if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) - attr = &__pthread_recursive_mutexattr; - - if (attr && attr->mutex_type == PTHREAD_MUTEX_ERRORCHECK) - { - - if (mutex->owner != _pthread_self ()) - return EPERM; - - mutex->owner = thread; - } - -#ifndef NDEBUG -# if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->mutex_type != PTHREAD_MUTEX_NORMAL) -# endif - { - mutex->owner = thread; - } -#endif - - return 0; -} - -strong_alias (__pthread_mutex_transfer_np, pthread_mutex_transfer_np) diff --git a/libpthread/sysdeps/generic/pt-mutex-trylock.c b/libpthread/sysdeps/generic/pt-mutex-trylock.c deleted file mode 100644 index 7a54cc9a..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-trylock.c +++ /dev/null @@ -1,112 +0,0 @@ -/* Try to Lock a mutex. Generic version. - Copyright (C) 2002, 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -#define LOSE do { * (int *) 0 = 0; } while (1) - -/* Lock MUTEX, return EBUSY if we can't get it. */ -int -__pthread_mutex_trylock (struct __pthread_mutex *mutex) -{ - int err; - struct __pthread *self; - const struct __pthread_mutexattr *attr = mutex->attr; - - if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR) - attr = &__pthread_errorcheck_mutexattr; - if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) - attr = &__pthread_recursive_mutexattr; - - __pthread_spin_lock (&mutex->__lock); - if (__pthread_spin_trylock (&mutex->__held) == 0) - /* Acquired the lock. */ - { -#if defined(ALWAYS_TRACK_MUTEX_OWNER) -#ifndef NDEBUG - self = _pthread_self (); - if (self) - /* The main thread may take a lock before the library is fully - initialized, in particular, before the main thread has a - TCB. */ - { - assert (! mutex->owner); - mutex->owner = _pthread_self (); - } -#endif -#endif - - if (attr) - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_RECURSIVE: - mutex->locks = 1; - case PTHREAD_MUTEX_ERRORCHECK: - mutex->owner = _pthread_self (); - break; - - default: - LOSE; - } - - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - - err = EBUSY; - - if (attr) - { - self = _pthread_self (); - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_ERRORCHECK: - /* We could check if MUTEX->OWNER is SELF, however, POSIX - does not permit pthread_mutex_trylock to return EDEADLK - instead of EBUSY, only pthread_mutex_lock. */ - break; - - case PTHREAD_MUTEX_RECURSIVE: - if (mutex->owner == self) - { - mutex->locks ++; - err = 0; - } - break; - - default: - LOSE; - } - } - - __pthread_spin_unlock (&mutex->__lock); - - return err; -} - -strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock); -strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock); diff --git a/libpthread/sysdeps/generic/pt-mutex-unlock.c b/libpthread/sysdeps/generic/pt-mutex-unlock.c deleted file mode 100644 index 09d70f8f..00000000 --- a/libpthread/sysdeps/generic/pt-mutex-unlock.c +++ /dev/null @@ -1,108 +0,0 @@ -/* Unlock a mutex. Generic version. - Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -#define LOSE do { * (int *) 0 = 0; } while (1) - -/* Unlock MUTEX, rescheduling a waiting thread. */ -int -__pthread_mutex_unlock (pthread_mutex_t *mutex) -{ - struct __pthread *wakeup; - const struct __pthread_mutexattr *attr = mutex->attr; - - if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR) - attr = &__pthread_errorcheck_mutexattr; - if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) - attr = &__pthread_recursive_mutexattr; - - __pthread_spin_lock (&mutex->__lock); - - if (! attr || attr->mutex_type == PTHREAD_MUTEX_NORMAL) - { -#if defined(ALWAYS_TRACK_MUTEX_OWNER) -# ifndef NDEBUG - if (_pthread_self ()) - { - assert (mutex->owner); - assert (mutex->owner == _pthread_self ()); - mutex->owner = NULL; - } -# endif -#endif - } - else - switch (attr->mutex_type) - { - case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_RECURSIVE: - if (mutex->owner != _pthread_self ()) - { - __pthread_spin_unlock (&mutex->__lock); - return EPERM; - } - - if (attr->mutex_type == PTHREAD_MUTEX_RECURSIVE) - if (--mutex->locks > 0) - { - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - - mutex->owner = 0; - break; - - default: - LOSE; - } - - - if (mutex->__queue == NULL) - { - __pthread_spin_unlock (&mutex->__held); - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - - wakeup = mutex->__queue; - __pthread_dequeue (wakeup); - -#ifndef NDEBUG -# if !defined (ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->mutex_type != PTHREAD_MUTEX_NORMAL) -# endif - { - mutex->owner = wakeup; - } -#endif - - /* We do not unlock MUTEX->held: we are transferring the ownership - to the thread that we are waking up. */ - - __pthread_spin_unlock (&mutex->__lock); - __pthread_wakeup (wakeup); - - return 0; -} - -strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock); -strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock); diff --git a/libpthread/sysdeps/generic/pt-mutexattr-destroy.c b/libpthread/sysdeps/generic/pt-mutexattr-destroy.c deleted file mode 100644 index fe7e95d2..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_mutexattr_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_destroy (pthread_mutexattr_t *attr) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c b/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c deleted file mode 100644 index d03d7192..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_mutexattr_getprioceiling. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, - int *prioceiling) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c b/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c deleted file mode 100644 index d75021a3..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_mutexattr_getprotocol. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, - int *protocol) -{ - *protocol = attr->protocol; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c b/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c deleted file mode 100644 index 0dad13b8..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_mutexattr_getpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, - int *pshared) -{ - *pshared = attr->pshared; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-gettype.c b/libpthread/sysdeps/generic/pt-mutexattr-gettype.c deleted file mode 100644 index ff2caea4..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-gettype.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_mutexattr_gettype. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type) -{ - *type = attr->mutex_type; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-init.c b/libpthread/sysdeps/generic/pt-mutexattr-init.c deleted file mode 100644 index 2f23673c..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_mutexattr_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_init (pthread_mutexattr_t *attr) -{ - *attr = __pthread_default_mutexattr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c b/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c deleted file mode 100644 index a9bbd327..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_mutexattr_setprioceiling. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, - int prioceiling) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c b/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c deleted file mode 100644 index 9a0d1b1f..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c +++ /dev/null @@ -1,42 +0,0 @@ -/* pthread_mutexattr_setprotocol. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, - int protocol) -{ - if (protocol == __pthread_default_mutexattr.protocol) - { - attr->protocol = protocol; - return 0; - } - - switch (protocol) - { - case PTHREAD_PRIO_NONE: - case PTHREAD_PRIO_INHERIT: - case PTHREAD_PRIO_PROTECT: - return ENOTSUP; - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c b/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c deleted file mode 100644 index bcbc4d91..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c +++ /dev/null @@ -1,39 +0,0 @@ -/* pthread_mutexattr_setpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, - int pshared) -{ - switch (pshared) - { - case PTHREAD_PROCESS_PRIVATE: - attr->pshared = pshared; - return 0; - - case PTHREAD_PROCESS_SHARED: - return ENOTSUP; - - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr-settype.c b/libpthread/sysdeps/generic/pt-mutexattr-settype.c deleted file mode 100644 index e7ae213a..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr-settype.c +++ /dev/null @@ -1,37 +0,0 @@ -/* pthread_mutexattr_settype. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type) -{ - switch (type) - { - case PTHREAD_MUTEX_NORMAL: - case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_RECURSIVE: - attr->mutex_type = type; - return 0; - - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-mutexattr.c b/libpthread/sysdeps/generic/pt-mutexattr.c deleted file mode 100644 index 5ebde6ea..00000000 --- a/libpthread/sysdeps/generic/pt-mutexattr.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Default mutex attributes. Generic version. - Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -const struct __pthread_mutexattr __pthread_default_mutexattr = -{ - prioceiling: 0, - protocol: PTHREAD_PRIO_NONE, - pshared: PTHREAD_PROCESS_PRIVATE, - mutex_type: PTHREAD_MUTEX_DEFAULT -}; - -const struct __pthread_mutexattr __pthread_errorcheck_mutexattr = -{ - prioceiling: 0, - protocol: PTHREAD_PRIO_NONE, - pshared: PTHREAD_PROCESS_PRIVATE, - mutex_type: PTHREAD_MUTEX_ERRORCHECK -}; - -const struct __pthread_mutexattr __pthread_recursive_mutexattr = -{ - prioceiling: 0, - protocol: PTHREAD_PRIO_NONE, - pshared: PTHREAD_PROCESS_PRIVATE, - mutex_type: PTHREAD_MUTEX_RECURSIVE -}; diff --git a/libpthread/sysdeps/generic/pt-once.c b/libpthread/sysdeps/generic/pt-once.c deleted file mode 100644 index 5be5e484..00000000 --- a/libpthread/sysdeps/generic/pt-once.c +++ /dev/null @@ -1,43 +0,0 @@ -/* pthread_once. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <bits/memory.h> - -#include <pt-internal.h> - -int -pthread_once (pthread_once_t *once_control, void (*init_routine) (void)) -{ - if (once_control->run == 0) - { - __pthread_spin_lock (&once_control->lock); - - if (once_control->run == 0) - { - init_routine (); - __memory_barrier (); - once_control->run = 1; - } - - __pthread_spin_unlock (&once_control->lock); - } - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-attr.c b/libpthread/sysdeps/generic/pt-rwlock-attr.c deleted file mode 100644 index 1587feef..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-attr.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Default rwlock attributes. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -const struct __pthread_rwlockattr __pthread_default_rwlockattr = -{ - pshared: PTHREAD_PROCESS_PRIVATE -}; diff --git a/libpthread/sysdeps/generic/pt-rwlock-destroy.c b/libpthread/sysdeps/generic/pt-rwlock-destroy.c deleted file mode 100644 index 045eebd8..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-destroy.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Destroy a rwlock. Generic version. - Copyright (C) 2002, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -_pthread_rwlock_destroy (pthread_rwlock_t *rwlock) -{ - return 0; -} - -strong_alias (_pthread_rwlock_destroy, pthread_rwlock_destroy); diff --git a/libpthread/sysdeps/generic/pt-rwlock-init.c b/libpthread/sysdeps/generic/pt-rwlock-init.c deleted file mode 100644 index c9ff9b28..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-init.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Initialize a rwlock. Generic version. - Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <string.h> -#include <pt-internal.h> - -int -_pthread_rwlock_init (pthread_rwlock_t *rwlock, - const pthread_rwlockattr_t *attr) -{ - *rwlock = (pthread_rwlock_t) __PTHREAD_RWLOCK_INITIALIZER; - - if (! attr - || memcmp (attr, &__pthread_default_rwlockattr, sizeof (*attr) == 0)) - /* Use the default attributes. */ - return 0; - - /* Non-default attributes. */ - - rwlock->__attr = malloc (sizeof *attr); - if (! rwlock->__attr) - return ENOMEM; - - *rwlock->__attr = *attr; - return 0; -} - -strong_alias (_pthread_rwlock_init, pthread_rwlock_init); diff --git a/libpthread/sysdeps/generic/pt-rwlock-rdlock.c b/libpthread/sysdeps/generic/pt-rwlock-rdlock.c deleted file mode 100644 index 480cf489..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-rdlock.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Acquire a rwlock for reading. Generic version. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -/* Implemented in pt-rwlock-timedrdlock.c. */ -extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime); - -/* Acquire RWLOCK for reading, block if we can't get it. */ -int -pthread_rwlock_rdlock (struct __pthread_rwlock *rwlock) -{ - return __pthread_rwlock_timedrdlock_internal (rwlock, 0); -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c b/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c deleted file mode 100644 index ba610fa5..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Acquire a rwlock for reading. Generic version. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if - it is already held. As a GNU extension, if TIMESPEC is NULL then - wait forever. */ -int -__pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) -{ - struct __pthread *self; - - __pthread_spin_lock (&rwlock->__lock); - if (__pthread_spin_trylock (&rwlock->__held) == 0) - /* Successfully acquired the lock. */ - { - assert (rwlock->readerqueue == 0); - assert (rwlock->writerqueue == 0); - assert (rwlock->readers == 0); - - rwlock->readers = 1; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - else - /* Lock is held, but is held by a reader? */ - if (rwlock->readers > 0) - /* Just add ourself to number of readers. */ - { - assert (rwlock->readerqueue == 0); - rwlock->readers ++; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - - /* The lock is busy. */ - - /* Better be blocked by a writer. */ - assert (rwlock->readers == 0); - - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) - return EINVAL; - - self = _pthread_self (); - - /* Add ourself to the queue. */ - __pthread_enqueue (&rwlock->readerqueue, self); - __pthread_spin_unlock (&rwlock->__lock); - - /* Block the thread. */ - if (abstime) - { - error_t err; - - err = __pthread_timedblock (self, abstime); - if (err) - /* We timed out. We may need to disconnect ourself from the - waiter queue. - - FIXME: What do we do if we get a wakeup message before we - disconnect ourself? It may remain until the next time we - block. */ - { - assert (err == ETIMEDOUT); - - __pthread_spin_lock (&rwlock->__lock); - if (self->prevp) - /* Disconnect ourself. */ - __pthread_dequeue (self); - __pthread_spin_unlock (&rwlock->__lock); - - return err; - } - } - else - __pthread_block (self); - - - /* The reader count has already been increment by whoever woke us - up. */ - - assert (rwlock->readers > 0); - - return 0; -} - -int -pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) -{ - return __pthread_rwlock_timedrdlock_internal (rwlock, abstime); -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c b/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c deleted file mode 100644 index 04eab51f..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Acquire a rwlock for writing. Generic version. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get - it. As a special GNU extension, if ABSTIME is NULL then the wait - shall not time out. */ -int -__pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) -{ - struct __pthread *self; - - __pthread_spin_lock (&rwlock->__lock); - if (__pthread_spin_trylock (&rwlock->__held) == 0) - /* Successfully acquired the lock. */ - { - assert (rwlock->readerqueue == 0); - assert (rwlock->writerqueue == 0); - assert (rwlock->readers == 0); - - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - - /* The lock is busy. */ - - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) - return EINVAL; - - self = _pthread_self (); - - /* Add ourselves to the queue. */ - __pthread_enqueue (&rwlock->writerqueue, self); - __pthread_spin_unlock (&rwlock->__lock); - - /* Block the thread. */ - if (abstime) - { - error_t err; - - err = __pthread_timedblock (self, abstime); - if (err) - /* We timed out. We may need to disconnect ourself from the - waiter queue. - - FIXME: What do we do if we get a wakeup message before we - disconnect ourself? It may remain until the next time we - block. */ - { - assert (err == ETIMEDOUT); - - __pthread_spin_lock (&rwlock->__lock); - if (self->prevp) - /* Disconnect ourself. */ - __pthread_dequeue (self); - __pthread_spin_unlock (&rwlock->__lock); - - return err; - } - } - else - __pthread_block (self); - - assert (rwlock->readers == 0); - - return 0; -} - -int -pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) -{ - return __pthread_rwlock_timedwrlock_internal (rwlock, abstime); -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c b/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c deleted file mode 100644 index 2419efb1..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Try to acquire a rwlock for reading. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Try to acquire RWLOCK. */ -int -pthread_rwlock_tryrdlock (struct __pthread_rwlock *rwlock) -{ - __pthread_spin_lock (&rwlock->__lock); - if (__pthread_spin_trylock (&rwlock->__held) == 0) - /* Successfully acquired the lock. */ - { - assert (rwlock->readerqueue == 0); - assert (rwlock->writerqueue == 0); - assert (rwlock->readers == 0); - - rwlock->readers = 1; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - else - /* Lock is held, but is held by a reader? */ - if (rwlock->readers > 0) - { - assert (rwlock->readerqueue == 0); - rwlock->readers ++; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - - /* The lock is busy. */ - - __pthread_spin_unlock (&rwlock->__lock); - - return EBUSY; -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c b/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c deleted file mode 100644 index 6b9c5b56..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Try to acquire a rwlock for writing. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Try to acquire RWLOCK for writing. */ -int -pthread_rwlock_trywrlock (struct __pthread_rwlock *rwlock) -{ - __pthread_spin_lock (&rwlock->__lock); - if (__pthread_spin_trylock (&rwlock->__held) == 0) - /* Successfully acquired the lock. */ - { - assert (rwlock->readerqueue == 0); - assert (rwlock->writerqueue == 0); - assert (rwlock->readers == 0); - - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - - /* The lock is busy. */ - - __pthread_spin_unlock (&rwlock->__lock); - - return EBUSY; -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-unlock.c b/libpthread/sysdeps/generic/pt-rwlock-unlock.c deleted file mode 100644 index fb23a0b9..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-unlock.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Unlock a rwlock. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -/* Unlock *RWLOCK, rescheduling a waiting writer thread or, if there - are no threads waiting for a write lock, rescheduling the reader - threads. */ -int -pthread_rwlock_unlock (pthread_rwlock_t *rwlock) -{ - struct __pthread *wakeup; - - __pthread_spin_lock (&rwlock->__lock); - - assert (__pthread_spin_trylock (&rwlock->__held) == EBUSY); - - if (rwlock->readers > 1) - /* There are other readers. */ - { - rwlock->readers --; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } - - if (rwlock->readers == 1) - /* Last reader. */ - rwlock->readers = 0; - - - /* Wake someone else up. Try the writer queue first, then the - reader queue if that is empty. */ - - if (rwlock->writerqueue) - { - wakeup = rwlock->writerqueue; - __pthread_dequeue (wakeup); - - /* We do not unlock RWLOCK->held: we are transferring the ownership - to the thread that we are waking up. */ - - __pthread_spin_unlock (&rwlock->__lock); - __pthread_wakeup (wakeup); - - return 0; - } - - if (rwlock->readerqueue) - { - __pthread_queue_iterate (rwlock->readerqueue, wakeup) - rwlock->readers ++; - - wakeup = rwlock->readerqueue; - rwlock->readerqueue = 0; - - __pthread_spin_unlock (&rwlock->__lock); - - /* We can safely walk the list of waiting threads without holding - the lock since it is now decoupled from the rwlock. */ - __pthread_dequeuing_iterate (wakeup, wakeup) - __pthread_wakeup (wakeup); - - return 0; - } - - - /* Noone is waiting. Just unlock it. */ - - __pthread_spin_unlock (&rwlock->__held); - __pthread_spin_unlock (&rwlock->__lock); - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-rwlock-wrlock.c b/libpthread/sysdeps/generic/pt-rwlock-wrlock.c deleted file mode 100644 index be85b906..00000000 --- a/libpthread/sysdeps/generic/pt-rwlock-wrlock.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Acquire a rwlock for writing. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Implemented in pt-rwlock-timedwrlock.c. */ -extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime); - -/* Acquire RWLOCK for writing. */ -int -pthread_rwlock_wrlock (struct __pthread_rwlock *rwlock) -{ - return __pthread_rwlock_timedwrlock_internal (rwlock, 0); -} diff --git a/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c b/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c deleted file mode 100644 index eabfcbe8..00000000 --- a/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_rwlockattr_destroy. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr) -{ - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c b/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c deleted file mode 100644 index e8752c0c..00000000 --- a/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c +++ /dev/null @@ -1,29 +0,0 @@ -/* pthread_rwlockattr_getpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, - int *pshared) -{ - *pshared = attr->pshared; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-rwlockattr-init.c b/libpthread/sysdeps/generic/pt-rwlockattr-init.c deleted file mode 100644 index 34da6bf0..00000000 --- a/libpthread/sysdeps/generic/pt-rwlockattr-init.c +++ /dev/null @@ -1,28 +0,0 @@ -/* pthread_rwlockattr_init. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_rwlockattr_init (pthread_rwlockattr_t *attr) -{ - *attr = __pthread_default_rwlockattr; - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c b/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c deleted file mode 100644 index a861d034..00000000 --- a/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c +++ /dev/null @@ -1,39 +0,0 @@ -/* pthread_rwlockattr_setpshared. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, - int pshared) -{ - switch (pshared) - { - case PTHREAD_PROCESS_PRIVATE: - attr->pshared = pshared; - return 0; - - case PTHREAD_PROCESS_SHARED: - return ENOTSUP; - - default: - return EINVAL; - } -} diff --git a/libpthread/sysdeps/generic/pt-setconcurrency.c b/libpthread/sysdeps/generic/pt-setconcurrency.c deleted file mode 100644 index cd55b1ba..00000000 --- a/libpthread/sysdeps/generic/pt-setconcurrency.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Set the desired level of concurrency. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int __pthread_concurrency; - -int -pthread_setconcurrency (int new_level) -{ - if (new_level < 0) - return EINVAL; - - __pthread_concurrency = new_level; - - return 0; -} diff --git a/libpthread/sysdeps/generic/pt-setschedparam.c b/libpthread/sysdeps/generic/pt-setschedparam.c deleted file mode 100644 index a70b0796..00000000 --- a/libpthread/sysdeps/generic/pt-setschedparam.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Set the scheduling parameters for a thread. Generic version. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-setschedprio.c b/libpthread/sysdeps/generic/pt-setschedprio.c deleted file mode 100644 index 60668eb1..00000000 --- a/libpthread/sysdeps/generic/pt-setschedprio.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Set the scheduling priority of a thread. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_setschedprio (pthread_t thread, int prio) -{ - return ENOSYS; -} diff --git a/libpthread/sysdeps/generic/pt-setspecific.c b/libpthread/sysdeps/generic/pt-setspecific.c deleted file mode 100644 index d520c5df..00000000 --- a/libpthread/sysdeps/generic/pt-setspecific.c +++ /dev/null @@ -1,27 +0,0 @@ -/* pthread_setspecific. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_setspecific (pthread_key_t key, const void *value) -{ - return EINVAL; -} diff --git a/libpthread/sysdeps/generic/pt-startup.c b/libpthread/sysdeps/generic/pt-startup.c deleted file mode 100644 index c21a1819..00000000 --- a/libpthread/sysdeps/generic/pt-startup.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Thread initialization. Generic version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pt-internal.h> - -void -__pthread_startup (void) -{ -} diff --git a/libpthread/sysdeps/generic/raise.c b/libpthread/sysdeps/generic/raise.c deleted file mode 100644 index 410f557d..00000000 --- a/libpthread/sysdeps/generic/raise.c +++ /dev/null @@ -1,41 +0,0 @@ -/* raise.c - Generic raise implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -raise (int signo) -{ - /* According to POSIX, if we implement threads (and we do), then - "the effect of the raise() function shall be equivalent to - calling: pthread_kill(pthread_self(), sig);" */ - -debug (0, ""); - int err = pthread_kill (pthread_self (), signo); -debug (0, ""); - if (err) - { - errno = err; - return -1; - } - - return 0; -} - diff --git a/libpthread/sysdeps/generic/sem-close.c b/libpthread/sysdeps/generic/sem-close.c deleted file mode 100644 index 9f48032f..00000000 --- a/libpthread/sysdeps/generic/sem-close.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Close a named semaphore. Generic version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -int -__sem_close (sem_t *sem) -{ - errno = EOPNOTSUPP; - return -1; -} - -strong_alias (__sem_close, sem_close); diff --git a/libpthread/sysdeps/generic/sem-destroy.c b/libpthread/sysdeps/generic/sem-destroy.c deleted file mode 100644 index 6486599c..00000000 --- a/libpthread/sysdeps/generic/sem-destroy.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Destroy a semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -int -__sem_destroy (sem_t *sem) -{ - if (sem->__queue) - /* There are threads waiting on *SEM. */ - { - errno = EBUSY; - return -1; - } - - return 0; -} - -strong_alias (__sem_destroy, sem_destroy); diff --git a/libpthread/sysdeps/generic/sem-getvalue.c b/libpthread/sysdeps/generic/sem-getvalue.c deleted file mode 100644 index 7762089b..00000000 --- a/libpthread/sysdeps/generic/sem-getvalue.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Get the value of a semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <pt-internal.h> - -int -__sem_getvalue (sem_t *restrict sem, int *restrict value) -{ - __pthread_spin_lock (&sem->__lock); - *value = sem->__value; - __pthread_spin_unlock (&sem->__lock); - - return 0; -} - -strong_alias (__sem_getvalue, sem_getvalue); diff --git a/libpthread/sysdeps/generic/sem-init.c b/libpthread/sysdeps/generic/sem-init.c deleted file mode 100644 index d2414f5d..00000000 --- a/libpthread/sysdeps/generic/sem-init.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Initialize a semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -int -__sem_init (sem_t *sem, int pshared, unsigned value) -{ - if (pshared != 0) - { - errno = EOPNOTSUPP; - return -1; - } - -#ifdef SEM_VALUE_MAX - if (value > SEM_VALUE_MAX) - { - errno = EINVAL; - return -1; - } -#endif - - *sem = (sem_t) __SEMAPHORE_INITIALIZER (pshared, value); - return 0; -} - -strong_alias (__sem_init, sem_init); diff --git a/libpthread/sysdeps/generic/sem-open.c b/libpthread/sysdeps/generic/sem-open.c deleted file mode 100644 index bae87ed0..00000000 --- a/libpthread/sysdeps/generic/sem-open.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Open a named semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -sem_t * -__sem_open (const char *name, int open_flags, ...) -{ - errno = EOPNOTSUPP; - return SEM_FAILED; -} - -strong_alias (__sem_open, sem_open); diff --git a/libpthread/sysdeps/generic/sem-post.c b/libpthread/sysdeps/generic/sem-post.c deleted file mode 100644 index 6d438bf2..00000000 --- a/libpthread/sysdeps/generic/sem-post.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Post a semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <assert.h> - -#include <pt-internal.h> - -int -__sem_post (sem_t *sem) -{ - struct __pthread *wakeup; - - __pthread_spin_lock (&sem->__lock); - if (sem->__value > 0) - /* Do a quick up. */ - { - assert (! sem->__queue); - sem->__value ++; - __pthread_spin_unlock (&sem->__lock); - return 0; - } - - if (! sem->__queue) - /* No one waiting. */ - { - sem->__value = 1; - __pthread_spin_unlock (&sem->__lock); - return 0; - } - - /* Wake someone up. */ - - /* First dequeue someone. */ - wakeup = sem->__queue; - __pthread_dequeue (wakeup); - - /* Then drop the lock and transfer control. */ - __pthread_spin_unlock (&sem->__lock); - - __pthread_wakeup (wakeup); - - return 0; -} - -strong_alias (__sem_post, sem_post); diff --git a/libpthread/sysdeps/generic/sem-timedwait.c b/libpthread/sysdeps/generic/sem-timedwait.c deleted file mode 100644 index e34539a9..00000000 --- a/libpthread/sysdeps/generic/sem-timedwait.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Wait on a semaphore with a timeout. Generic version. - Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> -#include <assert.h> - -#include <pt-internal.h> - -int -__sem_timedwait_internal (sem_t *restrict sem, - const struct timespec *restrict timeout) -{ - struct __pthread *self; - - __pthread_spin_lock (&sem->__lock); - if (sem->__value > 0) - /* Successful down. */ - { - sem->__value --; - __pthread_spin_unlock (&sem->__lock); - return 0; - } - - if (timeout && (timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000)) - { - errno = EINVAL; - return -1; - } - - /* Add ourselves to the queue. */ - self = _pthread_self (); - - __pthread_enqueue (&sem->__queue, self); - __pthread_spin_unlock (&sem->__lock); - - /* Block the thread. */ - if (timeout) - { - error_t err; - - err = __pthread_timedblock (self, timeout); - if (err) - /* We timed out. We may need to disconnect ourself from the - waiter queue. - - FIXME: What do we do if we get a wakeup message before we - disconnect ourself? It may remain until the next time we - block. */ - { - assert (err == ETIMEDOUT); - - __pthread_spin_lock (&sem->__lock); - if (self->prevp) - __pthread_dequeue (self); - __pthread_spin_unlock (&sem->__lock); - - errno = err; - return -1; - } - } - else - __pthread_block (self); - - return 0; -} - -int -__sem_timedwait (sem_t *restrict sem, - const struct timespec *restrict timeout) -{ - return __sem_timedwait_internal (sem, timeout); -} - -strong_alias (__sem_timedwait, sem_timedwait); diff --git a/libpthread/sysdeps/generic/sem-trywait.c b/libpthread/sysdeps/generic/sem-trywait.c deleted file mode 100644 index 437e2822..00000000 --- a/libpthread/sysdeps/generic/sem-trywait.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Lock a semaphore if it does not require blocking. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -int -__sem_trywait (sem_t *sem) -{ - __pthread_spin_lock (&sem->__lock); - if (sem->__value > 0) - /* Successful down. */ - { - sem->__value --; - __pthread_spin_unlock (&sem->__lock); - return 0; - } - __pthread_spin_unlock (&sem->__lock); - - errno = EAGAIN; - return -1; -} - -strong_alias (__sem_trywait, sem_trywait); diff --git a/libpthread/sysdeps/generic/sem-unlink.c b/libpthread/sysdeps/generic/sem-unlink.c deleted file mode 100644 index 570ed614..00000000 --- a/libpthread/sysdeps/generic/sem-unlink.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Unlink a named semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <errno.h> - -#include <pt-internal.h> - -int -__sem_unlink (const char *name) -{ - errno = EOPNOTSUPP; - return -1; -} - -strong_alias (__sem_unlink, sem_unlink); diff --git a/libpthread/sysdeps/generic/sem-wait.c b/libpthread/sysdeps/generic/sem-wait.c deleted file mode 100644 index 8347480c..00000000 --- a/libpthread/sysdeps/generic/sem-wait.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Wait on a semaphore. Generic version. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <semaphore.h> -#include <pt-internal.h> - -extern int __sem_timedwait_internal (sem_t *restrict sem, - const struct timespec *restrict timeout); - -int -__sem_wait (sem_t *sem) -{ - return __sem_timedwait_internal (sem, 0); -} - -strong_alias (__sem_wait, sem_wait); diff --git a/libpthread/sysdeps/generic/sigaddset.c b/libpthread/sysdeps/generic/sigaddset.c deleted file mode 100644 index 14edb71c..00000000 --- a/libpthread/sysdeps/generic/sigaddset.c +++ /dev/null @@ -1,35 +0,0 @@ -/* sigaddset.c - Generic sigaddset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigaddset (sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - *sigset |= sigmask (signo); - return 0; -} - diff --git a/libpthread/sysdeps/generic/sigdelset.c b/libpthread/sysdeps/generic/sigdelset.c deleted file mode 100644 index 5456467f..00000000 --- a/libpthread/sysdeps/generic/sigdelset.c +++ /dev/null @@ -1,35 +0,0 @@ -/* sigdelset.c - Generic sigdelset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigdelset (sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - *sigset &= ~sigmask (signo); - return 0; -} - diff --git a/libpthread/sysdeps/generic/sigemptyset.c b/libpthread/sysdeps/generic/sigemptyset.c deleted file mode 100644 index 690c15b6..00000000 --- a/libpthread/sysdeps/generic/sigemptyset.c +++ /dev/null @@ -1,29 +0,0 @@ -/* sigemptyset.c - Generic sigemptyset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> - -int -sigemptyset (sigset_t *sigset) -{ - *sigset = 0; - return 0; -} - diff --git a/libpthread/sysdeps/generic/sigfillset.c b/libpthread/sysdeps/generic/sigfillset.c deleted file mode 100644 index f0ac0781..00000000 --- a/libpthread/sysdeps/generic/sigfillset.c +++ /dev/null @@ -1,29 +0,0 @@ -/* sigfillset.c - Generic sigfillset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> - -int -sigfillset (sigset_t *sigset) -{ - *sigset = (1ULL << (NSIG - 1)) - 1; - return 0; -} - diff --git a/libpthread/sysdeps/generic/siginterrupt.c b/libpthread/sysdeps/generic/siginterrupt.c deleted file mode 100644 index 0899efbb..00000000 --- a/libpthread/sysdeps/generic/siginterrupt.c +++ /dev/null @@ -1,36 +0,0 @@ -/* siginterrupt.c - Generic siginterrupt implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -siginterrupt (int sig, int flag) -{ - int ret; - struct sigaction act; - - sigaction (sig, NULL, &act); - if (flag) - act.sa_flags &= ~SA_RESTART; - else - act.sa_flags |= SA_RESTART; - ret = sigaction(sig, &act, NULL); - return ret; -} diff --git a/libpthread/sysdeps/generic/sigismember.c b/libpthread/sysdeps/generic/sigismember.c deleted file mode 100644 index b3d65c97..00000000 --- a/libpthread/sysdeps/generic/sigismember.c +++ /dev/null @@ -1,36 +0,0 @@ -/* sigismember.c - Generic sigismember implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigismember (const sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - if (*sigset & sigmask (signo)) - return 1; - else - return 0; -} diff --git a/libpthread/sysdeps/generic/signal.c b/libpthread/sysdeps/generic/signal.c deleted file mode 100644 index 7555d0a1..00000000 --- a/libpthread/sysdeps/generic/signal.c +++ /dev/null @@ -1,44 +0,0 @@ -/* signal.c - Generic signal implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -void (*signal (int sig, void (*handler)(int)))(int) -{ - struct sigaction sa; - - sa.sa_handler = handler; - sa.sa_flags = SA_RESTART; - - if (sigemptyset (&sa.sa_mask) < 0 - || sigaddset (&sa.sa_mask, sig) < 0) - return SIG_ERR; - - struct sigaction osa; - if (sigaction (sig, &sa, &osa) < 0) - return SIG_ERR; - - return osa.sa_handler; -} - -void (*bsd_signal (int sig, void (*func)(int)))(int) -{ - return signal (sig, func); -} diff --git a/libpthread/sysdeps/generic/sigwait.c b/libpthread/sysdeps/generic/sigwait.c deleted file mode 100644 index 7d10bf8b..00000000 --- a/libpthread/sysdeps/generic/sigwait.c +++ /dev/null @@ -1,34 +0,0 @@ -/* sigwait.c - Generic sigwait implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include "sig-internal.h" - -int -sigwait (const sigset_t *restrict set, int *restrict signo) -{ - siginfo_t info; - - if (sigwaitinfo (set, &info) < 0) - return -1; - - *signo = info.si_signo; - return 0; -} - diff --git a/libpthread/sysdeps/hurd/pt-destroy-specific.c b/libpthread/sysdeps/hurd/pt-destroy-specific.c deleted file mode 100644 index f7896e5e..00000000 --- a/libpthread/sysdeps/hurd/pt-destroy-specific.c +++ /dev/null @@ -1,79 +0,0 @@ -/* __pthread_destory_specific. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <stdlib.h> -#include <hurd/ihash.h> - -#include <pt-internal.h> - -void -__pthread_destroy_specific (struct __pthread *thread) -{ - error_t err; - int i; - int seen_one; - - /* Check if there is any thread specific data. */ - if (! thread->thread_specifics) - return; - - __pthread_key_lock_ready (); - - /* Iterate and call the destructors on any thread specific data. */ - for (;;) - { - seen_one = 0; - - __pthread_mutex_lock (&__pthread_key_lock); - - for (i = 0; i < __pthread_key_count; i ++) - { - void *value; - - if (__pthread_key_destructors[i] == PTHREAD_KEY_INVALID) - continue; - - value = hurd_ihash_find (thread->thread_specifics, i); - if (value) - { - err = hurd_ihash_remove (thread->thread_specifics, i); - assert (err == 1); - - if (__pthread_key_destructors[i]) - { - seen_one = 1; - __pthread_key_destructors[i] (value); - } - } - } - - __pthread_mutex_unlock (&__pthread_key_lock); - - if (! seen_one) - break; - - /* This may take a very long time. Let those blocking on - pthread_key_create or pthread_key_delete make progress. */ - sched_yield (); - } - - hurd_ihash_free (thread->thread_specifics); - thread->thread_specifics = 0; -} diff --git a/libpthread/sysdeps/hurd/pt-getspecific.c b/libpthread/sysdeps/hurd/pt-getspecific.c deleted file mode 100644 index 71ec63c6..00000000 --- a/libpthread/sysdeps/hurd/pt-getspecific.c +++ /dev/null @@ -1,39 +0,0 @@ -/* pthread_getspecific. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <hurd/ihash.h> - -#include <pt-internal.h> - -void * -pthread_getspecific (pthread_key_t key) -{ - struct __pthread *self; - - if (key < 0 || key >= __pthread_key_count - || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID) - return NULL; - - self = _pthread_self (); - if (! self->thread_specifics) - return 0; - - return hurd_ihash_find (self->thread_specifics, key); -} diff --git a/libpthread/sysdeps/hurd/pt-init-specific.c b/libpthread/sysdeps/hurd/pt-init-specific.c deleted file mode 100644 index c1bacbcb..00000000 --- a/libpthread/sysdeps/hurd/pt-init-specific.c +++ /dev/null @@ -1,30 +0,0 @@ -/* __pthread_init_specific. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <stdlib.h> - -#include <pt-internal.h> - -error_t -__pthread_init_specific (struct __pthread *thread) -{ - thread->thread_specifics = 0; - return 0; -} diff --git a/libpthread/sysdeps/hurd/pt-key-create.c b/libpthread/sysdeps/hurd/pt-key-create.c deleted file mode 100644 index b3e01412..00000000 --- a/libpthread/sysdeps/hurd/pt-key-create.c +++ /dev/null @@ -1,109 +0,0 @@ -/* pthread_key_create. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <stdlib.h> -#include <assert.h> - -#include <pt-internal.h> - -pthread_mutex_t __pthread_key_lock; - -void (**__pthread_key_destructors) (void *arg); -int __pthread_key_size; -int __pthread_key_count; -int __pthread_key_invalid_count; - -int -pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) -{ - /* Where to look for the next key slot. */ - static int index; - - __pthread_key_lock_ready (); - - __pthread_mutex_lock (&__pthread_key_lock); - - do_search: - /* Use the search hint and try to find a free slot. */ - for (; index < __pthread_key_count - && __pthread_key_destructors[index] != PTHREAD_KEY_INVALID; - index ++) - ; - - /* See if we actually found a free element. */ - if (index < __pthread_key_count) - { - assert (__pthread_key_destructors[index] == PTHREAD_KEY_INVALID); - assert (__pthread_key_invalid_count > 0); - - __pthread_key_invalid_count --; - __pthread_key_destructors[index] = destructor; - *key = index ++; - - __pthread_mutex_unlock (&__pthread_key_lock); - return 0; - } - - assert (index == __pthread_key_count); - - /* No space at the end. */ - if (__pthread_key_size == __pthread_key_count) - { - /* See if it is worth looking for a free element. */ - if (__pthread_key_invalid_count > 4 - && __pthread_key_invalid_count > __pthread_key_size / 8) - { - index = 0; - goto do_search; - } - - - /* Resize the array. */ - { - void *t; - int newsize; - - if (__pthread_key_size == 0) - newsize = 8; - else - newsize = __pthread_key_size * 2; - - t = realloc (__pthread_key_destructors, - newsize * sizeof (*__pthread_key_destructors)); - if (! t) - { - __pthread_mutex_unlock (&__pthread_key_lock); - return ENOMEM; - } - - __pthread_key_size = newsize; - __pthread_key_destructors = t; - } - } - - __pthread_key_destructors[index] = destructor; - *key = index; - - index ++; - __pthread_key_count ++; - - __pthread_mutex_unlock (&__pthread_key_lock); - return 0; -} diff --git a/libpthread/sysdeps/hurd/pt-key-delete.c b/libpthread/sysdeps/hurd/pt-key-delete.c deleted file mode 100644 index 9d88647e..00000000 --- a/libpthread/sysdeps/hurd/pt-key-delete.c +++ /dev/null @@ -1,64 +0,0 @@ -/* pthread_key_delete. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -int -pthread_key_delete (pthread_key_t key) -{ - error_t err = 0; - - __pthread_key_lock_ready (); - - __pthread_mutex_lock (&__pthread_key_lock); - - if (key < 0 || key >= __pthread_key_count - || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID) - err = EINVAL; - else - { - int i; - - __pthread_key_destructors[key] = PTHREAD_KEY_INVALID; - __pthread_key_invalid_count ++; - - pthread_rwlock_rdlock (&__pthread_threads_lock); - for (i = 0; i < __pthread_num_threads; ++i) - { - struct __pthread *t; - - t = __pthread_threads[i]; - - if (t == NULL) - continue; - - /* Just remove the key, no need to care whether it was - already there. */ - if (t->thread_specifics) - hurd_ihash_remove (t->thread_specifics, key); - } - pthread_rwlock_unlock (&__pthread_threads_lock); - } - - __pthread_mutex_unlock (&__pthread_key_lock); - - return err; -} diff --git a/libpthread/sysdeps/hurd/pt-key.h b/libpthread/sysdeps/hurd/pt-key.h deleted file mode 100644 index 494e01d7..00000000 --- a/libpthread/sysdeps/hurd/pt-key.h +++ /dev/null @@ -1,76 +0,0 @@ -/* pthread_key internal declatations for the Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <hurd/ihash.h> - -#define PTHREAD_KEY_MEMBERS \ - hurd_ihash_t thread_specifics; - -#define PTHREAD_KEY_INVALID (void *) (-1) - - -/* __PTHREAD_KEY_DESTRUCTORS is an array of destructors with - __PTHREAD_KEY_SIZE elements. If an element with index less than - __PTHREAD_KEY_COUNT is invalid, it shall contain the value - PTHREAD_KEY_INVALID which shall be distinct from NULL. - - Normally, we just add new keys to the end of the array and realloc - it as necessary. The pthread_key_create routine may decide to - rescan the array if __PTHREAD_KEY_FREE is large. */ -extern void (**__pthread_key_destructors) (void *arg); -extern int __pthread_key_size; -extern int __pthread_key_count; -/* Number of invalid elements in the array. Does not include elements - for which memory has been allocated but which have not yet been - used (i.e. those elements with indexes greater than - __PTHREAD_KEY_COUNT). */ -extern int __pthread_key_invalid_count; - -/* Protects the above variables. This must be a recursive lock: the - destructors may call pthread_key_delete. */ -extern pthread_mutex_t __pthread_key_lock; - -#include <assert.h> - -static inline void -__pthread_key_lock_ready (void) -{ - static pthread_once_t o = PTHREAD_ONCE_INIT; - - void do_init (void) - { - int err; - pthread_mutexattr_t attr; - - err = pthread_mutexattr_init (&attr); - assert_perror (err); - - err = pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - assert_perror (err); - - err = pthread_mutex_init (&__pthread_key_lock, &attr); - assert_perror (err); - - err = pthread_mutexattr_destroy (&attr); - assert_perror (err); - } - - pthread_once (&o, do_init); -} diff --git a/libpthread/sysdeps/hurd/pt-kill.c b/libpthread/sysdeps/hurd/pt-kill.c deleted file mode 100644 index d204e3f6..00000000 --- a/libpthread/sysdeps/hurd/pt-kill.c +++ /dev/null @@ -1,52 +0,0 @@ -/* pthread_kill. Hurd version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> -#include <signal.h> -#include <hurd/signal.h> - -#include <pt-internal.h> - -int -pthread_kill (pthread_t thread, int sig) -{ - struct __pthread *pthread; - struct hurd_signal_detail detail; - struct hurd_sigstate *ss; - - /* Lookup the thread structure for THREAD. */ - pthread = __pthread_getid (thread); - if (pthread == NULL) - return ESRCH; - - ss = _hurd_thread_sigstate (pthread->kernel_thread); - assert (ss); - - if (!sig) - return 0; - - detail.exc = 0; - detail.code = sig; - detail.error = 0; - - _hurd_raise_signal (ss, sig, &detail); - - return 0; -} diff --git a/libpthread/sysdeps/hurd/pt-setspecific.c b/libpthread/sysdeps/hurd/pt-setspecific.c deleted file mode 100644 index d0b7302f..00000000 --- a/libpthread/sysdeps/hurd/pt-setspecific.c +++ /dev/null @@ -1,47 +0,0 @@ -/* pthread_setspecific. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <hurd/ihash.h> - -#include <pt-internal.h> - -int -pthread_setspecific (pthread_key_t key, const void *value) -{ - error_t err; - struct __pthread *self = _pthread_self (); - - if (key < 0 || key >= __pthread_key_count - || __pthread_key_destructors[key] == PTHREAD_KEY_INVALID) - return EINVAL; - - if (! self->thread_specifics) - { - err = hurd_ihash_create (&self->thread_specifics, HURD_IHASH_NO_LOCP); - if (err) - return ENOMEM; - } - - err = hurd_ihash_add (self->thread_specifics, key, (void *) value); - if (err) - return ENOMEM; - - return 0; -} diff --git a/libpthread/sysdeps/ia32/bits/atomic.h b/libpthread/sysdeps/ia32/bits/atomic.h deleted file mode 100644 index 0dfc1f60..00000000 --- a/libpthread/sysdeps/ia32/bits/atomic.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Atomic operations. i386 version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_ATOMIC_H -#define _BITS_ATOMIC_H 1 - -typedef __volatile int __atomic_t; - -static inline void -__atomic_inc (__atomic_t *__var) -{ - __asm__ __volatile ("lock; incl %0" : "=m" (*__var) : "m" (*__var)); -} - -static inline void -__atomic_dec (__atomic_t *__var) -{ - __asm__ __volatile ("lock; decl %0" : "=m" (*__var) : "m" (*__var)); -} - -static inline int -__atomic_dec_and_test (__atomic_t *__var) -{ - unsigned char __ret; - - __asm__ __volatile ("lock; decl %0; sete %1" - : "=m" (*__var), "=qm" (__ret) : "m" (*__var)); - return __ret != 0; -} - -/* We assume that an __atomicptr_t is only used for pointers to - word-aligned objects, and use the lowest bit for a simple lock. */ -typedef __volatile int * __atomicptr_t; - -/* Actually we don't implement that yet, and assume that we run on - something that has the i486 instruction set. */ -static inline int -__atomicptr_compare_and_swap (__atomicptr_t *__ptr, void *__oldval, - void * __newval) -{ - char __ret; - int __dummy; - - __asm__ __volatile ("lock; cmpxchgl %3, %1; sete %0" - : "=q" (__ret), "=m" (*__ptr), "=a" (__dummy) - : "r" (__newval), "m" (*__ptr), "a" (__oldval)); - return __ret; -} - -#endif diff --git a/libpthread/sysdeps/ia32/bits/memory.h b/libpthread/sysdeps/ia32/bits/memory.h deleted file mode 100644 index 932c4086..00000000 --- a/libpthread/sysdeps/ia32/bits/memory.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Memory barrier operations. i386 version. - Copyright (C) 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_MEMORY_H -#define _BITS_MEMORY_H 1 - -/* Prevent read and write reordering across this function. */ -static inline void -__memory_barrier (void) -{ - int i; - - /* Any lock'ed instruction will do. We just do a simple - increment. */ - __asm__ __volatile ("lock; incl %0" : "=m" (i) : "m" (i) : "memory"); -} - -/* Prevent read reordering across this function. */ -#define __memory_read_barrier __memory_barrier - -/* Prevent write reordering across this function. */ -#define __memory_write_barrier __memory_barrier - -#endif diff --git a/libpthread/sysdeps/ia32/bits/spin-lock-inline.h b/libpthread/sysdeps/ia32/bits/spin-lock-inline.h deleted file mode 100644 index e5ed3def..00000000 --- a/libpthread/sysdeps/ia32/bits/spin-lock-inline.h +++ /dev/null @@ -1,98 +0,0 @@ -/* Machine-specific definitions for spin locks. i386 version. - Copyright (C) 2000, 2005, 2008, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_SPIN_LOCK_INLINE_H -#define _BITS_SPIN_LOCK_INLINE_H 1 - -#include <features.h> -#include <bits/spin-lock.h> - -__BEGIN_DECLS - -#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES - -# ifndef __EBUSY -# include <errno.h> -# define __EBUSY EBUSY -# endif - -# ifndef __PT_SPIN_INLINE -# define __PT_SPIN_INLINE __extern_inline -# endif - -__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_destroy (__pthread_spinlock_t *__lock) -{ - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock, - int __pshared); - -__PT_SPIN_INLINE int -__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared) -{ - *__lock = __PTHREAD_SPIN_LOCK_INITIALIZER; - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_trylock (__pthread_spinlock_t *__lock) -{ - int __locked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__locked), "=m" (*__lock) : "0" (1) : "memory"); - return __locked ? __EBUSY : 0; -} - -__extern_inline int __pthread_spin_lock (__pthread_spinlock_t *__lock); -extern int _pthread_spin_lock (__pthread_spinlock_t *__lock); - -__extern_inline int -__pthread_spin_lock (__pthread_spinlock_t *__lock) -{ - if (__pthread_spin_trylock (__lock)) - return _pthread_spin_lock (__lock); - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_unlock (__pthread_spinlock_t *__lock) -{ - int __unlocked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__unlocked), "=m" (*__lock) : "0" (0) : "memory"); - return 0; -} - -#endif /* Use extern inlines or force inlines. */ - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/ia32/bits/spin-lock.h b/libpthread/sysdeps/ia32/bits/spin-lock.h deleted file mode 100644 index 5ae81e18..00000000 --- a/libpthread/sysdeps/ia32/bits/spin-lock.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Machine-specific definitions for spin locks. i386 version. - Copyright (C) 2000, 2005, 2008, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_SPIN_LOCK_H -#define _BITS_SPIN_LOCK_H 1 - -#include <features.h> - -__BEGIN_DECLS - -/* The type of a spin lock object. */ -typedef __volatile int __pthread_spinlock_t; - -/* Initializer for a spin lock object. */ -# define __PTHREAD_SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0) - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/ia32/machine-sp.h b/libpthread/sysdeps/ia32/machine-sp.h deleted file mode 100644 index cef6ab72..00000000 --- a/libpthread/sysdeps/ia32/machine-sp.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Machine-specific function to return the stack pointer. i386 version. - Copyright (C) 1994, 1997, 2001, 2006 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_SP_H -#define _MACHINE_SP_H - -/* Return the current stack pointer. */ - -#define __thread_stack_pointer() ({ \ - register void *__sp__ asm("esp"); \ - __sp__; \ -}) - -#endif /* machine-sp.h */ diff --git a/libpthread/sysdeps/ia32/pt-machdep.h b/libpthread/sysdeps/ia32/pt-machdep.h deleted file mode 100644 index 6d456367..00000000 --- a/libpthread/sysdeps/ia32/pt-machdep.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Machine dependent pthreads internal defenitions. i386 version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_MACHDEP_H -#define _PT_MACHDEP_H 1 - -struct pthread_mcontext -{ - void *pc; - void *sp; -}; - -#endif /* pt-machdep.h */ diff --git a/libpthread/sysdeps/l4/bits/pthread-np.h b/libpthread/sysdeps/l4/bits/pthread-np.h deleted file mode 100644 index 6a02bdc0..00000000 --- a/libpthread/sysdeps/l4/bits/pthread-np.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Non-portable functions. L4 version. - Copyright (C) 2003, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_PTHREAD_NP_H -#define _BITS_PTHREAD_NP_H 1 - -#include <l4.h> - -/* Add the thread TID to the internal kernel thread pool. */ -extern int pthread_pool_add_np (l4_thread_id_t tid); - -/* Get the first thread from the pool. */ -extern l4_thread_id_t pthread_pool_get_np (void); - -#endif /* bits/pthread-np.h */ diff --git a/libpthread/sysdeps/l4/hurd/bits/pthread-np.h b/libpthread/sysdeps/l4/hurd/bits/pthread-np.h deleted file mode 100644 index a90793df..00000000 --- a/libpthread/sysdeps/l4/hurd/bits/pthread-np.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Non-portable functions. Viengoos version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_PTHREAD_NP_H -#define _BITS_PTHREAD_NP_H 1 - -#include <hurd/addr.h> - -int pthread_setactivity_np (addr_t activity); - -#endif /* bits/pthread-np.h */ diff --git a/libpthread/sysdeps/l4/hurd/ia32/pt-machdep.c b/libpthread/sysdeps/l4/hurd/ia32/pt-machdep.c deleted file mode 100644 index dbf5cd7e..00000000 --- a/libpthread/sysdeps/l4/hurd/ia32/pt-machdep.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Machine dependent pthreads code. Hurd/i386 version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Nothing to do. */ diff --git a/libpthread/sysdeps/l4/hurd/ia32/pt-setup.c b/libpthread/sysdeps/l4/hurd/ia32/pt-setup.c deleted file mode 100644 index 579905c9..00000000 --- a/libpthread/sysdeps/l4/hurd/ia32/pt-setup.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Setup thread stack. Viengoos/i386 version. - Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> - -#include <pt-internal.h> -#include <hurd/thread.h> -#include <hurd/exceptions.h> - -/* The stack layout used on the i386 is: - - ----------------- - | ARG | - ----------------- - | START_ROUTINE | - ----------------- - | Return address | - ----------------- <- %ebp - | Frame pointer | - ----------------- - - We do the following: setup the stack to return to the entry routine. - - -*/ - -/* The stack contains: - - arg - start_routine - 0 <- fake return address - C entry_point -*/ -extern uintptr_t _pthread_entry_point; -__asm__ ("\n\ - .globl _pthread_entry_point, __pthread_entry_point\n\ -_pthread_entry_point:\n\ -__pthread_entry_point:\n\ - pushl $0\n\ - popf\n\ -\n\ - xor %ebp, %ebp\n\ - ret\n"); - -/* Set up the stack for THREAD, such that it appears as if - START_ROUTINE and ARG were passed to the new thread's entry-point. - Return the stack pointer for the new thread. We also take the - opportunity to install THREAD in our utcb. */ -static void * -stack_setup (struct __pthread *thread, - void *(*start_routine)(void *), void *arg, - void (*entry_point)(void *(*)(void *), void *)) -{ - uintptr_t *top; - - /* Calculate top of the new stack. */ - top = (uintptr_t *) ((uintptr_t) thread->stackaddr + thread->stacksize); - - /* Align on 0x10 for MMX operations. */ - top = (uintptr_t) top & ~0xf; - - if (start_routine) - { - /* Set up call frame. */ - *--top = (uintptr_t) arg; /* Argument to START_ROUTINE. */ - *--top = (uintptr_t) start_routine; - *--top = 0; /* Fake return address. */ - *--top = (uintptr_t) entry_point; - } - - return top; -} - -int -__pthread_setup (struct __pthread *thread, - void (*entry_point)(void *(*)(void *), void *), - void *(*start_routine)(void *), void *arg) -{ - thread->mcontext.pc = (void *) &_pthread_entry_point; - thread->mcontext.sp = (void *) stack_setup (thread, start_routine, arg, - entry_point); - - if (__pthread_num_threads == 1) - return 0; - - assert (! ADDR_IS_VOID (thread->exception_area[0])); - - struct exception_page *exception_page = thread->exception_area_va; - - /* SP is set to the end of the exception area minus one word, which - is the location of the exception page. */ - exception_page->exception_handler_sp - = (uintptr_t) thread->exception_area_va + EXCEPTION_AREA_SIZE; - exception_page->exception_handler_sp -= sizeof (void *); - * (void **) exception_page->exception_handler_sp = thread->exception_area_va; - - exception_page->exception_handler_ip = (uintptr_t) &exception_handler_entry; - exception_page->exception_handler_end = (uintptr_t) &exception_handler_end; - - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/ia32/signal-dispatch-lowlevel.c b/libpthread/sysdeps/l4/hurd/ia32/signal-dispatch-lowlevel.c deleted file mode 100644 index 37ef8215..00000000 --- a/libpthread/sysdeps/l4/hurd/ia32/signal-dispatch-lowlevel.c +++ /dev/null @@ -1,213 +0,0 @@ -/* signal-dispatch-lowlevel.c - ia32 specific signal handling functions. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <pt-internal.h> -#include <sig-internal.h> - -#include <hurd/thread.h> -#include <pthread.h> -#include <stdint.h> -#include <atomic.h> - -extern char _signal_dispatch_entry; -/* - 0(%esp) a pointer to the thread's struct signal_state. - - 4(%esp) a pointer to a siginfo_t. - - 8(%esp) is a pointer to the ss_flags field (or NULL). - - 12(%esp)+4 is the value of the sp when the thread was interrupted (intr_sp) - - 0(intr_sp) is the value of the ip when the thread was interrupted. - - 16(%esp) - 16 byte register save area -*/ -__asm__ ("\n\ - .globl _signal_dispatch_entry\n\ -_signal_dispatch_entry:\n\ - /* Save caller saved registers (16 bytes). */\n\ - mov %eax, 16(%esp)\n\ - mov %ecx, 16+4(%esp)\n\ - mov %edx, 16+8(%esp)\n\ - pushf\n\ - popl %eax\n\ - mov %eax, 16+12(%esp)\n\ -\n\ - /* Reset EFLAGS. */\n\ - cld\n\ - call signal_dispatch\n\ -\n\ - /* Get the original stack and begin restoration. */\n\ - mov 12(%esp), %edx\n\ -\n\ - /* Move the saved registers to the user stack. */\n\ - sub $16, %edx\n\ - /* eax. */\n\ - mov 16+0(%esp), %ecx\n\ - mov %ecx, 0(%edx)\n\ - /* ecx. */\n\ - mov 16+4(%esp), %ecx\n\ - mov %ecx, 4(%edx)\n\ - /* edx. */\n\ - mov 16+8(%esp), %ecx\n\ - mov %ecx, 8(%edx)\n\ - /* eflags. */\n\ - mov 16+12(%esp), %ecx\n\ - mov %ecx, 12(%edx)\n\ -\n\ - /* Get the pointer to the sigaltstack flags. */\n\ - mov 8(%esp), %ecx\n\ -\n\ - /* Restore the user stack. */\n\ - mov %edx, %esp\n\ -\n\ - /* Clear the SA_ONSTACK flag. */\n\ - and %ecx, %ecx\n\ - jz after_clear\n\ - lock; and $~1, 0(%ecx)\n\ -after_clear:\n\ -\n\ - /* Restore eflags, the scratch regs and the original sp and ip. */\n\ - popl %eax\n\ - popl %ecx\n\ - popl %edx\n\ - popf\n\ - ret\n"); - -extern char _signal_dispatch_entry_self; -/* - 0(%esp) is the return address (we ignore it) - - 4(%esp) is the sp to load - - Since we are returning to signal_dispatch_lowlevel's caller, we - also need to restore its frame pointer. */ -__asm__ ("\n\ - .globl _signal_dispatch_entry_self\n\ -_signal_dispatch_entry_self:\n\ - mov 0(%ebp), %ebp\n\ - mov 4(%esp), %esp\n\ - jmp _signal_dispatch_entry\n"); - -void -signal_dispatch_lowlevel (struct signal_state *ss, pthread_t tid, - siginfo_t si) -{ - assert (pthread_mutex_trylock (&ss->lock) == EBUSY); - - struct __pthread *thread = __pthread_getid (tid); - - bool self = tid == pthread_self (); - - uintptr_t intr_sp; - - if (self) - { - /* The return address is just before the first argument. */ - intr_sp = (uintptr_t) &ss - 4; - assert (* (void **) intr_sp == __builtin_return_address (0)); - } - else - { - struct hurd_thread_exregs_in in; - memset (&in, 0, sizeof (in)); - struct hurd_thread_exregs_out out; - - error_t err; - err = rm_thread_exregs (ADDR_VOID, thread->object, - HURD_EXREGS_STOP | HURD_EXREGS_ABORT_IPC - | HURD_EXREGS_GET_REGS, - in, &out); - if (err) - panic ("Failed to modify thread " ADDR_FMT, - ADDR_PRINTF (thread->object)); - - intr_sp = out.sp; - - /* Push the ip on the user stack. */ - intr_sp -= 4; - * (uintptr_t *) intr_sp = out.ip; - } - - bool altstack = false; - uintptr_t sp; - if (! (ss->actions[si.si_signo - 1].sa_flags & SA_ONSTACK) - || (ss->stack.ss_flags & SS_DISABLE) - || (ss->stack.ss_flags & SS_ONSTACK)) - { - assert (! self); - sp = intr_sp; - } - else - { - /* The stack grows down. */ - sp = (uintptr_t) ss->stack.ss_sp + ss->stack.ss_size; - - /* We know intimately that SS_ONSTACK is the least significant - bit. */ - assert (SS_ONSTACK == 1); - atomic_bit_set (&ss->stack.ss_flags, 0); - - altstack = true; - } - - /* Set up the call frame for a call to signal_dispatch_entry. */ - - /* Allocate a siginfo structure on the stack. */ - sp = sp - sizeof (siginfo_t); - siginfo_t *sip = (void *) sp; - /* Copy the user supplied values. */ - *sip = si; - - /* Add space for the 4 caller saved registers. */ - sp -= 4 * sizeof (uintptr_t); - - /* Save the interrupted sp. */ - sp -= 4; - * (uintptr_t *) sp = intr_sp; - - /* Address of the ss_flags. */ - sp -= 4; - if (altstack) - * (uintptr_t *) sp = (uintptr_t) &ss->stack.ss_flags; - else - * (uintptr_t *) sp = 0; - - /* Push the parameters to signal_dispatch. */ - - /* signal info structure. */ - sp -= 4; - * (uintptr_t *) sp = (uintptr_t) sip; - - /* The ss. */ - sp -= 4; - * (uintptr_t *) sp = (uintptr_t) ss; - - pthread_mutex_transfer_np (&ss->lock, tid); - - if (self) - ((void (*) (uintptr_t)) &_signal_dispatch_entry_self) ((uintptr_t) sp); - else - { - struct hurd_thread_exregs_in in; - struct hurd_thread_exregs_out out; - - in.sp = sp; - in.ip = (uintptr_t) &_signal_dispatch_entry; - - rm_thread_exregs (ADDR_VOID, thread->object, - HURD_EXREGS_SET_SP_IP - | HURD_EXREGS_START | HURD_EXREGS_ABORT_IPC, - in, &out); - } -} diff --git a/libpthread/sysdeps/l4/hurd/powerpc/pt-machdep.c b/libpthread/sysdeps/l4/hurd/powerpc/pt-machdep.c deleted file mode 100644 index 754d203e..00000000 --- a/libpthread/sysdeps/l4/hurd/powerpc/pt-machdep.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Machine dependent pthreads code. Hurd/PowerPC version. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Nothing to do. */ diff --git a/libpthread/sysdeps/l4/hurd/powerpc/pt-setup.c b/libpthread/sysdeps/l4/hurd/powerpc/pt-setup.c deleted file mode 100644 index d3cf4ec3..00000000 --- a/libpthread/sysdeps/l4/hurd/powerpc/pt-setup.c +++ /dev/null @@ -1,93 +0,0 @@ -/* Setup thread stack. Hurd/PowerPC version. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> - -#include <pt-internal.h> - -/* Arguments is passed in registers on the PowerPC. But the - exchange registers syscall only allows us to set the PC and the - stack pointer so we put the entry point and start function on - the stack. */ -struct start_info -{ - void (*entry_point) (void *(*)(void *), void *); - void *(*start_routine) (void *); - void *arg; -}; - -void first_entry_1 (void); - -/* Stage 1 entry function. The start_info structure is inlined on the - stack. Put values into registers and call entry function. */ -asm (" ;\ -first_entry_1: ;\ - lwz 0, 0(1) ;\ - lwz 3, 4(1) ;\ - lwz 4, 8(1) ;\ - mtctr 0 ;\ - bctrl ;\ -"); - -/* Set up the stack for THREAD, such that it appears as if - START_ROUTINE and ARG were passed to the new thread's entry-point. - Return the stack pointer for the new thread. We also take the - opportunity to install THREAD in our utcb. */ -static void * -stack_setup (struct __pthread *thread, - void (*entry_point)(void *(*)(void *), void *), - void *(*start_routine)(void *), void *arg) -{ - l4_word_t *top; - - /* Calculate top of the new stack. */ - top = (l4_word_t *) ((l4_word_t) thread->stackaddr + thread->stacksize); - - /* Initial stack frame. */ - top[-4] = 0; - top = top - 4; - - if (start_routine) - { - struct start_info *info = ((struct start_info *) top) - 1; - - info->entry_point = entry_point; - info->start_routine = start_routine; - info->arg = arg; - return (void *) info; - } - return top; -} - -int -__pthread_setup (struct __pthread *thread, - void (*entry_point)(void *(*)(void *), void *), - void *(*start_routine)(void *), void *arg) -{ - thread->mcontext.pc = first_entry_1; - thread->mcontext.sp = stack_setup (thread, entry_point, - start_routine, arg); - - if (l4_same_threads (thread->threadid, l4_myself ())) - l4_set_user_defined_handle ((l4_word_t) thread); - else - l4_set_user_defined_handle_of (thread->threadid, - (l4_word_t) thread); - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-block.c b/libpthread/sysdeps/l4/hurd/pt-block.c deleted file mode 100644 index 2315b1c4..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-block.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Block a thread. Viengoos version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pt-internal.h> - -#include <hurd/stddef.h> -#include <hurd/futex.h> - -/* Block THREAD. */ -void -__pthread_block (struct __pthread *thread) -{ - futex_wait (&thread->threadid, thread->threadid); -} diff --git a/libpthread/sysdeps/l4/hurd/pt-kill.c b/libpthread/sysdeps/l4/hurd/pt-kill.c deleted file mode 100644 index c72e82f4..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-kill.c +++ /dev/null @@ -1,3 +0,0 @@ -/* The generic version is good enough for us, however, the generic - Hurd on Mach version supplies a specialized version */ -#include "../generic/pt-kill.c" diff --git a/libpthread/sysdeps/l4/hurd/pt-setactivity-np.c b/libpthread/sysdeps/l4/hurd/pt-setactivity-np.c deleted file mode 100644 index f2f07233..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-setactivity-np.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Set a thread's activity activity. Viengoos version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pt-internal.h> - -#include <hurd/addr.h> -#include <hurd/thread.h> - -int -pthread_setactivity_np (addr_t activity) -{ - struct __pthread *self = _pthread_self (); - - struct hurd_thread_exregs_in in; - in.activity = activity; - - struct hurd_thread_exregs_out out; - int err = rm_thread_exregs (ADDR_VOID, self->object, - HURD_EXREGS_SET_ACTIVITY, - in, &out); - - return err; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-sigstate-destroy.c b/libpthread/sysdeps/l4/hurd/pt-sigstate-destroy.c deleted file mode 100644 index 997a0369..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-sigstate-destroy.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Destroy the signal state. Hurd on L4 version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -void -__pthread_sigstate_destroy (struct __pthread *thread) -{ - /* Nothing to do. */ -} diff --git a/libpthread/sysdeps/l4/hurd/pt-sigstate-init.c b/libpthread/sysdeps/l4/hurd/pt-sigstate-init.c deleted file mode 100644 index 4c40fdb3..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-sigstate-init.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Initialize the signal state. Hurd on L4 version. - Copyright (C) 2003, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> -#include <sig-internal.h> - -error_t -__pthread_sigstate_init (struct __pthread *thread) -{ - struct signal_state *ss = &thread->ss; - - memset (ss, 0, sizeof (*ss)); - - ss->stack.ss_flags = SS_DISABLE; - - int signo; - for (signo = 1; signo < NSIG; ++signo) - { - sigemptyset (&ss->actions[signo - 1].sa_mask); - ss->actions[signo - 1].sa_flags = SA_RESTART; - ss->actions[signo - 1].sa_handler = SIG_DFL; - ss->lock = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; - } - - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-sigstate.c b/libpthread/sysdeps/l4/hurd/pt-sigstate.c deleted file mode 100644 index 66dd08cf..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-sigstate.c +++ /dev/null @@ -1,81 +0,0 @@ -/* Set a thread's signal state. Hurd on L4 version. - Copyright (C) 2002, 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> -#include <signal.h> - -#include <pt-internal.h> - -error_t -__pthread_sigstate (struct __pthread *thread, int how, - const sigset_t *set, sigset_t *oset, - int clear_pending) -{ - struct signal_state *ss = &thread->ss; - pthread_mutex_lock (&ss->lock); - - if (oset) - *oset = ss->blocked; - - if (set) - { - /* Mask out SIGKILL and SIGSTOP. */ - sigset_t s = *set; - sigdelset (&s, SIGKILL); - sigdelset (&s, SIGSTOP); - - switch (how) - { - case SIG_BLOCK: - ss->blocked |= s; - break; - case SIG_UNBLOCK: - ss->blocked &= ~s; - break; - case SIG_SETMASK: - ss->blocked = s; - break; - default: - errno = EINVAL; - pthread_mutex_unlock (&ss->lock); - return -1; - } - } - - if (clear_pending) - sigemptyset (&ss->pending); - - /* A "signal shall remain pending until it is unblocked" (2.4.1). - - "If there are any pending unblocked signals after the call to - sigprocmask(), at least one of those signals shall be delivered - before the call to sigprocmask() returns." - (pthread_sigmask). */ - sigset_t extant = ~ss->blocked & ss->pending; - if (! extant) - extant = ~ss->blocked & process_pending; - - pthread_mutex_unlock (&ss->lock); - - if (extant) - raise (l4_lsb64 (extant)); - - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-startup.c b/libpthread/sysdeps/l4/hurd/pt-startup.c deleted file mode 100644 index b6461de7..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-startup.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Thread initialization. Hurd/L4 version. - Copyright (C) 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> -#include <pt-internal.h> - -#include <hurd/exceptions.h> - -void -__pthread_startup (void) -{ - struct __pthread *pthread = _pthread_self (); - pthread->threadid = l4_myself (); -} diff --git a/libpthread/sysdeps/l4/hurd/pt-sysdep.c b/libpthread/sysdeps/l4/hurd/pt-sysdep.c deleted file mode 100644 index c23364c7..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-sysdep.c +++ /dev/null @@ -1,61 +0,0 @@ -/* System dependent pthreads code. Hurd version. - Copyright (C) 2000, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <stddef.h> -#include <stdint.h> - -#include <pt-internal.h> - -int -sched_yield (void) -{ - l4_yield (); - return 0; -} - -/* Forward. */ -static void init_routine (void (*) (void *), void *) - __attribute__ ((noreturn)); - -/* OK, the name of this variable isn't really appropriate, but I don't - want to change it yet. */ -void (*_pthread_init_routine)(void (*) (void *), void *) = &init_routine; - -/* This function is called from the Hurd-specific startup code. It - should return a new stack pointer for the main thread. The caller - will switch to this new stack before doing anything serious. */ -static void -init_routine (void (*entry) (void *), void *arg) -{ - /* Initialize the library. */ - __pthread_initialize (); - - struct __pthread *thread; - int err; - - /* Create the pthread structure for the main thread (i.e. us). */ - err = __pthread_create_internal (&thread, 0, - (void *(*)(void *)) entry, arg); - assert_perror (err); - - /* Switch stacks. */ - l4_start_sp_ip (l4_myself (), thread->mcontext.sp, - thread->mcontext.pc); -} diff --git a/libpthread/sysdeps/l4/hurd/pt-sysdep.h b/libpthread/sysdeps/l4/hurd/pt-sysdep.h deleted file mode 100644 index 08bcd143..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-sysdep.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Internal definitions for pthreads library. - Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_SYSDEP_H -#define _PT_SYSDEP_H 1 - -#include <l4.h> -#include <hurd/storage.h> -#include <sys/mman.h> - -/* XXX */ -#define _POSIX_THREAD_THREADS_MAX 64 - -/* The default stack size: 2MB. */ -#define PTHREAD_STACK_DEFAULT (2 * 1024 * 1024) - -#include <hurd/exceptions.h> - -#define EXCEPTION_AREA_SIZE EXCEPTION_STACK_SIZE -#define EXCEPTION_AREA_SIZE_LOG2 EXCEPTION_STACK_SIZE_LOG2 -/* The exception page is the first object. */ -#define EXCEPTION_PAGE 0 - -#define PTHREAD_SYSDEP_MEMBERS \ - addr_t object; \ - l4_thread_id_t threadid; \ - addr_t exception_area[EXCEPTION_AREA_SIZE / PAGESIZE]; \ - void *exception_area_va; \ - l4_word_t my_errno; - -extern inline struct __pthread * -__attribute__((__always_inline__)) -_pthread_self (void) -{ - return (struct __pthread *) l4_user_defined_handle (); -} - -extern inline void -__attribute__((__always_inline__)) -__pthread_stack_dealloc (void *stackaddr, size_t stacksize) -{ - munmap (stackaddr, stacksize); -} - -#endif /* pt-sysdep.h */ diff --git a/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c b/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c deleted file mode 100644 index ada7b3b8..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-thread-alloc.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Allocate kernel thread. Viengoos version. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <string.h> - -#include <hurd/startup.h> -#include <hurd/storage.h> -#include <hurd/as.h> -#include <hurd/addr.h> - -#include <pt-internal.h> - -extern struct hurd_startup_data *__hurd_startup_data; - -extern addr_t meta_data_activity; - -int -__pthread_thread_alloc (struct __pthread *thread) -{ - /* The main thread is already running of course. */ - if (__pthread_num_threads == 1) - { - thread->object = __hurd_startup_data->thread; - thread->threadid = l4_myself (); - return 0; - } - else - { - addr_t exception_area = as_alloc (EXCEPTION_AREA_SIZE_LOG2, 1, true); - - thread->exception_area_va - = ADDR_TO_PTR (addr_extend (exception_area, - 0, EXCEPTION_AREA_SIZE_LOG2)); - - int i; - for (i = 0; i < EXCEPTION_AREA_SIZE / PAGESIZE; i ++) - { - addr_t slot = addr_chop (PTR_TO_ADDR (thread->exception_area_va - + i * PAGESIZE), - PAGESIZE_LOG2); - as_ensure (slot); - - struct storage storage = storage_alloc (ADDR_VOID, cap_page, - STORAGE_LONG_LIVED, - OBJECT_POLICY_DEFAULT, - slot); - if (ADDR_IS_VOID (storage.addr)) - { - int j; - for (j = 0; j < i; j ++) - storage_free (thread->exception_area[j], false); - as_free (exception_area, false); - return EAGAIN; - } - - thread->exception_area[i] = storage.addr; - } - - struct storage storage; - storage = storage_alloc (meta_data_activity, cap_thread, - /* Threads are rarely shortly lived. */ - STORAGE_MEDIUM_LIVED, OBJECT_POLICY_DEFAULT, - ADDR_VOID); - if (ADDR_IS_VOID (storage.addr)) - { - int j; - for (j = 0; j < EXCEPTION_AREA_SIZE / PAGESIZE; j ++) - storage_free (thread->exception_area[j], false); - as_free (exception_area, false); - return EAGAIN; - } - - thread->object = storage.addr; - } - - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-thread-halt.c b/libpthread/sysdeps/l4/hurd/pt-thread-halt.c deleted file mode 100644 index 98fefaab..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-thread-halt.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Deallocate the kernel thread resources. Viengoos version. - Copyright (C) 2007, 2008 Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> - -#include <pt-internal.h> - -#include <hurd/exceptions.h> -#include <hurd/mutex.h> -#include <hurd/as.h> -#include <hurd/addr.h> - -/* If we try to deallocate our self, we will end up causing a - deadlock. Thus, when a thread tries to free itself, we add it - here. The next thread to free a thread will free it. */ -ss_mutex_t saved_object_lock; -static addr_t saved_object; - -void -__pthread_thread_halt (struct __pthread *thread, int need_dealloc) -{ - /* We may deallocate THREAD. First save any data we need. */ - - addr_t exception_area[EXCEPTION_AREA_SIZE / PAGESIZE]; - memcpy (exception_area, thread->exception_area, - sizeof (thread->exception_area)); - memset (thread->exception_area, 0, sizeof (thread->exception_area)); - - void *va = thread->exception_area_va; - - addr_t object = thread->object; - l4_thread_id_t tid = thread->threadid; - - if (need_dealloc) - __pthread_dealloc (thread); - - /* The THREAD data structure is no longer valid. */ - thread = NULL; - - /* Deallocate any saved object. */ - ss_mutex_lock (&saved_object_lock); - if (! ADDR_IS_VOID (saved_object)) - { - storage_free (saved_object, false); - saved_object = ADDR_VOID; - } - ss_mutex_unlock (&saved_object_lock); - - /* Free the exception area. */ - - /* Clean up the exception page. */ - exception_page_cleanup - (ADDR_TO_PTR (addr_extend (exception_area[EXCEPTION_PAGE], - 0, PAGESIZE_LOG2))); - - /* Free the storage. */ - int i; - for (i = 0; i < EXCEPTION_AREA_SIZE / PAGESIZE; i ++) - { - assert (! ADDR_IS_VOID (exception_area[i])); - storage_free (exception_area[i], false); - } - - /* And the address space. */ - as_free (addr_chop (PTR_TO_ADDR (va), EXCEPTION_AREA_SIZE_LOG2), false); - - if (tid == l4_myself ()) - /* If we try to storage_free (storage.addr), we will freeze in the - middle. That's no good. We set SAVED_OBJECT to our thread - object and the next thread in will free us. */ - { - ss_mutex_lock (&saved_object_lock); - saved_object = object; - ss_mutex_unlock (&saved_object_lock); - } - else - storage_free (object, false); - - if (tid == l4_myself ()) - { - l4_send_timeout (l4_myself (), L4_NEVER); - panic ("Failed to stop thread %x.%x!", - l4_thread_no (l4_myself ()), l4_version (l4_myself ())); - } - else - thread_stop (object); -} diff --git a/libpthread/sysdeps/l4/hurd/pt-thread-start.c b/libpthread/sysdeps/l4/hurd/pt-thread-start.c deleted file mode 100644 index 9db399ce..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-thread-start.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Start thread. L4 version. - Copyright (C) 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <string.h> -#include <hurd/thread.h> -#include <hurd/exceptions.h> - -#include <pt-internal.h> - -int -__pthread_thread_start (struct __pthread *thread) -{ - error_t err; - - if (__pthread_num_threads == 1) - /* The main thread is already running of course. */ - { - assert (__pthread_total == 1); - assert (l4_is_thread_equal (l4_myself (), thread->threadid)); - l4_set_user_defined_handle ((l4_word_t) thread); - } - else - { - struct hurd_thread_exregs_in in; - struct hurd_thread_exregs_out out; - - in.aspace = ADDR (0, 0); - in.aspace_cap_properties = CAP_PROPERTIES_VOID; - in.aspace_cap_properties_flags = CAP_COPY_COPY_SOURCE_GUARD; - - in.activity = ADDR_VOID; - - in.exception_page = addr_chop (PTR_TO_ADDR (thread->exception_area_va), - PAGESIZE_LOG2); - - in.sp = (l4_word_t) thread->mcontext.sp; - in.ip = (l4_word_t) thread->mcontext.pc; - - in.user_handle = (l4_word_t) thread; - err = rm_thread_exregs (ADDR_VOID, thread->object, - HURD_EXREGS_SET_ASPACE - | HURD_EXREGS_SET_ACTIVITY - | HURD_EXREGS_SET_EXCEPTION_PAGE - | HURD_EXREGS_SET_SP_IP - | HURD_EXREGS_SET_USER_HANDLE - | HURD_EXREGS_START - | HURD_EXREGS_ABORT_IPC, - in, &out); - assert (err == 0); - } - return 0; -} diff --git a/libpthread/sysdeps/l4/hurd/pt-wakeup.c b/libpthread/sysdeps/l4/hurd/pt-wakeup.c deleted file mode 100644 index e568a6f9..00000000 --- a/libpthread/sysdeps/l4/hurd/pt-wakeup.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Wakeup a thread. Viengoos version. - Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pt-internal.h> - -#include <hurd/stddef.h> -#include <hurd/futex.h> -#include <stdint.h> - -/* Wakeup THREAD. */ -void -__pthread_wakeup (struct __pthread *thread) -{ - /* We need to loop here as the blocked thread may not yet be - blocked! Here's what happens when a thread blocks: it registers - itself as blocked, drops the relevant lock and then actually - blocks (via __pthread_block). This means that after dropping the - lock and before blocking, it may be interrupted and another - thread may try to wake it. */ - long ret; - do - { - ret = futex_wake (&thread->threadid, INT_MAX); - assertx (ret <= 1, "tid: %x, ret: %d", thread->threadid, ret); - - if (ret == 0) - l4_thread_switch (thread->threadid); - } - while (ret == 0); -} diff --git a/libpthread/sysdeps/l4/hurd/sig-sysdep.h b/libpthread/sysdeps/l4/hurd/sig-sysdep.h deleted file mode 100644 index 33e13857..00000000 --- a/libpthread/sysdeps/l4/hurd/sig-sysdep.h +++ /dev/null @@ -1,69 +0,0 @@ -/* sig-sysdep.h - Hurd system specific header file. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <l4.h> -#include <string.h> - -struct utcb -{ - l4_word_t saved_sender; - l4_word_t saved_receiver; - l4_word_t saved_timeout; - l4_word_t saved_error_code; - l4_word_t saved_flags; - l4_word_t saved_br0; - l4_msg_t saved_message; -}; - -static inline void -utcb_state_save (struct utcb *buffer) -{ - l4_word_t *utcb = _L4_utcb (); - - buffer->saved_sender = utcb[_L4_UTCB_SENDER]; - buffer->saved_receiver = utcb[_L4_UTCB_RECEIVER]; - buffer->saved_timeout = utcb[_L4_UTCB_TIMEOUT]; - buffer->saved_error_code = utcb[_L4_UTCB_ERROR_CODE]; - buffer->saved_flags = utcb[_L4_UTCB_FLAGS]; - buffer->saved_br0 = utcb[_L4_UTCB_BR0]; - memcpy (&buffer->saved_message, - utcb, L4_NUM_MRS * sizeof (l4_word_t)); -} - -static inline void -utcb_state_restore (struct utcb *buffer) -{ - l4_word_t *utcb = _L4_utcb (); - - utcb[_L4_UTCB_SENDER] = buffer->saved_sender; - utcb[_L4_UTCB_RECEIVER] = buffer->saved_receiver; - utcb[_L4_UTCB_TIMEOUT] = buffer->saved_timeout; - utcb[_L4_UTCB_ERROR_CODE] = buffer->saved_error_code; - utcb[_L4_UTCB_FLAGS] = buffer->saved_flags; - utcb[_L4_UTCB_BR0] = buffer->saved_br0; - memcpy (utcb, &buffer->saved_message, - L4_NUM_MRS * sizeof (l4_word_t)); -} - -#define SIGNAL_DISPATCH_ENTRY \ - struct utcb buffer; utcb_state_save (&buffer); - -#define SIGNAL_DISPATCH_EXIT \ - utcb_state_restore (&buffer); diff --git a/libpthread/sysdeps/l4/hurd/sigprocmask.c b/libpthread/sysdeps/l4/hurd/sigprocmask.c deleted file mode 100644 index a38b3795..00000000 --- a/libpthread/sysdeps/l4/hurd/sigprocmask.c +++ /dev/null @@ -1,41 +0,0 @@ -/* sigprocmask.c - Generic sigprocmask implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <pt-internal.h> -#include <sig-internal.h> - -int -sigprocmask (int how, const sigset_t *restrict set, sigset_t *restrict old) -{ - struct __pthread *thread = _pthread_self (); - if (! thread) - /* Library is initializing. */ - { - assert (__pthread_num_threads == 1); - - /* We should get the default mask from the startup data structure. */ - if (old) - *old = 0; - - return 0; - } - - return pthread_sigmask (how, set, old); -} diff --git a/libpthread/sysdeps/l4/pt-block.c b/libpthread/sysdeps/l4/pt-block.c deleted file mode 100644 index 69e1d358..00000000 --- a/libpthread/sysdeps/l4/pt-block.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Block a thread. L4 version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> - -#include <pt-internal.h> - -#include <hurd/stddef.h> - -/* Block THREAD. */ -void -__pthread_block (struct __pthread *thread) -{ - debug (5, "%x.%x/%x blocking", - l4_thread_no (thread->threadid), l4_version (thread->threadid), - thread->threadid); - - l4_accept (L4_UNTYPED_WORDS_ACCEPTOR); - l4_msg_tag_t tag = l4_receive (l4_anythread); - if (l4_ipc_failed (tag)) - { - debug (1, "%x.%x failed to block: %d, offset: %x", - l4_thread_no (l4_myself ()), l4_version (l4_myself ()), - (l4_error_code () >> 1) & 0x7, - l4_error_code () >> 4); - assert (! l4_ipc_failed (tag)); - } - else - debug (5, "%x.%x unblocked", - l4_thread_no (thread->threadid), l4_version (thread->threadid)); -} diff --git a/libpthread/sysdeps/l4/pt-docancel.c b/libpthread/sysdeps/l4/pt-docancel.c deleted file mode 100644 index a3965d0d..00000000 --- a/libpthread/sysdeps/l4/pt-docancel.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Cancel a thread. - Copyright (C) 2002, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -static void -call_exit (void) -{ - pthread_exit (0); -} - -int -__pthread_do_cancel (struct __pthread *p) -{ - assert (p->cancel_pending == 1); - assert (p->cancel_state == PTHREAD_CANCEL_ENABLE); - - if (l4_is_thread_equal (l4_myself (), p->threadid)) - call_exit (); - else - l4_start_sp_ip (p->threadid, (l4_word_t) p->mcontext.sp, - (l4_word_t) call_exit); - return 0; -} diff --git a/libpthread/sysdeps/l4/pt-pool-np.c b/libpthread/sysdeps/l4/pt-pool-np.c deleted file mode 100644 index e83022ba..00000000 --- a/libpthread/sysdeps/l4/pt-pool-np.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Thread pool for L4 threads. - Copyright (C) 2004, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pt-internal.h> -#include <l4/thread.h> - -static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER; - -_L4_thread_id_t pool_list = l4_nilthread; - -/* Add the thread TID to the pthread kernel thread pool. */ -int -pthread_pool_add_np (l4_thread_id_t tid) -{ - __pthread_mutex_lock (&pool_lock); - /* FIXME: Do error checking. */ - l4_set_user_defined_handle_of (tid, pool_list); - pool_list = tid; - __pthread_mutex_unlock (&pool_lock); - - return 0; -} - - -/* Get the first thread from the pool. */ -l4_thread_id_t -pthread_pool_get_np (void) -{ - _L4_thread_id_t tid; - - __pthread_mutex_lock (&pool_lock); - /* FIXME: Do error checking. */ - tid = pool_list; - if (tid != l4_nilthread) - pool_list = l4_user_defined_handle_of (tid); - __pthread_mutex_unlock (&pool_lock); - return tid; -} diff --git a/libpthread/sysdeps/l4/pt-spin.c b/libpthread/sysdeps/l4/pt-spin.c deleted file mode 100644 index b6978b0c..00000000 --- a/libpthread/sysdeps/l4/pt-spin.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Spin locks. L4 version. - Copyright (C) 2000, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> - -#include <pthread.h> -#include <sched.h> - -/* The default for single processor machines; don't spin, it's - pointless. */ -#ifndef __PTHREAD_SPIN_COUNT -# define __PTHREAD_SPIN_COUNT 1 -#endif - -/* The number of times to spin while trying to lock a spin lock object - before yielding the processor. */ -int __pthread_spin_count = __PTHREAD_SPIN_COUNT; - - -/* Lock the spin lock object LOCK. If the lock is held by another - thread spin until it becomes available. */ -int -_pthread_spin_lock (__pthread_spinlock_t *lock) -{ - l4_time_t timeout; - int i; - - /* Start with a small timeout of 2 microseconds, then back off - exponentially. */ - timeout = l4_time_period (2); - - while (1) - { - for (i = 0; i < __pthread_spin_count; i++) - { - if (__pthread_spin_trylock (lock) == 0) - return 0; - } - l4_sleep (timeout); - - timeout = l4_time_mul2 (timeout); - if (timeout == L4_NEVER) - timeout = L4_TIME_PERIOD_MAX; - } -} - -weak_alias (_pthread_spin_lock, pthread_spin_lock); diff --git a/libpthread/sysdeps/l4/pt-stack-alloc.c b/libpthread/sysdeps/l4/pt-stack-alloc.c deleted file mode 100644 index b7ec12b4..00000000 --- a/libpthread/sysdeps/l4/pt-stack-alloc.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Allocate a new stack. L4 Hurd version. - Copyright (C) 2000, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> -#include <errno.h> - -#include <pt-internal.h> - -#include <sys/mman.h> - -/* Allocate a new stack of size STACKSIZE. If successful, store the - address of the newly allocated stack in *STACKADDR and return 0. - Otherwise return an error code (EINVAL for an invalid stack size, - EAGAIN if the system lacked the necessary resources to allocate a - new stack). */ -int -__pthread_stack_alloc (void **stackaddr, size_t stacksize) -{ - void *buffer = mmap (0, stacksize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (buffer == MAP_FAILED) - return EAGAIN; - - *stackaddr = buffer; - - return 0; -} diff --git a/libpthread/sysdeps/l4/pt-thread-alloc.c b/libpthread/sysdeps/l4/pt-thread-alloc.c deleted file mode 100644 index ec69afb5..00000000 --- a/libpthread/sysdeps/l4/pt-thread-alloc.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Allocate kernel thread. L4 version. - Copyright (C) 2003, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <string.h> - -#include <pt-internal.h> - -int -__pthread_thread_alloc (struct __pthread *thread) -{ - error_t err; - - /* The main thread is already running of course. */ - if (__pthread_num_threads == 1) - thread->threadid = l4_myself (); - else - { - thread->threadid = pthread_pool_get_np (); - if (thread->threadid != l4_nilthread) - return 0; - - return EAGAIN; - } - return 0; -} diff --git a/libpthread/sysdeps/l4/pt-thread-dealloc.c b/libpthread/sysdeps/l4/pt-thread-dealloc.c deleted file mode 100644 index c09e4860..00000000 --- a/libpthread/sysdeps/l4/pt-thread-dealloc.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Deallocate the kernel thread resources. L4 version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <l4.h> - -#include <pt-internal.h> - -/* Deallocate any kernel resources associated with THREAD except don't - halt the thread itself. On return, the thread will be marked as - dead and __pthread_halt will be called. */ -void -__pthread_thread_dealloc (struct __pthread *thread) -{ -} diff --git a/libpthread/sysdeps/l4/pt-thread-halt.c b/libpthread/sysdeps/l4/pt-thread-halt.c deleted file mode 100644 index aa2bf43d..00000000 --- a/libpthread/sysdeps/l4/pt-thread-halt.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Deallocate the kernel thread resources. L4version. - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> - -#include <pt-internal.h> - -/* Deallocate the kernel thread resources associated with THREAD. */ -void -__pthread_thread_halt (struct __pthread *thread, int need_dealloc) -{ - l4_thread_id_t tid = thread->threadid; - - if (need_dealloc) - __pthread_dealloc (thread); - - /* There is potential race here: once if TID is the current thread, - then once we add TID to the pool, someone can reallocate it - before we call stop. However, to start the thread, the caller - atomically starts and sets the sp and ip, thus, if the stop has - not yet executed at that point, it won't. */ - - if (tid != l4_myself ()) - l4_stop (tid); - pthread_pool_add_np (tid); - if (tid == l4_myself ()) - l4_stop (tid); -} diff --git a/libpthread/sysdeps/l4/pt-thread-start.c b/libpthread/sysdeps/l4/pt-thread-start.c deleted file mode 100644 index 144c58bb..00000000 --- a/libpthread/sysdeps/l4/pt-thread-start.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Start thread. L4 version. - Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <string.h> - -#include <pt-internal.h> - -/* Start THREAD. Get the kernel thread scheduled and running. */ -int -__pthread_thread_start (struct __pthread *thread) -{ - if (__pthread_num_threads == 1) - /* The main thread is already running of course. */ - { - assert (__pthread_total == 1); - assert (l4_is_thread_equal (l4_myself (), thread->threadid)); - } - else - l4_start_sp_ip (thread->threadid, (l4_word_t) thread->mcontext.sp, - (l4_word_t) thread->mcontext.pc); - return 0; -} diff --git a/libpthread/sysdeps/l4/pt-timedblock.c b/libpthread/sysdeps/l4/pt-timedblock.c deleted file mode 100644 index ce7972bd..00000000 --- a/libpthread/sysdeps/l4/pt-timedblock.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Block a thread with a timeout. L4 version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <time.h> -#include <sys/time.h> - -#include <pt-internal.h> - -/* Block THREAD. */ -error_t -__pthread_timedblock (struct __pthread *thread, - const struct timespec *abstime) -{ -#warning Need gettimeofday to implement properly. - __pthread_block (thread); - return 0; -} diff --git a/libpthread/sysdeps/l4/pt-wakeup.c b/libpthread/sysdeps/l4/pt-wakeup.c deleted file mode 100644 index de378465..00000000 --- a/libpthread/sysdeps/l4/pt-wakeup.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Wakeup a thread. L4 version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <l4.h> - -#include <pt-internal.h> - -#include <hurd/stddef.h> - -/* Wakeup THREAD. */ -void -__pthread_wakeup (struct __pthread *thread) -{ - debug (5, "%x.%x/%x waking %x.%x/%x", - l4_thread_no (l4_myself ()), l4_version (l4_myself ()), l4_myself (), - l4_thread_no (thread->threadid), l4_version (thread->threadid), - thread->threadid); - - /* Signal the waiter. */ - l4_msg_t msg; - l4_msg_clear (msg); - l4_msg_set_untyped_words (msg, 0); - l4_msg_load (msg); - - l4_msg_tag_t tag = l4_send (thread->threadid); - if (l4_ipc_failed (tag)) - { - int err = l4_error_code (); - debug (1, "%x.%x failed to wake %x.%x: %s (%d)", - l4_thread_no (l4_myself ()), l4_version (l4_myself ()), - l4_thread_no (thread->threadid), l4_version (thread->threadid), - l4_strerror (err), err); - } - else - debug (5, "%x.%x woke %x.%x", - l4_thread_no (l4_myself ()), l4_version (l4_myself ()), - l4_thread_no (thread->threadid), l4_version (thread->threadid)); -} diff --git a/libpthread/sysdeps/mach/bits/spin-lock-inline.h b/libpthread/sysdeps/mach/bits/spin-lock-inline.h deleted file mode 100644 index f9f7c299..00000000 --- a/libpthread/sysdeps/mach/bits/spin-lock-inline.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Definitions of user-visible names for spin locks. - Copyright (C) 1994, 1997, 2002, 2008, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _BITS_SPIN_LOCK_INLINE_H -#define _BITS_SPIN_LOCK_INLINE_H 1 - -#include <features.h> -#include <bits/spin-lock.h> -#include <machine-lock.h> /* This does all the work. */ - -__BEGIN_DECLS - -#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES - -# ifndef __EBUSY -# include <errno.h> -# define __EBUSY EBUSY -# endif - -# ifndef __PT_SPIN_INLINE -# define __PT_SPIN_INLINE __extern_inline -# endif - -__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_destroy (__pthread_spinlock_t *__lock) -{ - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock, - int __pshared); - -__PT_SPIN_INLINE int -__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared) -{ - *__lock = __PTHREAD_SPIN_LOCK_INITIALIZER; - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_trylock (__pthread_spinlock_t *__lock) -{ - return __spin_try_lock (__lock) ? 0 : __EBUSY; -} - -__extern_inline int __pthread_spin_lock (__pthread_spinlock_t *__lock); -extern int _pthread_spin_lock (__pthread_spinlock_t *__lock); - -__extern_inline int -__pthread_spin_lock (__pthread_spinlock_t *__lock) -{ - if (__pthread_spin_trylock (__lock)) - return _pthread_spin_lock (__lock); - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_unlock (__pthread_spinlock_t *__lock) -{ - __spin_unlock (__lock); - return 0; -} - -#endif /* Use extern inlines or force inlines. */ - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/mach/bits/spin-lock.h b/libpthread/sysdeps/mach/bits/spin-lock.h deleted file mode 100644 index 537dac9d..00000000 --- a/libpthread/sysdeps/mach/bits/spin-lock.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Definitions of user-visible names for spin locks. - Copyright (C) 1994, 1997, 2002, 2008, 2009 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _BITS_SPIN_LOCK_H -#define _BITS_SPIN_LOCK_H 1 - -#include <features.h> -#include <machine-lock.h> /* This does all the work. */ - -__BEGIN_DECLS - -/* The type of a spin lock object. */ -typedef __spin_lock_t __pthread_spinlock_t; - -/* Initializer for a spin lock object. */ -#ifndef __PTHREAD_SPIN_LOCK_INITIALIZER -#error __PTHREAD_SPIN_LOCK_INITIALIZER undefined: should be defined by <lock-intern.h>. -#endif - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/mach/hurd/ia32/pt-machdep.c b/libpthread/sysdeps/mach/hurd/ia32/pt-machdep.c deleted file mode 100644 index f3c8cf50..00000000 --- a/libpthread/sysdeps/mach/hurd/ia32/pt-machdep.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Machine dependent pthreads code. Hurd/i386 version. - Copyright (C) 2000, 2002, 2007 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <errno.h> - -#include <mach.h> -#include <mach/i386/thread_status.h> -#include <mach/i386/mach_i386.h> -#include <mach/mig_errors.h> -#include <mach/thread_status.h> - -#define HURD_TLS_DESC_DECL(desc, tcb) \ - struct descriptor desc = \ - { /* low word: */ \ - 0xffff /* limit 0..15 */ \ - | (((unsigned int) (tcb)) << 16) /* base 0..15 */ \ - , /* high word: */ \ - ((((unsigned int) (tcb)) >> 16) & 0xff) /* base 16..23 */ \ - | ((0x12 | 0x60 | 0x80) << 8) /* access = ACC_DATA_W|ACC_PL_U|ACC_P */ \ - | (0xf << 16) /* limit 16..19 */ \ - | ((4 | 8) << 20) /* granularity = SZ_32|SZ_G */ \ - | (((unsigned int) (tcb)) & 0xff000000) /* base 24..31 */ \ - } - -int -__thread_set_pcsptp (thread_t thread, - int set_ip, void *ip, - int set_sp, void *sp, - int set_tp, void *tp) -{ - error_t err; - struct i386_thread_state state; - mach_msg_type_number_t state_count; - - state_count = i386_THREAD_STATE_COUNT; - - err = __thread_get_state (thread, i386_REGS_SEGS_STATE, - (thread_state_t) &state, &state_count); - if (err) - return err; - - if (set_sp) - state.uesp = (unsigned int) sp; - if (set_ip) - state.eip = (unsigned int) ip; - if (set_tp) { - HURD_TLS_DESC_DECL(desc, tp); - int sel; - - asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0)); - if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */ - err = __i386_set_ldt (thread, sel, &desc, 1); - else - err = __i386_set_gdt (thread, &sel, desc); - if (err) - return err; - state.gs = sel; - } - - err = __thread_set_state (thread, i386_REGS_SEGS_STATE, - (thread_state_t) &state, - i386_THREAD_STATE_COUNT); - if (err) - return err; - - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/ia32/pt-setup.c b/libpthread/sysdeps/mach/hurd/ia32/pt-setup.c deleted file mode 100644 index 5420dc8e..00000000 --- a/libpthread/sysdeps/mach/hurd/ia32/pt-setup.c +++ /dev/null @@ -1,108 +0,0 @@ -/* Setup thread stack. Hurd/i386 version. - Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <stdint.h> -#include <assert.h> -#include <mach.h> - -#include <pt-internal.h> - -/* The stack layout used on the i386 is: - - ----------------- - | ARG | - ----------------- - | START_ROUTINE | - ----------------- - | 0 | - ----------------- - | | - | Fast TSD | - | | - ----------------- - - We need to reserve __hurd_threadvar_max `unsigned long int's' of - (fast) thread-specific data (TSD) for the Hurd. */ - -/* Set up the stack for THREAD, such that it appears as if - START_ROUTINE and ARG were passed to the new thread's entry-point. - Return the stack pointer for the new thread. */ -static void * -stack_setup (struct __pthread *thread, - void *(*start_routine)(void *), void *arg) -{ - error_t err; - uintptr_t *bottom, *top; - - /* Calculate the top of the new stack. */ - bottom = thread->stackaddr; - top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize); - - /* Next, make room for the TSDs. */ - top -= __hurd_threadvar_max; - - /* Save the self pointer. */ - top[_HURD_THREADVAR_THREAD] = (uintptr_t) thread; - - if (start_routine) - { - /* And then the call frame. */ - top -= 2; - top = (uintptr_t *) ((uintptr_t) top & ~0xf); - top[1] = (uintptr_t) arg; /* Argument to START_ROUTINE. */ - top[0] = (uintptr_t) start_routine; - *--top = 0; /* Fake return address. */ - } - - if (thread->guardsize) - { - err = __vm_protect (__mach_task_self (), (vm_address_t) bottom, - thread->guardsize, 0, 0); - assert_perror (err); - } - - return top; -} - -int -__pthread_setup (struct __pthread *thread, - void (*entry_point)(void *(*)(void *), void *), - void *(*start_routine)(void *), void *arg) -{ - error_t err; - mach_port_t ktid; - - thread->mcontext.pc = entry_point; - thread->mcontext.sp = stack_setup (thread, start_routine, arg); - - thread->tcb->self = thread->kernel_thread; - - ktid = __mach_thread_self (); - if (thread->kernel_thread != ktid) - { - err = __thread_set_pcsptp (thread->kernel_thread, - 1, thread->mcontext.pc, - 1, thread->mcontext.sp, - 1, thread->tcb); - assert_perror (err); - } - __mach_port_deallocate (__mach_task_self (), ktid); - - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c b/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c deleted file mode 100644 index 1225ed5b..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c +++ /dev/null @@ -1,35 +0,0 @@ -/* pthread_attr_setstackaddr. Hurd on Mach version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -/* We use fixed sized stacks which require proper alignment. */ -#define __pthread_stacksize __pthread_default_attr.stacksize - -int -pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr) -{ - if ((long) stackaddr & (__pthread_stacksize - 1)) - return EINVAL; - - attr->stackaddr = stackaddr; - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c b/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c deleted file mode 100644 index 6471c0a3..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c +++ /dev/null @@ -1,35 +0,0 @@ -/* pthread_attr_setstacksize. Hurd on Mach version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <pt-internal.h> - -/* We use fixed sized stacks which require proper alignment. */ -#define __pthread_stacksize __pthread_default_attr.stacksize - -int -pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize) -{ - if (stacksize != __pthread_stacksize) - return EINVAL; - - attr->stacksize = stacksize; - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-docancel.c b/libpthread/sysdeps/mach/hurd/pt-docancel.c deleted file mode 100644 index 105c6fda..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-docancel.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Cancel a thread. - Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -static void -call_exit (void) -{ - pthread_exit (0); -} - -int -__pthread_do_cancel (struct __pthread *p) -{ - mach_port_t ktid; - int me; - - assert (p->cancel_pending == 1); - assert (p->cancel_state == PTHREAD_CANCEL_ENABLE); - - ktid = __mach_thread_self (); - me = p->kernel_thread == ktid; - __mach_port_deallocate (__mach_task_self (), ktid); - - if (me) - call_exit (); - else - { - error_t err; - - err = __thread_suspend (p->kernel_thread); - assert_perror (err); - - err = __thread_abort (p->kernel_thread); - assert_perror (err); - - err = __thread_set_pcsptp (p->kernel_thread, - 1, (void *) call_exit, 0, 0, 0, 0); - assert_perror (err); - - err = __thread_resume (p->kernel_thread); - assert_perror (err); - } - - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c b/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c deleted file mode 100644 index 8e56c5cf..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Destroy the signal state. Hurd on Mach version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> - -#include <pt-internal.h> - -void -__pthread_sigstate_destroy (struct __pthread *thread) -{ - /* Nothing to do. */ -} diff --git a/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c b/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c deleted file mode 100644 index da5a9455..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Initialize the signal state. Hurd on Mach version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <hurd/threadvar.h> - -#include <pt-internal.h> - -error_t -__pthread_sigstate_init (struct __pthread *thread) -{ - void **location = - (void *) __hurd_threadvar_location_from_sp (_HURD_THREADVAR_SIGSTATE, - thread->stackaddr); - - /* The real initialization happens internally in glibc the first - time that _hurd_thead_sigstate is called. */ - *location = 0; - - return 0; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-sigstate.c b/libpthread/sysdeps/mach/hurd/pt-sigstate.c deleted file mode 100644 index 68c79c5b..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-sigstate.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Set a thread's signal state. Hurd on Mach version. - Copyright (C) 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <assert.h> -#include <signal.h> -#include <hurd/signal.h> - -#include <pt-internal.h> - -error_t -__pthread_sigstate (struct __pthread *thread, int how, - const sigset_t *set, sigset_t *oset, - int clear_pending) -{ - error_t err = 0; - struct hurd_sigstate *ss; - - ss = _hurd_thread_sigstate (thread->kernel_thread); - assert (ss); - - __pthread_spin_lock (&ss->lock); - - if (oset) - *oset = ss->blocked; - - if (set) - switch (how) - { - case SIG_BLOCK: - ss->blocked |= *set; - break; - - case SIG_SETMASK: - ss->blocked = *set; - break; - - case SIG_UNBLOCK: - ss->blocked &= ~*set; - break; - - default: - err = EINVAL; - break; - } - - if (! err && clear_pending) - __sigemptyset (&ss->pending); - - __pthread_spin_unlock (&ss->lock); - - return err; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-sysdep.c b/libpthread/sysdeps/mach/hurd/pt-sysdep.c deleted file mode 100644 index 5e070067..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-sysdep.c +++ /dev/null @@ -1,72 +0,0 @@ -/* System dependent pthreads code. Hurd version. - Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <stddef.h> -#include <stdint.h> - -#include <mach.h> -#include <mach/mig_support.h> - -#include <hurd/threadvar.h> - -#include <pt-internal.h> - -/* Forward. */ -static void *init_routine (void); - -/* OK, the name of this variable isn't really appropriate, but I don't - want to change it yet. */ -void *(*_cthread_init_routine)(void) = &init_routine; - -/* This function is called from the Hurd-specific startup code. It - should return a new stack pointer for the main thread. The caller - will switch to this new stack before doing anything serious. */ -static void * -init_routine (void) -{ - struct __pthread *thread; - int err; - - /* Initialize the library. */ - __pthread_initialize (); - - /* Create the pthread structure for the main thread (i.e. us). */ - err = __pthread_create_internal (&thread, 0, 0, 0); - assert_perror (err); - - ((void **) (__hurd_threadvar_stack_offset))[_HURD_THREADVAR_THREAD] - = thread; - - /* Decrease the number of threads, to take into account that the - signal thread (which will be created by the glibc startup code - when we return from here) shouldn't be seen as a user thread. */ - __pthread_total--; - - /* Make MiG code thread aware. */ - __mig_init (thread->stackaddr); - - /* Make sure we can find the per-thread variables. */ - __hurd_threadvar_stack_mask = ~(__pthread_default_attr.stacksize - 1); - __hurd_threadvar_stack_offset - = (__pthread_default_attr.stacksize - - __hurd_threadvar_max * sizeof (uintptr_t)); - - return thread->mcontext.sp; -} diff --git a/libpthread/sysdeps/mach/hurd/pt-sysdep.h b/libpthread/sysdeps/mach/hurd/pt-sysdep.h deleted file mode 100644 index 13e235d9..00000000 --- a/libpthread/sysdeps/mach/hurd/pt-sysdep.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Internal defenitions for pthreads library. - Copyright (C) 2000, 2002, 2007, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_SYSDEP_H -#define _PT_SYSDEP_H 1 - -#include <mach.h> - -#include <hurd/threadvar.h> - -/* XXX */ -#define _POSIX_THREAD_THREADS_MAX 64 - -/* The default stack size. */ -#define PTHREAD_STACK_DEFAULT (2 * 1024 * 1024) - -#define PTHREAD_SYSDEP_MEMBERS \ - thread_t kernel_thread; \ - mach_msg_header_t wakeupmsg; \ - int have_kernel_resources; - -#define _HURD_THREADVAR_THREAD _HURD_THREADVAR_DYNAMIC_USER - -#define _pthread_self() \ - ({ \ - struct __pthread *thread; \ - \ - assert (__pthread_threads); \ - thread = *(struct __pthread **) \ - __hurd_threadvar_location (_HURD_THREADVAR_THREAD); \ - \ - assert (thread); \ - assert (({ mach_port_t ktid = __mach_thread_self (); \ - int ok = thread->kernel_thread == ktid; \ - __mach_port_deallocate (__mach_task_self (), ktid);\ - ok; })); \ - thread; \ - }) - -extern inline void -__attribute__((__always_inline__)) -__pthread_stack_dealloc (void *stackaddr, size_t stacksize) -{ - __vm_deallocate (__mach_task_self (), (vm_offset_t) stackaddr, stacksize); -} - -/* Change thread THREAD's program counter to PC if SET_PC is true, - its stack pointer to SP if SET_IP is true, and its thread pointer - to TP if SET_TP is true. */ -extern int __thread_set_pcsptp (thread_t thread, - int set_pc, void *pc, - int set_sp, void *sp, - int set_tp, void *tp); - - -#endif /* pt-sysdep.h */ diff --git a/libpthread/sysdeps/mach/pt-block.c b/libpthread/sysdeps/mach/pt-block.c deleted file mode 100644 index a947b27c..00000000 --- a/libpthread/sysdeps/mach/pt-block.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Block a thread. Mach version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> - -#include <mach.h> -#include <mach/message.h> - -#include <pt-internal.h> - -/* Block THREAD. */ -void -__pthread_block (struct __pthread *thread) -{ - mach_msg_header_t msg; - error_t err; - - err = __mach_msg (&msg, MACH_RCV_MSG, 0, sizeof msg, - thread->wakeupmsg.msgh_remote_port, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - assert_perror (err); -} diff --git a/libpthread/sysdeps/mach/pt-spin.c b/libpthread/sysdeps/mach/pt-spin.c deleted file mode 100644 index d9a2a32a..00000000 --- a/libpthread/sysdeps/mach/pt-spin.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Spin locks. Mach version. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <machine-lock.h> - -/* In glibc. */ -extern void __spin_lock_solid (__pthread_spinlock_t *lock); - -/* Lock the spin lock object LOCK. If the lock is held by another - thread spin until it becomes available. */ -int -_pthread_spin_lock (__pthread_spinlock_t *lock) -{ - __spin_lock_solid (lock); - return 0; -} - -weak_alias (_pthread_spin_lock, pthread_spin_lock); -weak_alias (_pthread_spin_lock, __pthread_spin_lock); diff --git a/libpthread/sysdeps/mach/pt-stack-alloc.c b/libpthread/sysdeps/mach/pt-stack-alloc.c deleted file mode 100644 index 0956fc7d..00000000 --- a/libpthread/sysdeps/mach/pt-stack-alloc.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Allocate a new stack. Mach version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <errno.h> - -#include <mach.h> -#include <mach/machine/vm_param.h> - -#include <pt-internal.h> - -#define __pthread_stacksize __pthread_default_attr.stacksize - -/* The next address to use for stack allocation. */ -static vm_address_t next_stack_base = VM_MIN_ADDRESS; - - -/* Allocate a new stack of size STACKSIZE. If successful, store the - address of the newly allocated stack in *STACKADDR and return 0. - Otherwise return an error code (EINVAL for an invalid stack size, - EAGAIN if the system lacked the necessary resources to allocate a - new stack). */ -int -__pthread_stack_alloc (void **stackaddr, size_t stacksize) -{ - vm_offset_t base; - int i = 0; - - if (stacksize != __pthread_stacksize) - return EINVAL; - - get_stack: - i ++; - for (base = next_stack_base; - base < VM_MAX_ADDRESS - && __vm_allocate (__mach_task_self (), &base, - __pthread_stacksize, FALSE) != KERN_SUCCESS; - base += __pthread_stacksize) - ; - - if (base >= VM_MAX_ADDRESS) - { - if (i == 1) - { - next_stack_base = VM_MIN_ADDRESS; - goto get_stack; - } - else - return EAGAIN; - } - - if (base >= VM_MAX_ADDRESS) - return EAGAIN; - - next_stack_base = base + __pthread_stacksize; - - (*stackaddr) = (void *) base; - return 0; -} diff --git a/libpthread/sysdeps/mach/pt-thread-alloc.c b/libpthread/sysdeps/mach/pt-thread-alloc.c deleted file mode 100644 index 3d7c0465..00000000 --- a/libpthread/sysdeps/mach/pt-thread-alloc.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Start thread. Mach version. - Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <string.h> - -#include <mach.h> - -#include <pt-internal.h> - -/* Prepare a wakeup message. */ -static error_t -create_wakeupmsg (struct __pthread *thread) -{ - kern_return_t err; - - /* Build wakeup message. */ - thread->wakeupmsg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND, 0); - thread->wakeupmsg.msgh_size = 0; - - err = __mach_port_allocate (__mach_task_self (), MACH_PORT_RIGHT_RECEIVE, - &thread->wakeupmsg.msgh_remote_port); - if (err) - return EAGAIN; - - thread->wakeupmsg.msgh_local_port = MACH_PORT_NULL; - thread->wakeupmsg.msgh_seqno = 0; - thread->wakeupmsg.msgh_id = 0; - - err = __mach_port_insert_right (__mach_task_self (), - thread->wakeupmsg.msgh_remote_port, - thread->wakeupmsg.msgh_remote_port, - MACH_MSG_TYPE_MAKE_SEND); - if (err) - { - __mach_port_destroy (__mach_task_self (), - thread->wakeupmsg.msgh_remote_port); - return EAGAIN; - } - - return 0; -} - -/* Allocate any resouces for THREAD. The new kernel thread should not - be eligible to be scheduled. */ -int -__pthread_thread_alloc (struct __pthread *thread) -{ - if (thread->have_kernel_resources) - return 0; - - error_t err; - - err = create_wakeupmsg (thread); - if (err) - return err; - - /* If there are no pthreads in the system then the pthread library - is bootstrapping and the main thread must create initialize - itself. The thread itself is already running, it just has not - pthread context. We want to reuse what it already has (including - the kernel thread), however, we must determine which thread is - the main thread. - - We cannot test if __pthread_total is one as we later decrement - before creating the signal thread. Currently, we check if - __pthread_num_threads--the number of allocated thread - structures--is one. __pthread_alloc has already been called in - __pthread_create_internal for us. This predicate could be improved, - however, it is sufficient for now. */ - if (__pthread_num_threads == 1) - { - assert (__pthread_total == 0); - thread->kernel_thread = __mach_thread_self (); - /* We implicitly hold a reference drop the one that we just - acquired. */ - __mach_port_deallocate (__mach_task_self (), thread->kernel_thread); - } - else - { - err = __thread_create (__mach_task_self (), &thread->kernel_thread); - if (err) - return EAGAIN; - } - - thread->have_kernel_resources = 1; - - return 0; -} diff --git a/libpthread/sysdeps/mach/pt-thread-dealloc.c b/libpthread/sysdeps/mach/pt-thread-dealloc.c deleted file mode 100644 index 55d8c4d5..00000000 --- a/libpthread/sysdeps/mach/pt-thread-dealloc.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Deallocate the kernel thread resources. Mach version. - Copyright (C) 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <mach.h> - -#include <pt-internal.h> - -/* Deallocate any kernel resources associated with THREAD except don't - halt the thread itself. On return, the thread will be marked as - dead and __pthread_halt will be called. */ -void -__pthread_thread_dealloc (struct __pthread *thread) -{ - /* Why no assert? Easy. When Mach kills a task, it starts by - invalidating the task port and then terminating the threads one - by one. But while it is terminating them, they are still - eligible to be scheduled. Imagine we have two threads, one calls - exit, one calls pthread_exit. The second one may run this after - the mask port can been destroyed thus gratuitously triggering the - assert. */ - __mach_port_destroy (__mach_task_self (), - thread->wakeupmsg.msgh_remote_port); -} diff --git a/libpthread/sysdeps/mach/pt-thread-halt.c b/libpthread/sysdeps/mach/pt-thread-halt.c deleted file mode 100644 index 973cde1e..00000000 --- a/libpthread/sysdeps/mach/pt-thread-halt.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Deallocate the kernel thread resources. Mach version. - Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <mach.h> - -#include <pt-internal.h> - -/* Stop the kernel thread associated with THREAD. If NEED_DEALLOC is - true, the function must call __pthread_dealloc on THREAD. - - NB: The thread executing this function may be the thread which is - being halted, thus the last action should be halting the thread - itself. */ -void -__pthread_thread_halt (struct __pthread *thread) -{ - error_t err = __thread_terminate (thread->kernel_thread); - assert_perror (err); -} diff --git a/libpthread/sysdeps/mach/pt-thread-start.c b/libpthread/sysdeps/mach/pt-thread-start.c deleted file mode 100644 index 11b017ff..00000000 --- a/libpthread/sysdeps/mach/pt-thread-start.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Start thread. Mach version. - Copyright (C) 2000,02 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <mach.h> - -#include <pt-internal.h> - -/* Start THREAD. Get the kernel thread scheduled and running. */ -int -__pthread_thread_start (struct __pthread *thread) -{ - error_t err; - - if (__pthread_num_threads == 1) - { - /* The main thread is already running: do nothing. */ - assert (__pthread_total == 1); - assert (({ mach_port_t ktid = __mach_thread_self (); - int ok = thread->kernel_thread == ktid; - __mach_port_deallocate (__mach_task_self (), - thread->kernel_thread); - ok; })); - } - else - { - err = __thread_resume (thread->kernel_thread); - assert_perror (err); - } - - return 0; -} diff --git a/libpthread/sysdeps/mach/pt-timedblock.c b/libpthread/sysdeps/mach/pt-timedblock.c deleted file mode 100644 index 6f547265..00000000 --- a/libpthread/sysdeps/mach/pt-timedblock.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Block a thread with a timeout. Mach version. - Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> -#include <time.h> -#include <sys/time.h> - -#include <mach.h> -#include <mach/message.h> - -#include <pt-internal.h> - -/* Block THREAD. */ -error_t -__pthread_timedblock (struct __pthread *thread, - const struct timespec *abstime) -{ - error_t err; - mach_msg_header_t msg; - mach_msg_timeout_t timeout; - struct timeval now; - - /* We have an absolute time and now we have to convert it to a - relative time. Arg. */ - - err = gettimeofday(&now, NULL); - assert (! err); - - if (now.tv_sec > abstime->tv_sec - || (now.tv_sec == abstime->tv_sec - && now.tv_usec > ((abstime->tv_nsec + 999) / 1000))) - return ETIMEDOUT; - - timeout = (abstime->tv_sec - now.tv_sec) * 1000; - - if (((abstime->tv_nsec + 999) / 1000) >= now.tv_usec) - timeout += (((abstime->tv_nsec + 999) / 1000) - now.tv_usec + 999) / 1000; - else - /* Need to do a carry. */ - timeout -= (now.tv_usec + 999) / 1000 - - ((abstime->tv_nsec + 999999) / 1000000); - - err = __mach_msg (&msg, MACH_RCV_MSG | MACH_RCV_TIMEOUT, 0, - sizeof msg, thread->wakeupmsg.msgh_remote_port, - timeout, MACH_PORT_NULL); - if (err == EMACH_RCV_TIMED_OUT) - return ETIMEDOUT; - - assert_perror (err); - return 0; -} diff --git a/libpthread/sysdeps/mach/pt-wakeup.c b/libpthread/sysdeps/mach/pt-wakeup.c deleted file mode 100644 index 4920d102..00000000 --- a/libpthread/sysdeps/mach/pt-wakeup.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Wakeup a thread. Mach version. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <assert.h> -#include <errno.h> - -#include <mach.h> -#include <mach/message.h> - -#include <pt-internal.h> - -/* Wakeup THREAD. */ -void -__pthread_wakeup (struct __pthread *thread) -{ - error_t err; - - err = __mach_msg (&thread->wakeupmsg, MACH_SEND_MSG, - sizeof (thread->wakeupmsg), 0, MACH_PORT_NULL, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - assert_perror (err); -} diff --git a/libpthread/sysdeps/posix/pt-spin.c b/libpthread/sysdeps/posix/pt-spin.c deleted file mode 100644 index cb809c64..00000000 --- a/libpthread/sysdeps/posix/pt-spin.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Spin locks. - Copyright (C) 2000, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include <pthread.h> -#include <sched.h> - -/* The default for single processor machines; don't spin, it's - pointless. */ -#ifndef __PTHREAD_SPIN_COUNT -# define __PTHREAD_SPIN_COUNT 1 -#endif - -/* The number of times to spin while trying to lock a spin lock object - before yielding the processor. */ -int __pthread_spin_count = __PTHREAD_SPIN_COUNT; - - -/* Lock the spin lock object LOCK. If the lock is held by another - thread spin until it becomes available. */ -int -_pthread_spin_lock (__pthread_spinlock_t *lock) -{ - int i; - - while (1) - { - for (i = 0; i < __pthread_spin_count; i++) - { - if (__pthread_spin_trylock (lock) == 0) - return 0; - } - - __sched_yield (); - } -} - -weak_alias (_pthread_spin_lock, pthread_spin_lock); -weak_alias (_pthread_spin_lock, __pthread_spin_lock); diff --git a/libpthread/sysdeps/powerpc/bits/machine-lock.h b/libpthread/sysdeps/powerpc/bits/machine-lock.h deleted file mode 100644 index cba6b0a6..00000000 --- a/libpthread/sysdeps/powerpc/bits/machine-lock.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Machine-specific definition for spin locks. PowerPC version. - Copyright (C) 1994,97,2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_LOCK_H -#define _MACHINE_LOCK_H - -/* The type of a spin lock variable. */ - -typedef __volatile long int __spin_lock_t; - -/* Value to initialize `__spin_lock_t' variables to. */ - -#define __SPIN_LOCK_INITIALIZER 0L - - -#ifndef _EXTERN_INLINE -#define _EXTERN_INLINE extern __inline -#endif - -/* Unlock LOCK. */ - -_EXTERN_INLINE void -__spin_unlock (__spin_lock_t *__lock) -{ - long int __locked; - __asm__ __volatile__ ("\ -0: lwarx %0,0,%1\n\ - stwcx. %2,0,%1\n\ - bne- 0b\n\ -" : "=&r" (__locked) : "r" (__lock), "r" (0) : "cr0"); -} - -/* Try to lock LOCK; return nonzero if we locked it, zero if another has. */ - -_EXTERN_INLINE int -__spin_try_lock (register __spin_lock_t *__lock) -{ - long int __rtn; - __asm__ __volatile__ ("\ -0: lwarx %0,0,%1\n\ - stwcx. %2,0,%1\n\ - bne- 0b\n\ -" : "=&r" (__rtn) : "r" (__lock), "r" (1) : "cr0"); - return !__rtn; -} - -/* Return nonzero if LOCK is locked. */ - -_EXTERN_INLINE int -__spin_lock_locked (__spin_lock_t *__lock) -{ - long int __rtn; - __asm__ __volatile__ ("\ -0: lwarx %0,0,%1\n\ - stwcx. %0,0,%1\n\ - bne- 0b\n\ -" : "=&r" (__rtn) : "r" (__lock) : "cr0"); - return __rtn; -} - - -#endif /* machine-lock.h */ diff --git a/libpthread/sysdeps/powerpc/bits/memory.h b/libpthread/sysdeps/powerpc/bits/memory.h deleted file mode 100644 index 96624c3e..00000000 --- a/libpthread/sysdeps/powerpc/bits/memory.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Memory barrier operations. PowerPC version. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _BITS_MEMORY_H -#define _BITS_MEMORY_H 1 - -/* Prevent read and write reordering across this function. */ -inline void -__memory_barrier (void) -{ - asm ("sync" ::: "memory"); -} - -/* Prevent read reordering across this function. */ -#define __memory_read_barrier __memory_barrier - -/* Prevent write reordering across this function. */ -#define __memory_write_barrier __memory_barrier - -#endif diff --git a/libpthread/sysdeps/powerpc/bits/spin-lock.h b/libpthread/sysdeps/powerpc/bits/spin-lock.h deleted file mode 100644 index 1dc25710..00000000 --- a/libpthread/sysdeps/powerpc/bits/spin-lock.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Machine-specific definitions for spin locks. PowerPC version. - Copyright (C) 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_SPIN_LOCK_H -#define _BITS_SPIN_LOCK_H 1 - -#include <features.h> - -__BEGIN_DECLS - -/* The type of a spin lock object. */ -typedef __volatile int __pthread_spinlock_t; - -/* Initializer for a spin lock object. */ -# define __SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0) - -#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES - -# ifndef __EBUSY -# include <errno.h> -# define __EBUSY EBUSY -# endif - -# ifndef __PT_SPIN_INLINE -# define __PT_SPIN_INLINE extern __inline -# endif - -__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_destroy (__pthread_spinlock_t *__lock) -{ - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock, - int __pshared); - -__PT_SPIN_INLINE int -__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared) -{ - *__lock = __SPIN_LOCK_INITIALIZER; - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_trylock (__pthread_spinlock_t *__lock) -{ - long int __rtn; - __asm__ __volatile__ ("\ -0: lwarx %0,0,%1\n\ - stwcx. %2,0,%1\n\ - bne- 0b\n\ -" : "=&r" (__rtn) : "r" (__lock), "r" (1) : "cr0"); - return __rtn ? __EBUSY : 0; -} - -extern inline int __pthread_spin_lock (__pthread_spinlock_t *__lock); -extern int _pthread_spin_lock (__pthread_spinlock_t *__lock); - -extern inline int -__pthread_spin_lock (__pthread_spinlock_t *__lock) -{ - if (__pthread_spin_trylock (__lock)) - return _pthread_spin_lock (__lock); - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_unlock (__pthread_spinlock_t *__lock) -{ - long int __locked; - __asm__ __volatile__ ("\ -0: lwarx %0,0,%1\n\ - stwcx. %2,0,%1\n\ - bne- 0b\n\ -" : "=&r" (__locked) : "r" (__lock), "r" (0) : "cr0"); -} - -#endif /* Use extern inlines or force inlines. */ - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/powerpc/machine-sp.h b/libpthread/sysdeps/powerpc/machine-sp.h deleted file mode 100644 index aa787c59..00000000 --- a/libpthread/sysdeps/powerpc/machine-sp.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Machine-specific function to return the stack pointer. i386 version. - Copyright (C) 1994,97,2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_SP_H -#define _MACHINE_SP_H - -/* Return the current stack pointer. */ - -#define __thread_stack_pointer() ({ \ - void *__sp__; \ - __asm__ ("mr %0, 1" : "=r" (__sp__)); \ - __sp__; \ -}) - -#endif /* machine-sp.h */ diff --git a/libpthread/sysdeps/powerpc/pt-machdep.h b/libpthread/sysdeps/powerpc/pt-machdep.h deleted file mode 100644 index 6d456367..00000000 --- a/libpthread/sysdeps/powerpc/pt-machdep.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Machine dependent pthreads internal defenitions. i386 version. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PT_MACHDEP_H -#define _PT_MACHDEP_H 1 - -struct pthread_mcontext -{ - void *pc; - void *sp; -}; - -#endif /* pt-machdep.h */ diff --git a/libpthread/tests/.cvsignore b/libpthread/tests/.cvsignore deleted file mode 100644 index 70845e08..00000000 --- a/libpthread/tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.in diff --git a/libpthread/tests/Makefile b/libpthread/tests/Makefile deleted file mode 100644 index 5ebc01d3..00000000 --- a/libpthread/tests/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -CFLAGS=-Wall -g - -LDLIBS = -lpthread - -CHECK_SRC := test-1.c test-2.c test-3.c test-6.c test-7.c test-8.c \ - test-9.c test-10.c test-11.c test-12.c test-13.c test-14.c \ - test-15.c test-16.c test-17.c test-__pthread_destroy_specific-skip.c - -CHECK_OBJS := $(addsuffix .o,$(basename $(notdir $(CHECK_SRC)))) -CHECK_PROGS := $(basename $(notdir $(CHECK_SRC))) \ - $(addsuffix -static, $(basename $(CHECK_SRC))) - -%-static: %.o - $(CC) -static $(CFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) - -check: $(CHECK_OBJS) $(CHECK_PROGS) - for i in $(CHECK_PROGS); do \ - echo -n Running $$i...\ ; \ - if ./$$i 2>&1 > $$i.out; \ - then \ - echo Success.; \ - else \ - echo Failure.; \ - fi \ - done - -clean: - rm -f $(CHECK_OBJS) $(CHECK_PROGS) \ - $(addsuffix .out,$(basename $(notdir $(CHECK_PROGS))))
\ No newline at end of file diff --git a/libpthread/tests/test-1.c b/libpthread/tests/test-1.c deleted file mode 100644 index 6ec1afb3..00000000 --- a/libpthread/tests/test-1.c +++ /dev/null @@ -1,50 +0,0 @@ -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <unistd.h> -#include <error.h> -#include <errno.h> -#include <stdio.h> - -#define THREADS 500 - -void * -foo (void *arg) -{ - pthread_mutex_t *mutex = arg; - pthread_mutex_lock (mutex); - pthread_mutex_unlock (mutex); - return mutex; -} - -int -main (int argc, char **argv) -{ - int i; - error_t err; - pthread_t tid[THREADS]; - pthread_mutex_t mutex[THREADS]; - - for (i = 0; i < THREADS; i ++) - { - pthread_mutex_init (&mutex[i], 0); - pthread_mutex_lock (&mutex[i]); - err = pthread_create (&tid[i], 0, foo, &mutex[i]); - if (err) - error (1, err, "pthread_create"); - sched_yield (); - } - - for (i = THREADS - 1; i >= 0; i --) - { - void *ret; - pthread_mutex_unlock (&mutex[i]); - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - assert (ret == &mutex[i]); - } - - return 0; -} diff --git a/libpthread/tests/test-10.c b/libpthread/tests/test-10.c deleted file mode 100644 index bec05c14..00000000 --- a/libpthread/tests/test-10.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Test error checking mutexes. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> - -int -main (int argc, char **argv) -{ - error_t err; - pthread_mutexattr_t mattr; - pthread_mutex_t mutex; - - err = pthread_mutexattr_init (&mattr); - if (err) - error (1, err, "pthread_mutexattr_init"); - - err = pthread_mutexattr_settype (&mattr, PTHREAD_MUTEX_ERRORCHECK); - if (err) - error (1, err, "pthread_mutexattr_settype"); - - err = pthread_mutex_init (&mutex, &mattr); - if (err) - error (1, err, "pthread_mutex_init"); - - err = pthread_mutexattr_destroy (&mattr); - if (err) - error (1, err, "pthread_mutexattr_destroy"); - - err = pthread_mutex_lock (&mutex); - assert (err == 0); - - err = pthread_mutex_lock (&mutex); - assert (err == EDEADLK); - - err = pthread_mutex_unlock (&mutex); - assert (err == 0); - - err = pthread_mutex_unlock (&mutex); - assert (err == EPERM); - - return 0; -} diff --git a/libpthread/tests/test-11.c b/libpthread/tests/test-11.c deleted file mode 100644 index de779a40..00000000 --- a/libpthread/tests/test-11.c +++ /dev/null @@ -1,143 +0,0 @@ -/* Test rwlocks. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> - -#define THREADS 1 - -int a; -int b; - -/* Get a read lock and assert that a == b. */ -void * -test1 (void *arg) -{ - error_t err; - pthread_rwlock_t *lock = arg; - int i; - - for (i = 0; i < 200; i ++) - { - err = pthread_rwlock_rdlock (lock); - assert (err == 0); - - assert (a == b); - - sched_yield (); - - assert (a == b); - - err = pthread_rwlock_unlock (lock); - assert (err == 0); - } - - return 0; -} - -int -main (int argc, char **argv) -{ - error_t err; - pthread_rwlockattr_t attr; - pthread_rwlock_t lock; - int pshared; - - int i; - pthread_t tid[THREADS]; - void *ret; - - err = pthread_rwlockattr_init (&attr); - if (err) - error (1, err, "pthread_rwlockattr_init"); - - err = pthread_rwlockattr_getpshared (&attr, &pshared); - if (err) - error (1, err, "pthread_rwlockattr_getpshared"); - - /* Assert the default state as mandated by POSIX. */ - assert (pshared == PTHREAD_PROCESS_PRIVATE); - - err = pthread_rwlockattr_setpshared (&attr, pshared); - if (err) - error (1, err, "pthread_rwlockattr_setpshared"); - - err = pthread_rwlock_init (&lock, &attr); - if (err) - error (1, err, "pthread_rwlock_init"); - - err = pthread_rwlockattr_destroy (&attr); - if (err) - error (1, err, "pthread_rwlockattr_destroy"); - - /* Now test the lock. */ - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, test1, &lock); - if (err) - error (1, err, "pthread_create"); - } - - for (i = 0; i < 10; i ++) - { - sched_yield (); - - /* Get a write lock. */ - pthread_rwlock_wrlock (&lock); - /* Increment a and b giving other threads a chance to run in - between. */ - sched_yield (); - a ++; - sched_yield (); - b ++; - sched_yield (); - /* Unlock. */ - pthread_rwlock_unlock (&lock); - } - - for (i = 0; i < THREADS; i ++) - { - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - } - - /* Read lock it. */ - err = pthread_rwlock_tryrdlock (&lock); - assert (err == 0); - - /* Try to write lock it. It should fail with EBUSY. */ - err = pthread_rwlock_trywrlock (&lock); - assert (err == EBUSY); - - /* Drop the read lock. */ - err = pthread_rwlock_unlock (&lock); - assert (err == 0); - - /* Get a write lock. */ - err = pthread_rwlock_trywrlock (&lock); - assert (err == 0); - - /* Fail trying to acquire another write lock. */ - err = pthread_rwlock_trywrlock (&lock); - assert (err == EBUSY); - - /* Try to get a read lock which should also fail. */ - err = pthread_rwlock_tryrdlock (&lock); - assert (err == EBUSY); - - /* Unlock it. */ - err = pthread_rwlock_unlock (&lock); - assert (err == 0); - - - err = pthread_rwlock_destroy (&lock); - if (err) - error (1, err, "pthread_rwlock_destroy"); - - return 0; -} diff --git a/libpthread/tests/test-12.c b/libpthread/tests/test-12.c deleted file mode 100644 index 2b784908..00000000 --- a/libpthread/tests/test-12.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Test concurrency level. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> - -int -main (int argc, char **argv) -{ - int i; - int err; - - i = pthread_getconcurrency (); - assert (i == 0); - - err = pthread_setconcurrency (-1); - assert (err == EINVAL); - - err = pthread_setconcurrency (4); - assert (err == 0); - - i = pthread_getconcurrency (); - assert (i == 4); - - return 0; -} diff --git a/libpthread/tests/test-13.c b/libpthread/tests/test-13.c deleted file mode 100644 index 13b09051..00000000 --- a/libpthread/tests/test-13.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Test condition attributes and pthread_cond_timedwait. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <stdio.h> -#include <assert.h> -#include <error.h> -#include <errno.h> -#include <sys/time.h> - -int -main (int argc, char **argv) -{ - error_t err; - int i; - pthread_condattr_t attr; - pthread_cond_t cond; - struct timespec ts; - pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; - struct timeval before, after; - int diff; - - err = pthread_condattr_init (&attr); - if (err) - error (1, err, "pthread_condattr_init"); - - err = pthread_condattr_getpshared (&attr, &i); - if (err) - error (1, err, "pthread_condattr_getpshared"); - assert (i == PTHREAD_PROCESS_PRIVATE); - - err = pthread_condattr_setpshared (&attr, PTHREAD_PROCESS_PRIVATE); - assert (err == 0); - - err = pthread_cond_init (&cond, &attr); - if (err) - error (1, err, "pthread_cond_init"); - - err = pthread_condattr_destroy (&attr); - if (err) - error (1, err, "pthread_condattr_destroy"); - - gettimeofday (&before, 0); - ts.tv_sec = before.tv_sec + 1; - ts.tv_nsec = before.tv_usec * 1000; - - printf ("Starting wait @ %d\n", (int) before.tv_sec); - - pthread_mutex_lock (&m); - err = pthread_cond_timedwait (&cond, &m, &ts); - - gettimeofday (&after, 0); - - printf ("End wait @ %d (err = %d)\n", (int) after.tv_sec, err); - - assert (err == ETIMEDOUT); - - diff = after.tv_sec * 1000000 + after.tv_usec - - before.tv_sec * 1000000 - before.tv_usec; - - if (diff < 900000 || diff > 1100000) - error (1, EGRATUITOUS, "pthread_cond_timedwait waited %d us", diff); - - return 0; -} diff --git a/libpthread/tests/test-14.c b/libpthread/tests/test-14.c deleted file mode 100644 index b1dbfa66..00000000 --- a/libpthread/tests/test-14.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Test pthread_mutex_timedlock. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <stdio.h> -#include <assert.h> -#include <error.h> -#include <errno.h> -#include <sys/time.h> - -int -main (int argc, char **argv) -{ - error_t err; - struct timespec ts; - pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; - struct timeval before, after; - int diff; - - gettimeofday (&before, 0); - ts.tv_sec = before.tv_sec + 1; - ts.tv_nsec = before.tv_usec * 1000; - - printf ("Starting wait @ %d\n", (int) before.tv_sec); - - pthread_mutex_lock (&m); - /* A default mutex shall dead lock if locked twice. As such we do - not need spawn a second thread. */ - err = pthread_mutex_timedlock (&m, &ts); - assert (err == ETIMEDOUT); - - gettimeofday (&after, 0); - - printf ("End wait @ %d\n", (int) after.tv_sec); - - diff = after.tv_sec * 1000000 + after.tv_usec - - before.tv_sec * 1000000 - before.tv_usec; - - if (diff < 900000 || diff > 1100000) - error (1, EGRATUITOUS, "pthread_mutex_timedlock waited %d us", diff); - - return 0; -} diff --git a/libpthread/tests/test-15.c b/libpthread/tests/test-15.c deleted file mode 100644 index 173f8b6b..00000000 --- a/libpthread/tests/test-15.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Test pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <stdio.h> -#include <assert.h> -#include <error.h> -#include <errno.h> -#include <sys/time.h> - -#define THREADS 10 - -pthread_rwlock_t rwlock; - -void * -test (void *arg) -{ - error_t err; - int foo = (int) arg; - struct timespec ts; - struct timeval before, after; - int diff; - - gettimeofday (&before, 0); - ts.tv_sec = before.tv_sec + 1; - ts.tv_nsec = before.tv_usec * 1000; - - printf ("Thread %d starting wait @ %d\n", pthread_self (), - (int) before.tv_sec); - - if (foo % 2 == 0) - err = pthread_rwlock_timedrdlock (&rwlock, &ts); - else - err = pthread_rwlock_timedwrlock (&rwlock, &ts); - - assert (err == ETIMEDOUT); - - gettimeofday (&after, 0); - - printf ("Thread %d ending wait @ %d\n", pthread_self (), - (int) after.tv_sec); - - diff = after.tv_sec * 1000000 + after.tv_usec - - before.tv_sec * 1000000 - before.tv_usec; - - if (diff < 900000 || diff > 1100000) - error (1, EGRATUITOUS, "pthread_mutex_timedlock waited %d us", diff); - - return 0; -} - -int -main (int argc, char **argv) -{ - error_t err; - int i; - pthread_t tid[THREADS]; - - err = pthread_rwlock_init (&rwlock, 0); - if (err) - error (1, err, "pthread_rwlock_init"); - - /* Lock it so all the threads will block. */ - err = pthread_rwlock_wrlock (&rwlock); - assert (err == 0); - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, test, (void *) i); - if (err) - error (1, err, "pthread_create"); - } - - for (i = 0; i < THREADS; i ++) - { - void *ret; - - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - - assert (ret == 0); - } - - return 0; -} diff --git a/libpthread/tests/test-16.c b/libpthread/tests/test-16.c deleted file mode 100644 index 3660f5f7..00000000 --- a/libpthread/tests/test-16.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Test pthread_kill.c. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <signal.h> -#include <stdio.h> -#include <assert.h> -#include <error.h> -#include <errno.h> -#include <hurd/signal.h> - -pthread_t testthread; - -int i; - -void * -test (void *arg) -{ - error_t err; - - printf ("test: %d\n", pthread_self ()); - - err = pthread_kill (pthread_self (), SIGINFO); - if (err) - error (1, err, "pthread_kill"); - - /* To avoid using condition variables in a signal handler. */ - while (i == 0) - sched_yield (); - - return 0; -} - -static void -handler (int sig) -{ - assert (pthread_equal (pthread_self (), testthread)); - printf ("handler: %d\n", pthread_self ()); - i = 1; -} - -int -main (int argc, char **argv) -{ - error_t err; - struct sigaction sa; - void *ret; - - printf ("main: %d\n", pthread_self ()); - - sa.sa_handler = handler; - sa.sa_mask = 0; - sa.sa_flags = 0; - - err = sigaction (SIGINFO, &sa, 0); - if (err) - error (1, err, "sigaction"); - - err = pthread_create (&testthread, 0, test, 0); - if (err) - error (1, err, "pthread_create"); - - err = pthread_join (testthread, &ret); - if (err) - error (1, err, "pthread_join"); - - assert (ret == 0); - - return 0; -} diff --git a/libpthread/tests/test-2.c b/libpthread/tests/test-2.c deleted file mode 100644 index 701462e8..00000000 --- a/libpthread/tests/test-2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Test detachability. */ -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> -#include <unistd.h> - -void * -thread (void *arg) -{ - while (1) - sched_yield (); -} - -int -main (int argc, char **argv) -{ - int err; - pthread_t tid; - void *ret; - - err = pthread_create (&tid, 0, thread, 0); - if (err) - error (1, err, "pthread_create"); - - err = pthread_detach (tid); - if (err) - error (1, err, "pthread_detach"); - - err = pthread_detach (tid); - assert (err == EINVAL); - - err = pthread_join (tid, &ret); - assert (err == EINVAL); - - return 0; -} diff --git a/libpthread/tests/test-3.c b/libpthread/tests/test-3.c deleted file mode 100644 index 7db2e43f..00000000 --- a/libpthread/tests/test-3.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Test the thread attribute get and set methods. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <sched.h> -#include <assert.h> -#include <errno.h> - -int -main (int argc, char *argv[]) -{ - error_t err; - pthread_attr_t attr; - - int i; - struct sched_param sp; - void *p; - size_t sz; - - err = pthread_attr_init (&attr); - assert_perror (err); - - err = pthread_attr_destroy (&attr); - assert_perror (err); - - err = pthread_attr_init (&attr); - assert_perror (err); - -#define TEST1(foo, rv, v) \ - err = pthread_attr_get##foo (&attr, rv); \ - assert_perror (err); \ - \ - err = pthread_attr_set##foo (&attr, v); \ - assert_perror (err); - -#define TEST(foo, rv, v) TEST1(foo, rv, v) - - TEST(inheritsched, &i, i); - TEST(schedparam, &sp, &sp); - TEST(schedpolicy, &i, i); - TEST(scope, &i, i); - TEST(stackaddr, &p, p); - TEST(detachstate, &i, i); - TEST(guardsize, &sz, sz); - TEST(stacksize, &sz, sz); - - err = pthread_attr_getstack (&attr, &p, &sz); - assert_perror (err); - - err = pthread_attr_setstack (&attr, p, sz); - assert_perror (err); - - return 0; -} diff --git a/libpthread/tests/test-4.c b/libpthread/tests/test-4.c deleted file mode 100644 index de9c8fe4..00000000 --- a/libpthread/tests/test-4.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Test the stack guard. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <unistd.h> -#include <errno.h> -#include <string.h> -#include <stdio.h> - -size_t stacksize; - -void * -thr (void *arg) -{ - int i; - char *foo; - - foo = alloca (3 * stacksize / 4); - for (i = 0; i < sizeof foo; i ++) - foo[i] = -1; - - return (void *) 1; -} - -int -main (int argc, char *argv[]) -{ - error_t err; - pid_t child; - - child = fork (); - switch (child) - { - case -1: - error (1, errno, "fork"); - break; - - case 0: - { - pthread_attr_t attr; - pthread_t tid; - void *ret; - - err = pthread_attr_init (&attr); - assert_perror (err); - - err = pthread_attr_getstacksize (&attr, &stacksize); - assert_perror (err); - - err = pthread_attr_setguardsize (&attr, stacksize / 2); - if (err == ENOTSUP) - { - printf ("Stack guard attribute not supported.\n"); - return 1; - } - assert_perror (err); - - err = pthread_create (&tid, &attr, thr, 0); - assert_perror (err); - - err = pthread_attr_destroy (&attr); - assert_perror (err); - - err = pthread_join (tid, &ret); - /* Should never be successful. */ - printf ("Thread did not segfault!?!\n"); - assert_perror (err); - return 0; - } - - default: - { - pid_t pid; - int status; - - pid = waitpid (child, &status, 0); - printf ("pid = %d; child = %d; status = %d\n", pid, child, status); - assert (pid == child); - assert (status != 0); - } - } - - return 0; -} diff --git a/libpthread/tests/test-5.c b/libpthread/tests/test-5.c deleted file mode 100644 index 0f5000b2..00000000 --- a/libpthread/tests/test-5.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Test signals. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <unistd.h> -#include <stdio.h> -#include <errno.h> -#include <error.h> -#include <assert.h> -#include <sys/resource.h> -#include <sys/wait.h> - -void * -thr (void *arg) -{ - * (int *)0 = 0; - return 0; -} - -int foobar; - -int -main (int argc, char *argv[]) -{ - error_t err; - pid_t child; - - struct rlimit limit; - - limit.rlim_cur = 0; - limit.rlim_max = 0; - - err = setrlimit (RLIMIT_CORE, &limit); - if (err) - error (1, err, "setrlimit"); - - child = fork (); - switch (child) - { - case -1: - error (1, errno, "fork"); - break; - - case 0: - { - pthread_t tid; - void *ret; - - err = pthread_create (&tid, 0, thr, 0); - if (err) - error (1, err, "pthread_create"); - - err = pthread_join (tid, &ret); - assert_perror (err); - - /* Should have never returned. Our parent expects us to fail - thus we succeed and indicate the error. */ - return 0; - } - - default: - { - pid_t pid; - int status; - - pid = waitpid (child, &status, 0); - printf ("pid = %d; child = %d; status = %d\n", pid, child, status); - assert (pid == child); - assert (status != 0); - } - } - - return 0; -} diff --git a/libpthread/tests/test-6.c b/libpthread/tests/test-6.c deleted file mode 100644 index edf2919e..00000000 --- a/libpthread/tests/test-6.c +++ /dev/null @@ -1,96 +0,0 @@ -#define _GNU_SOURCE - -#include <pthread.h> -#include <stdio.h> -#include <error.h> -#include <assert.h> -#include <errno.h> - -#define THREADS 500 -#define WAITS 3 - -void * -dowait (void *arg) -{ - pthread_barrier_t *barrier = arg; - int ret; - - ret = pthread_barrier_wait (barrier); - printf ("%d ", pthread_self ()); - return (void *) ret; -} - -int -main (int argc, char **argv) -{ - pthread_barrierattr_t attr; - pthread_barrier_t barrier; - - int i, j; - error_t err; - pthread_t tid[THREADS]; - - int havesyncs; - - err = pthread_barrierattr_init (&attr); - if (err) - error (1, err, "pthread_barrierattr_init"); - - err = pthread_barrierattr_getpshared (&attr, &i); - if (err) - error (1, err, "pthread_barrierattr_getpshared"); - assert (i == PTHREAD_PROCESS_PRIVATE || i == PTHREAD_PROCESS_SHARED); - - err = pthread_barrierattr_setpshared (&attr, PTHREAD_PROCESS_PRIVATE); - if (err) - error (1, err, "pthread_barrierattr_setpshared"); - - err = pthread_barrier_init (&barrier, &attr, THREADS + 1); - if (err) - error (1, err, "pthread_barrier_init"); - - for (j = 0; j < WAITS; j ++) - { - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, dowait, &barrier); - if (err) - error (1, err, "pthread_create (%d)", i); - } - - printf ("Manager will now call pthread_barrier_wait.\n"); - - havesyncs - = pthread_barrier_wait (&barrier) == PTHREAD_BARRIER_SERIAL_THREAD - ? 1 : 0; - - for (i = THREADS - 1; i >= 0; i --) - { - void *ret; - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - - switch ((int) ret) - { - case 0: - break; - - case PTHREAD_BARRIER_SERIAL_THREAD: - havesyncs ++; - break; - - default: - assert (! "Unknown value returned from pthread_barrier_wait."); - break; - } - } - - printf ("\n"); - - assert (havesyncs == 1); - } - - return 0; -} diff --git a/libpthread/tests/test-7.c b/libpthread/tests/test-7.c deleted file mode 100644 index 22fb1caa..00000000 --- a/libpthread/tests/test-7.c +++ /dev/null @@ -1,70 +0,0 @@ -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <stdio.h> -#include <error.h> -#include <errno.h> - -#define THREADS 10 -#define KEYS 400 - -pthread_key_t key[KEYS]; - -void * -thr (void *arg) -{ - error_t err; - int i; - - for (i = 0; i < KEYS; i ++) - { - printf ("pthread_getspecific(%d).\n", key[i]); - assert (pthread_getspecific (key[i]) == NULL); - printf ("pthread_setspecific(%d, %d).\n", key[i], pthread_self ()); - err = pthread_setspecific (key[i], (void *) pthread_self ()); - printf ("pthread_setspecific(%d, %d) => %d.\n", key[i], pthread_self (), err); - assert_perror (err); - } - - return 0; -} - -int -main (int argc, char **argv) -{ - error_t err; - int i; - pthread_t tid[THREADS]; - - void des (void *val) - { - assert ((pthread_t) val == pthread_self ()); - } - - assert (pthread_getspecific ((pthread_key_t) 0) == NULL); - assert (pthread_setspecific ((pthread_key_t) 0, (void *) 0x1) == EINVAL); - - for (i = 0; i < KEYS; i ++) - err = pthread_key_create (&key[i], des); - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, thr, 0); - if (err) - error (1, err, "pthread_create (%d)", i); - } - - for (i = 0; i < THREADS; i ++) - { - void *ret; - - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - - assert (ret == 0); - } - - return 0; -} diff --git a/libpthread/tests/test-8.c b/libpthread/tests/test-8.c deleted file mode 100644 index 85a7f8f6..00000000 --- a/libpthread/tests/test-8.c +++ /dev/null @@ -1,60 +0,0 @@ -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> - -#define THREADS 10 - -pthread_once_t inc_var_once = PTHREAD_ONCE_INIT; -int var; - -void -inc_var (void) -{ - var ++; -} - -void * -thr (void *arg) -{ - int i; - - for (i = 0; i < 500; i ++) - pthread_once (&inc_var_once, inc_var); - - return 0; -} - -int -main (int argc, char **argv) -{ - error_t err; - int i; - pthread_t tid[THREADS]; - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, thr, 0); - if (err) - error (1, err, "pthread_create (%d)", i); - } - - assert (thr (0) == 0); - - for (i = 0; i < THREADS; i ++) - { - void *ret; - - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - - assert (ret == 0); - } - - assert (var == 1); - - return 0; -} diff --git a/libpthread/tests/test-9.c b/libpthread/tests/test-9.c deleted file mode 100644 index 82051570..00000000 --- a/libpthread/tests/test-9.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Test recursive mutexes. */ - -#define _GNU_SOURCE - -#include <pthread.h> -#include <assert.h> -#include <error.h> -#include <errno.h> - -#define THREADS 10 - -int foo; - -void * -thr (void *arg) -{ - int i; - - pthread_mutex_lock (arg); - - foo = pthread_self (); - - for (i = 0; i < 500; i ++) - pthread_mutex_lock (arg); - for (i = 0; i < 500; i ++) - pthread_mutex_unlock (arg); - - assert (foo == pthread_self ()); - - pthread_mutex_unlock (arg); - - return 0; -} - -int -main (int argc, char **argv) -{ - error_t err; - int i; - pthread_t tid[THREADS]; - pthread_mutexattr_t mattr; - pthread_mutex_t mutex; - - err = pthread_mutexattr_init (&mattr); - if (err) - error (1, err, "pthread_mutexattr_init"); - - err = pthread_mutexattr_settype (&mattr, PTHREAD_MUTEX_RECURSIVE); - if (err) - error (1, err, "pthread_mutexattr_settype"); - - err = pthread_mutex_init (&mutex, &mattr); - if (err) - error (1, err, "pthread_mutex_init"); - - err = pthread_mutexattr_destroy (&mattr); - if (err) - error (1, err, "pthread_mutexattr_destroy"); - - pthread_mutex_lock (&mutex); - pthread_mutex_lock (&mutex); - pthread_mutex_unlock (&mutex); - pthread_mutex_unlock (&mutex); - - for (i = 0; i < THREADS; i ++) - { - err = pthread_create (&tid[i], 0, thr, &mutex); - if (err) - error (1, err, "pthread_create (%d)", i); - } - - for (i = 0; i < THREADS; i ++) - { - void *ret; - - err = pthread_join (tid[i], &ret); - if (err) - error (1, err, "pthread_join"); - - assert (ret == 0); - } - - err = pthread_mutex_destroy (&mutex); - if (err) - error (1, err, "pthread_mutex_destroy"); - - return 0; -} diff --git a/tests/test-17.c b/tests/test-17.c deleted file mode 100644 index a8bd1503..00000000 --- a/tests/test-17.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Test that the key reuse inside libpthread does not cause thread - specific values to persist. */ - -#define _GNU_SOURCE 1 - -#include <pthread.h> -#include <stdio.h> -#include <assert.h> -#include <errno.h> - -void -work (int iter) -{ - error_t err; - pthread_key_t key1; - pthread_key_t key2; - void *value1; - void *value2; - - printf ("work/%d: start\n", iter); - err = pthread_key_create (&key1, NULL); - assert (err == 0); - err = pthread_key_create (&key2, NULL); - assert (err == 0); - - value1 = pthread_getspecific (key1); - value2 = pthread_getspecific (key2); - printf ("work/%d: pre-setspecific: %p,%p\n", iter, value1, value2); - assert (value1 == NULL); - assert (value2 == NULL); - err = pthread_setspecific (key1, (void *)(0x100 + iter)); - assert (err == 0); - err = pthread_setspecific (key2, (void *)(0x200 + iter)); - assert (err == 0); - - value1 = pthread_getspecific (key1); - value2 = pthread_getspecific (key2); - printf ("work/%d: post-setspecific: %p,%p\n", iter, value1, value2); - assert (value1 == (void *)(0x100 + iter)); - assert (value2 == (void *)(0x200 + iter)); - - err = pthread_key_delete (key1); - assert (err == 0); - err = pthread_key_delete (key2); - assert (err == 0); -} - -int -main (int argc, char *argv[]) -{ - int i; - - for (i = 0; i < 8; ++i) - work (i + 1); - - return 0; -} diff --git a/tests/test-__pthread_destroy_specific-skip.c b/tests/test-__pthread_destroy_specific-skip.c deleted file mode 100644 index b2c4c0bd..00000000 --- a/tests/test-__pthread_destroy_specific-skip.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Check that __pthread_destroy_specific works correctly if it has to skip - unused slots. */ - -#define _GNU_SOURCE - -#include <error.h> -#include <pthread.h> -#include <stdio.h> - - -#define N_k 42 - -static volatile int v; - -static void -d (void *x) -{ - int *i = (int *) x; - - if (v != *i) - error (1, 0, "FAILED %d %d", v, *i); - v += 2; - - printf ("%s %d\n", __FUNCTION__, *i); - fflush (stdout); -} - -static void * -test (void *x) -{ - pthread_key_t k[N_k]; - static int k_v[N_k]; - - int err, i; - - for (i = 0; i < N_k; i += 1) - { - err = pthread_key_create (&k[i], &d); - if (err != 0) - error (1, err, "pthread_key_create %d", i); - } - - for (i = 0; i < N_k; i += 1) - { - k_v[i] = i; - err = pthread_setspecific (k[i], &k_v[i]); - if (err != 0) - error (1, err, "pthread_setspecific %d", i); - } - - /* Delete every even key. */ - for (i = 0; i < N_k; i += 2) - { - err = pthread_key_delete (k[i]); - if (err != 0) - error (1, err, "pthread_key_delete %d", i); - } - - v = 1; - pthread_exit (NULL); - - return NULL; -} - - -int main(void) -{ - pthread_t tid; - int err; - - err = pthread_create (&tid, 0, test, NULL); - if (err != 0) - error (1, err, "pthread_create"); - - err = pthread_join(tid, NULL); - if (err) - error (1, err, "pthread_join"); - - if (v != N_k + 1) - error (1, 0, "FAILED END %d %d", v, N_k + 1); - - return 0; -} diff --git a/ufs-fsck/Makefile b/ufs-fsck/Makefile index a484428e..03ce9cc7 100644 --- a/ufs-fsck/Makefile +++ b/ufs-fsck/Makefile @@ -1,5 +1,4 @@ -# -# Copyright (C) 1994, 1995, 1996 Free Software Foundation +# Copyright (C) 1994, 1995, 1996, 2012 Free Software Foundation # Written by Michael I. Bushnell. # # This file is part of the GNU Hurd. @@ -24,7 +23,6 @@ makemode := utility SRCS = dir.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ pass5.c setup.c utilities.c inode.c OBJS = $(subst .c,.o,$(SRCS)) tables.o -LCLHDRS = fsck.h target = fsck.ufs installationdir = $(sbindir) HURDLIBS=shouldbeinlibc diff --git a/ufs/Makefile b/ufs/Makefile index cf5c40d7..a1cfc4c9 100644 --- a/ufs/Makefile +++ b/ufs/Makefile @@ -1,6 +1,6 @@ # Makefile for ufs # -# Copyright (C) 1994,95,96,99,2000,02 Free Software Foundation, Inc. +# Copyright (C) 1994,95,96,99,2000,02,12 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 @@ -22,7 +22,6 @@ makemode := server target = ufs SRCS = alloc.c consts.c dir.c hyper.c inode.c main.c pager.c \ sizes.c subr.c tables.c bmap.c pokeloc.c xinl.c -LCLHDRS = ufs.h fs.h dinode.h dir.h OBJS = $(SRCS:.c=.o) HURDLIBS = diskfs iohelp fshelp store pager threads ports ihash shouldbeinlibc |
