mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-10 03:08:56 +00:00
Update to xload 1.2.0
This commit is contained in:
@@ -26,7 +26,7 @@ from the X Consortium.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
|
||||
@@ -1,3 +1,146 @@
|
||||
commit 624100511d6ac22f254bcf7f0cde12febc2e74a2
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Mar 24 09:59:41 2024 -0700
|
||||
|
||||
xload 1.2.0
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 491660b263c06396d11655351a09d80eafb83fb9
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat Feb 17 15:24:12 2024 -0800
|
||||
|
||||
Use imdent to realign remaining pre-processer directives
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit fa11c30113115991cdc5f15042944cf5bab6eb0b
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat Feb 17 15:21:12 2024 -0800
|
||||
|
||||
unifdef __bsdi__
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit f15b8097a00299291263cfe64947942564ccc373
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 16:29:40 2024 -0800
|
||||
|
||||
Use autoconf to check for <protocols/rwhod.h> instead of OS-specific ifdefs
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit de7b5bb18da4e5a626794db292f8b41d30aa2232
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:59:33 2024 -0800
|
||||
|
||||
Use autoconf to check for <paths.h> instead of ifdef BSD
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit f16d6f2c273c6896a4e79ac9db7a80c830794392
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:42:38 2024 -0800
|
||||
|
||||
unifdef QNX4
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit f1ef1f0ac2a81b4aa59f1fba37ee11f6a0acbe22
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:41:48 2024 -0800
|
||||
|
||||
unifdef att
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit fe24c5e19d4d309b4f3a3e435b9d834836312301
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:39:43 2024 -0800
|
||||
|
||||
unifdef SVR4
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 7c97025b18baf00c81319c7a01120bd6417fdadf
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:32:30 2024 -0800
|
||||
|
||||
unifdef hpux
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 4842fc779bc6bfc9ba932b2602d0166317b415d9
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:30:13 2024 -0800
|
||||
|
||||
unifdef __osf__
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 0e0df8ca1d53fddeeddb918323050b9e9bbffd4a
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Feb 11 15:29:25 2024 -0800
|
||||
|
||||
unifdef SYSV
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit f971deabd26413efd6fa87c0c3ab2952bae163bf
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Tue Jan 23 18:17:04 2024 -0800
|
||||
|
||||
configure: Use AC_SYS_LARGEFILE to enable large file support
|
||||
|
||||
Handle files whose sizes, inode numbers, or timestamps may be
|
||||
out of range of the original 32-bit APIs
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit ebcdc687d02e34240bd98b9f1396225eee4e4240
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Tue Jan 23 18:15:13 2024 -0800
|
||||
|
||||
Use asprintf() if available
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit ef450fb99630a406c4638d8ba251eac45e434411
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat Feb 11 12:51:58 2023 -0800
|
||||
|
||||
Add -help and -version options
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 7063169a70b6ce49de777f5daa1c256552a9e32a
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sat Feb 11 12:38:58 2023 -0800
|
||||
|
||||
Print which arguments were unknown before giving usage message
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 8fc5bb64756ffae562032613bd5616481ec67f2d
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu Jul 28 17:30:21 2022 -0700
|
||||
|
||||
gitlab CI: stop requiring Signed-off-by in commits
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 523cedbf302fea0b46cca88244fc97677216009a
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Mon Aug 15 17:27:46 2022 -0700
|
||||
|
||||
unifdef -UUSG
|
||||
|
||||
USG was defined for a handful of pre-SVR4 systems based on
|
||||
AT&T's Unix System Group releases in the old imake configs
|
||||
and has never been defined in X11R7 modular builds.
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 8f9450b897b16bc9b9940b137dd805d443be050e
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Sun Apr 3 16:27:26 2022 -0700
|
||||
@@ -1024,7 +1167,7 @@ Date: Wed Jul 20 19:31:57 2005 +0000
|
||||
configure cache, you cache it, and the cached value is probably wrong.
|
||||
|
||||
commit 62d4ea34f0fd64e258abb993004c8966eecc6cf7
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
|
||||
Date: Tue Jul 5 22:36:58 2005 +0000
|
||||
|
||||
Build system for xload
|
||||
|
||||
@@ -236,7 +236,6 @@ CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
@@ -247,11 +246,9 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_CMD = @INSTALL_CMD@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
72
app/xload/aclocal.m4
vendored
72
app/xload/aclocal.m4
vendored
@@ -13,8 +13,8 @@
|
||||
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
|
||||
[m4_warning([this file was generated for autoconf 2.69.
|
||||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
|
||||
[m4_warning([this file was generated for autoconf 2.71.
|
||||
You have another version of autoconf. It may work, but is not guaranteed to.
|
||||
If you have problems, you may need to regenerate the build system entirely.
|
||||
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
|
||||
@@ -1319,7 +1319,7 @@ AC_SUBST([am__untar])
|
||||
m4_include([m4/ax_define_dir.m4])
|
||||
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
|
||||
dnl
|
||||
dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
|
||||
dnl
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a
|
||||
dnl copy of this software and associated documentation files (the "Software"),
|
||||
@@ -1356,7 +1356,7 @@ dnl DEALINGS IN THE SOFTWARE.
|
||||
# See the "minimum version" comment for each macro you use to see what
|
||||
# version you require.
|
||||
m4_defun([XORG_MACROS_VERSION],[
|
||||
m4_define([vers_have], [1.19.2])
|
||||
m4_define([vers_have], [1.20.0])
|
||||
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
|
||||
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
|
||||
m4_if(m4_cmp(maj_have, maj_needed), 0,,
|
||||
@@ -1377,7 +1377,7 @@ AM_MAINTAINER_MODE
|
||||
# such as man pages and config files
|
||||
AC_DEFUN([XORG_PROG_RAWCPP],[
|
||||
AC_REQUIRE([AC_PROG_CPP])
|
||||
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
|
||||
AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
|
||||
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
|
||||
|
||||
# Check for flag to avoid builtin definitions - assumes unix is predefined,
|
||||
@@ -1687,7 +1687,7 @@ AC_SUBST(MAKE_HTML)
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-xmlto option, it allows maximum flexibilty in making decisions
|
||||
# the --with-xmlto option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the xmlto package. When DEFAULT is not specified,
|
||||
# --with-xmlto assumes 'auto'.
|
||||
#
|
||||
@@ -1901,7 +1901,7 @@ AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
|
||||
# the --with-asciidoc option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
|
||||
# --with-asciidoc assumes 'auto'.
|
||||
#
|
||||
@@ -1971,7 +1971,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-doxygen option, it allows maximum flexibilty in making decisions
|
||||
# the --with-doxygen option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the doxygen package. When DEFAULT is not specified,
|
||||
# --with-doxygen assumes 'auto'.
|
||||
#
|
||||
@@ -2055,7 +2055,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-groff option, it allows maximum flexibilty in making decisions
|
||||
# the --with-groff option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the groff package. When DEFAULT is not specified,
|
||||
# --with-groff assumes 'auto'.
|
||||
#
|
||||
@@ -2163,7 +2163,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-fop option, it allows maximum flexibilty in making decisions
|
||||
# the --with-fop option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the fop package. When DEFAULT is not specified,
|
||||
# --with-fop assumes 'auto'.
|
||||
#
|
||||
@@ -2257,7 +2257,7 @@ AC_SUBST([M4], [$ac_cv_path_M4])
|
||||
# Documentation tools are not always available on all platforms and sometimes
|
||||
# not at the appropriate level. This macro enables a module to test for the
|
||||
# presence of the tool and obtain it's path in separate variables. Coupled with
|
||||
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
|
||||
# the --with-ps2pdf option, it allows maximum flexibility in making decisions
|
||||
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
|
||||
# --with-ps2pdf assumes 'auto'.
|
||||
#
|
||||
@@ -2312,7 +2312,7 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
|
||||
# not at the appropriate level. This macro enables a builder to skip all
|
||||
# documentation targets except traditional man pages.
|
||||
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
||||
# maximum flexibilty in controlling documentation building.
|
||||
# maximum flexibility in controlling documentation building.
|
||||
# Refer to:
|
||||
# XORG_WITH_XMLTO --with-xmlto
|
||||
# XORG_WITH_ASCIIDOC --with-asciidoc
|
||||
@@ -2345,7 +2345,7 @@ AC_MSG_RESULT([$build_docs])
|
||||
#
|
||||
# This macro enables a builder to skip all developer documentation.
|
||||
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
||||
# maximum flexibilty in controlling documentation building.
|
||||
# maximum flexibility in controlling documentation building.
|
||||
# Refer to:
|
||||
# XORG_WITH_XMLTO --with-xmlto
|
||||
# XORG_WITH_ASCIIDOC --with-asciidoc
|
||||
@@ -2378,7 +2378,7 @@ AC_MSG_RESULT([$build_devel_docs])
|
||||
#
|
||||
# This macro enables a builder to skip all functional specification targets.
|
||||
# Combined with the specific tool checking macros XORG_WITH_*, it provides
|
||||
# maximum flexibilty in controlling documentation building.
|
||||
# maximum flexibility in controlling documentation building.
|
||||
# Refer to:
|
||||
# XORG_WITH_XMLTO --with-xmlto
|
||||
# XORG_WITH_ASCIIDOC --with-asciidoc
|
||||
@@ -2853,7 +2853,11 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
|
||||
AC_DEFUN([XORG_COMPILER_BRAND], [
|
||||
AC_LANG_CASE(
|
||||
[C], [
|
||||
AC_REQUIRE([AC_PROG_CC_C99])
|
||||
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
|
||||
dnl and complains that AC_PROG_CC_C99 is obsolete
|
||||
m4_version_prereq([2.70],
|
||||
[AC_REQUIRE([AC_PROG_CC])],
|
||||
[AC_REQUIRE([AC_PROG_CC_C99])])
|
||||
],
|
||||
[C++], [
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
@@ -2869,7 +2873,7 @@ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
|
||||
# Minimum version: 1.16.0
|
||||
#
|
||||
# Test if the compiler works when passed the given flag as a command line argument.
|
||||
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
|
||||
# If it succeeds, the flag is appended to the given variable. If not, it tries the
|
||||
# next flag in the list until there are no more options.
|
||||
#
|
||||
# Note that this does not guarantee that the compiler supports the flag as some
|
||||
@@ -2885,7 +2889,11 @@ AC_LANG_COMPILER_REQUIRE
|
||||
|
||||
AC_LANG_CASE(
|
||||
[C], [
|
||||
AC_REQUIRE([AC_PROG_CC_C99])
|
||||
dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
|
||||
dnl and complains that AC_PROG_CC_C99 is obsolete
|
||||
m4_version_prereq([2.70],
|
||||
[AC_REQUIRE([AC_PROG_CC])],
|
||||
[AC_REQUIRE([AC_PROG_CC_C99])])
|
||||
define([PREFIX], [C])
|
||||
define([CACHE_PREFIX], [cc])
|
||||
define([COMPILER], [$CC])
|
||||
@@ -3026,7 +3034,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
|
||||
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
|
||||
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
|
||||
|
||||
# Turn some warnings into errors, so we don't accidently get successful builds
|
||||
# Turn some warnings into errors, so we don't accidentally get successful builds
|
||||
# when there are problems that should be fixed.
|
||||
|
||||
if test "x$SELECTIVE_WERROR" = "xyes" ; then
|
||||
@@ -3135,23 +3143,35 @@ AC_SUBST([BASE_]PREFIX[FLAGS])
|
||||
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
|
||||
]) # XORG_STRICT_OPTION
|
||||
|
||||
# XORG_DEFAULT_OPTIONS
|
||||
# --------------------
|
||||
# Minimum version: 1.3.0
|
||||
# XORG_DEFAULT_NOCODE_OPTIONS
|
||||
# ---------------------------
|
||||
# Minimum version: 1.20.0
|
||||
#
|
||||
# Defines default options for X.Org modules.
|
||||
# Defines default options for X.Org modules which don't compile code,
|
||||
# such as fonts, bitmaps, cursors, and docs.
|
||||
#
|
||||
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
|
||||
AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
|
||||
AC_REQUIRE([AC_PROG_INSTALL])
|
||||
XORG_COMPILER_FLAGS
|
||||
XORG_CWARNFLAGS
|
||||
XORG_STRICT_OPTION
|
||||
XORG_RELEASE_VERSION
|
||||
XORG_CHANGELOG
|
||||
XORG_INSTALL
|
||||
XORG_MANPAGE_SECTIONS
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
|
||||
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
|
||||
]) # XORG_DEFAULT_NOCODE_OPTIONS
|
||||
|
||||
# XORG_DEFAULT_OPTIONS
|
||||
# --------------------
|
||||
# Minimum version: 1.3.0
|
||||
#
|
||||
# Defines default options for X.Org modules which compile code.
|
||||
#
|
||||
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
|
||||
AC_REQUIRE([AC_PROG_INSTALL])
|
||||
XORG_COMPILER_FLAGS
|
||||
XORG_CWARNFLAGS
|
||||
XORG_STRICT_OPTION
|
||||
XORG_DEFAULT_NOCODE_OPTIONS
|
||||
]) # XORG_DEFAULT_OPTIONS
|
||||
|
||||
# XORG_INSTALL()
|
||||
|
||||
@@ -1,17 +1,29 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the `asprintf' function. */
|
||||
#undef HAVE_ASPRINTF
|
||||
|
||||
/* Define to 1 if you have the `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
/* Define to 1 if you have the <minix/config.h> header file. */
|
||||
#undef HAVE_MINIX_CONFIG_H
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#undef HAVE_PATHS_H
|
||||
|
||||
/* Define to 1 if you have the <protocols/rwhod.h> header file. */
|
||||
#undef HAVE_PROTOCOLS_RWHOD_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
@@ -33,6 +45,9 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
/* Location of translated messages */
|
||||
#undef LOCALEDIR
|
||||
|
||||
@@ -66,7 +81,9 @@
|
||||
/* Patch version of this package */
|
||||
#undef PACKAGE_VERSION_PATCHLEVEL
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you want to use the gettext() function. */
|
||||
@@ -76,33 +93,95 @@
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on macOS. */
|
||||
#ifndef _DARWIN_C_SOURCE
|
||||
# undef _DARWIN_C_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
/* Enable X/Open compliant socket functions that do not require linking
|
||||
with -lxnet on HP-UX 11.11. */
|
||||
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
|
||||
# undef _HPUX_ALT_XOPEN_SOCKET_API
|
||||
#endif
|
||||
/* Identify the host operating system as Minix.
|
||||
This macro does not affect the system headers' behavior.
|
||||
A future release of Autoconf may stop defining this macro. */
|
||||
#ifndef _MINIX
|
||||
# undef _MINIX
|
||||
#endif
|
||||
/* Enable general extensions on NetBSD.
|
||||
Enable NetBSD compatibility extensions on Minix. */
|
||||
#ifndef _NETBSD_SOURCE
|
||||
# undef _NETBSD_SOURCE
|
||||
#endif
|
||||
/* Enable OpenBSD compatibility extensions on NetBSD.
|
||||
Oddly enough, this does nothing on OpenBSD. */
|
||||
#ifndef _OPENBSD_SOURCE
|
||||
# undef _OPENBSD_SOURCE
|
||||
#endif
|
||||
/* Define to 1 if needed for POSIX-compatible behavior. */
|
||||
#ifndef _POSIX_SOURCE
|
||||
# undef _POSIX_SOURCE
|
||||
#endif
|
||||
/* Define to 2 if needed for POSIX-compatible behavior. */
|
||||
#ifndef _POSIX_1_SOURCE
|
||||
# undef _POSIX_1_SOURCE
|
||||
#endif
|
||||
/* Enable POSIX-compatible threading on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
|
||||
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
|
||||
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_BFP_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_DFP_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
|
||||
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
|
||||
#ifndef __STDC_WANT_LIB_EXT2__
|
||||
# undef __STDC_WANT_LIB_EXT2__
|
||||
#endif
|
||||
/* Enable extensions specified by ISO/IEC 24747:2009. */
|
||||
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
|
||||
# undef __STDC_WANT_MATH_SPEC_FUNCS__
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
/* Enable X/Open extensions. Define to 500 only if necessary
|
||||
to make mbstate_t available. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# undef _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
7057
app/xload/configure
vendored
7057
app/xload/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -23,8 +23,8 @@ dnl Process this file with autoconf to create configure.
|
||||
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xload], [1.1.4],
|
||||
[https://gitlab.freedesktop.org/xorg/app/xload/issues], [xload])
|
||||
AC_INIT([xload], [1.2.0],
|
||||
[https://gitlab.freedesktop.org/xorg/app/xload/-/issues], [xload])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@@ -39,6 +39,12 @@ m4_ifndef([XORG_MACROS_VERSION],
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([asprintf])
|
||||
|
||||
# Internationalization & localization support
|
||||
AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"])
|
||||
AC_MSG_CHECKING([where to install localized messages])
|
||||
@@ -66,6 +72,8 @@ AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
|
||||
# BSD & GNU libc use <stdlib.h>, Solaris requires <sys/loadavg.h>
|
||||
AC_CHECK_FUNCS([getloadavg], [AC_CHECK_HEADERS([sys/loadavg.h])])
|
||||
|
||||
AC_CHECK_HEADERS([paths.h protocols/rwhod.h])
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(XLOAD, xaw7 xmu xt x11 [xproto >= 7.0.17])
|
||||
|
||||
|
||||
@@ -128,128 +128,16 @@ void GetLoadPoint(
|
||||
|
||||
# else /* not HAVE_GETLOADAVG */
|
||||
|
||||
# if defined(att) || defined(QNX4)
|
||||
# define LOADSTUB
|
||||
# endif
|
||||
|
||||
# ifndef LOADSTUB
|
||||
# if !defined(linux) && !defined(__GLIBC__)
|
||||
# include <nlist.h>
|
||||
# endif /* !linux && ... */
|
||||
# endif /* LOADSTUB */
|
||||
# if !defined(linux) && !defined(__GLIBC__)
|
||||
# include <nlist.h>
|
||||
# endif /* !linux && ... */
|
||||
|
||||
# ifdef CSRG_BASED
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
|
||||
|
||||
# ifdef __osf__
|
||||
/*
|
||||
* Use the table(2) interface; it doesn't require setuid root.
|
||||
*
|
||||
* Select 0, 1, or 2 for 5, 30, or 60 second load averages.
|
||||
*/
|
||||
# ifndef WHICH_AVG
|
||||
# define WHICH_AVG 1
|
||||
# endif
|
||||
# include <sys/table.h>
|
||||
# endif
|
||||
|
||||
# ifdef SVR4
|
||||
# ifndef FSCALE
|
||||
# define FSCALE (1 << 8)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(SYSV) && defined(i386)
|
||||
/*
|
||||
* inspired by 'avgload' by John F. Haugh II
|
||||
*/
|
||||
# include <sys/param.h>
|
||||
# include <sys/buf.h>
|
||||
# include <sys/immu.h>
|
||||
# include <sys/region.h>
|
||||
# include <sys/var.h>
|
||||
# include <sys/proc.h>
|
||||
# define KERNEL_FILE "/unix"
|
||||
# define KMEM_FILE "/dev/kmem"
|
||||
# define VAR_NAME "v"
|
||||
# define PROC_NAME "proc"
|
||||
# define BUF_NAME "buf"
|
||||
# define DECAY 0.8
|
||||
struct nlist namelist[] = {
|
||||
{VAR_NAME},
|
||||
{PROC_NAME},
|
||||
{BUF_NAME},
|
||||
{0},
|
||||
};
|
||||
|
||||
static int kmem;
|
||||
static struct var v;
|
||||
static struct proc *p;
|
||||
static XtPointer first_buf, last_buf;
|
||||
|
||||
void InitLoadPoint() /* SYSV386 version */
|
||||
{
|
||||
int i;
|
||||
|
||||
nlist( KERNEL_FILE, namelist);
|
||||
|
||||
for (i=0; namelist[i].n_name; i++)
|
||||
if (namelist[i].n_value == 0)
|
||||
xload_error("cannot get name list from", KERNEL_FILE);
|
||||
|
||||
if ((kmem = open(KMEM_FILE, O_RDONLY)) < 0)
|
||||
xload_error("cannot open", KMEM_FILE);
|
||||
|
||||
if (lseek(kmem, namelist[0].n_value, 0) == -1)
|
||||
xload_error("cannot seek", VAR_NAME);
|
||||
|
||||
if (read(kmem, &v, sizeof(v)) != sizeof(v))
|
||||
xload_error("cannot read", VAR_NAME);
|
||||
|
||||
if ((p=(struct proc *)malloc(v.v_proc*sizeof(*p))) == NULL)
|
||||
xload_error("cannot allocate space for", PROC_NAME);
|
||||
|
||||
first_buf = (XtPointer) namelist[2].n_value;
|
||||
last_buf = (char *)first_buf + v.v_buf * sizeof(struct buf);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void GetLoadPoint( w, closure, call_data ) /* SYSV386 version */
|
||||
Widget w; /* unused */
|
||||
XtPointer closure; /* unused */
|
||||
XtPointer call_data; /* pointer to (double) return value */
|
||||
{
|
||||
double *loadavg = (double *)call_data;
|
||||
static double avenrun = 0.0;
|
||||
int i, nproc, size;
|
||||
|
||||
(void) lseek(kmem, namelist[0].n_value, 0);
|
||||
(void) read(kmem, &v, sizeof(v));
|
||||
|
||||
size = (struct proc *)v.ve_proc - (struct proc *)namelist[1].n_value;
|
||||
|
||||
(void) lseek(kmem, namelist[1].n_value, 0);
|
||||
(void) read(kmem, p, size * sizeof(struct proc));
|
||||
|
||||
for (nproc = 0, i=0; i<size; i++)
|
||||
if ((p[i].p_stat == SRUN) ||
|
||||
(p[i].p_stat == SIDL) ||
|
||||
(p[i].p_stat == SXBRK) ||
|
||||
(p[i].p_stat == SSLEEP && (p[i].p_pri < PZERO) &&
|
||||
(p[i].p_wchan >= (char *)first_buf) && (p[i].p_wchan < (char *)last_buf)))
|
||||
nproc++;
|
||||
|
||||
/* update the load average using a decay filter */
|
||||
avenrun = DECAY * avenrun + nproc * (1.0 - DECAY);
|
||||
*loadavg = avenrun;
|
||||
|
||||
return;
|
||||
}
|
||||
# else /* not (SYSV && i386) */
|
||||
|
||||
# if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
|
||||
# if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
|
||||
|
||||
void InitLoadPoint(void)
|
||||
{
|
||||
@@ -264,10 +152,10 @@ void GetLoadPoint(
|
||||
static int fd = -1;
|
||||
int n;
|
||||
char buf[10] = {0, };
|
||||
# ifndef X_LOCALE
|
||||
# ifndef X_LOCALE
|
||||
char *dp;
|
||||
static char ldp = 0;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
if (fd < 0)
|
||||
@@ -279,21 +167,21 @@ void GetLoadPoint(
|
||||
*(double *)call_data = 0.0;
|
||||
return;
|
||||
}
|
||||
# ifndef X_LOCALE
|
||||
# ifndef X_LOCALE
|
||||
ldp = *localeconv()->decimal_point;
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
else
|
||||
lseek(fd, 0, 0);
|
||||
|
||||
if ((n = read(fd, buf, sizeof(buf)-1)) > 0) {
|
||||
# ifndef X_LOCALE
|
||||
# ifndef X_LOCALE
|
||||
if (ldp != '.')
|
||||
while ((dp = memchr(buf,'.',sizeof(buf)-1)) != NULL) {
|
||||
*(char *)dp = ldp;
|
||||
}
|
||||
|
||||
# endif
|
||||
# endif
|
||||
if (sscanf(buf, "%lf", (double *)call_data) == 1)
|
||||
return;
|
||||
}
|
||||
@@ -304,11 +192,11 @@ void GetLoadPoint(
|
||||
return;
|
||||
}
|
||||
|
||||
# else /* linux */
|
||||
# else /* linux */
|
||||
|
||||
# ifdef __GNU__
|
||||
# ifdef __GNU__
|
||||
|
||||
# include <mach.h>
|
||||
# include <mach.h>
|
||||
|
||||
static processor_set_t default_set;
|
||||
|
||||
@@ -342,11 +230,11 @@ void GetLoadPoint(
|
||||
return;
|
||||
}
|
||||
|
||||
# else /* __GNU__ */
|
||||
# else /* __GNU__ */
|
||||
|
||||
# ifdef __APPLE__
|
||||
# ifdef __APPLE__
|
||||
|
||||
# include <mach/mach.h>
|
||||
# include <mach/mach.h>
|
||||
|
||||
static mach_port_t host_priv_port;
|
||||
|
||||
@@ -376,52 +264,13 @@ void GetLoadPoint(
|
||||
return;
|
||||
}
|
||||
|
||||
# else /* __APPLE__ */
|
||||
# else /* __APPLE__ */
|
||||
|
||||
# ifdef LOADSTUB
|
||||
|
||||
void InitLoadPoint()
|
||||
{
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void GetLoadPoint( w, closure, call_data )
|
||||
Widget w; /* unused */
|
||||
XtPointer closure; /* unused */
|
||||
XtPointer call_data; /* pointer to (double) return value */
|
||||
{
|
||||
*(double *)call_data = 1.0;
|
||||
}
|
||||
|
||||
# else /* not LOADSTUB */
|
||||
|
||||
# ifdef __osf__
|
||||
|
||||
void InitLoadPoint()
|
||||
{
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void GetLoadPoint( w, closure, call_data )
|
||||
Widget w; /* unused */
|
||||
XtPointer closure; /* unused */
|
||||
XtPointer call_data; /* pointer to (double) return value */
|
||||
{
|
||||
double *loadavg = (double *)call_data;
|
||||
struct tbl_loadavg load_data;
|
||||
|
||||
if (table(TBL_LOADAVG, 0, (char *)&load_data, 1, sizeof(load_data)) < 0)
|
||||
xload_error("error reading load average", "");
|
||||
*loadavg = (load_data.tl_lscale == 0) ?
|
||||
load_data.tl_avenrun.d[WHICH_AVG] :
|
||||
load_data.tl_avenrun.l[WHICH_AVG] / (double)load_data.tl_lscale;
|
||||
}
|
||||
|
||||
# else /* not __osf__ */
|
||||
|
||||
# ifdef __QNXNTO__
|
||||
# include <time.h>
|
||||
# include <sys/neutrino.h>
|
||||
# ifdef __QNXNTO__
|
||||
# include <time.h>
|
||||
# include <sys/neutrino.h>
|
||||
static _Uint64t nto_idle = 0, nto_idle_last = 0;
|
||||
static int nto_idle_id;
|
||||
static struct timespec nto_now, nto_last;
|
||||
@@ -454,135 +303,44 @@ GetLoadPoint( /* QNX NTO version */
|
||||
nto_idle_last = nto_idle;
|
||||
nto_last = nto_now;
|
||||
}
|
||||
# else /* not __QNXNTO__ */
|
||||
|
||||
# ifdef __bsdi__
|
||||
# include <kvm.h>
|
||||
|
||||
static struct nlist nl[] = {
|
||||
{ "_averunnable" },
|
||||
# define X_AVERUNNABLE 0
|
||||
{ "_fscale" },
|
||||
# define X_FSCALE 1
|
||||
{ "" },
|
||||
};
|
||||
static kvm_t *kd;
|
||||
static int fscale;
|
||||
|
||||
void InitLoadPoint(void)
|
||||
{
|
||||
fixpt_t averunnable[3]; /* unused really */
|
||||
|
||||
if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL)) == NULL)
|
||||
xload_error("can't open kvm files", "");
|
||||
|
||||
if (kvm_nlist(kd, nl) != 0)
|
||||
xload_error("can't read name list", "");
|
||||
|
||||
if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)averunnable,
|
||||
sizeof(averunnable)) != sizeof(averunnable))
|
||||
xload_error("couldn't obtain _averunnable variable", "");
|
||||
|
||||
if (kvm_read(kd, (off_t)nl[X_FSCALE].n_value, (char *)&fscale,
|
||||
sizeof(fscale)) != sizeof(fscale))
|
||||
xload_error("couldn't obtain _fscale variable", "");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void GetLoadPoint(
|
||||
Widget w, /* unused */
|
||||
XtPointer closure, /* unused */
|
||||
XtPointer call_data) /* ptr to (double) return value */
|
||||
{
|
||||
double *loadavg = (double *)call_data;
|
||||
fixpt_t t;
|
||||
|
||||
if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)&t,
|
||||
sizeof(t)) != sizeof(t))
|
||||
xload_error("couldn't obtain load average", "");
|
||||
|
||||
*loadavg = (double)t/fscale;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# else /* not __bsdi__ */
|
||||
# ifndef KMEM_FILE
|
||||
# define KMEM_FILE "/dev/kmem"
|
||||
# endif
|
||||
|
||||
# ifndef KERNEL_FILE
|
||||
|
||||
# ifdef hpux
|
||||
# define KERNEL_FILE "/hp-ux"
|
||||
# endif /* hpux */
|
||||
# else /* not __QNXNTO__ */
|
||||
|
||||
# ifndef KMEM_FILE
|
||||
# define KMEM_FILE "/dev/kmem"
|
||||
# endif
|
||||
|
||||
# ifndef KERNEL_FILE
|
||||
/*
|
||||
* provide default for everyone else
|
||||
*/
|
||||
# ifndef KERNEL_FILE
|
||||
# ifdef SVR4
|
||||
# define KERNEL_FILE "/stand/unix"
|
||||
# else
|
||||
# ifdef SYSV
|
||||
# define KERNEL_FILE "/unix"
|
||||
# else
|
||||
/* If a BSD system, check in <paths.h> */
|
||||
# ifdef BSD
|
||||
# include <paths.h>
|
||||
# ifdef _PATH_UNIX
|
||||
# define KERNEL_FILE _PATH_UNIX
|
||||
# else
|
||||
# ifdef _PATH_KERNEL
|
||||
# define KERNEL_FILE _PATH_KERNEL
|
||||
# else
|
||||
# define KERNEL_FILE "/vmunix"
|
||||
# endif
|
||||
# endif
|
||||
# else /* BSD */
|
||||
# define KERNEL_FILE "/vmunix"
|
||||
# endif /* BSD */
|
||||
# endif /* SYSV */
|
||||
# endif /* SVR4 */
|
||||
# endif /* KERNEL_FILE */
|
||||
# endif /* KERNEL_FILE */
|
||||
/* If <paths.h> exists, check in it */
|
||||
# ifdef HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
# ifdef _PATH_UNIX
|
||||
# define KERNEL_FILE _PATH_UNIX
|
||||
# else
|
||||
# ifdef _PATH_KERNEL
|
||||
# define KERNEL_FILE _PATH_KERNEL
|
||||
# else
|
||||
# define KERNEL_FILE "/vmunix"
|
||||
# endif
|
||||
# endif
|
||||
# else /* HAVE_PATHS_H */
|
||||
# define KERNEL_FILE "/vmunix"
|
||||
# endif /* HAVE_PATHS_H */
|
||||
# endif /* KERNEL_FILE */
|
||||
|
||||
|
||||
# ifndef KERNEL_LOAD_VARIABLE
|
||||
# if defined(BSD) && (BSD >= 199103)
|
||||
# define KERNEL_LOAD_VARIABLE "_averunnable"
|
||||
# endif /* BSD >= 199103 */
|
||||
|
||||
# ifdef hpux
|
||||
# ifdef __hp9000s800
|
||||
# define KERNEL_LOAD_VARIABLE "avenrun"
|
||||
# endif /* hp9000s800 */
|
||||
# endif /* hpux */
|
||||
|
||||
|
||||
# endif /* KERNEL_LOAD_VARIABLE */
|
||||
|
||||
/*
|
||||
* provide default for everyone else
|
||||
*/
|
||||
|
||||
# ifndef KERNEL_LOAD_VARIABLE
|
||||
# ifdef USG
|
||||
# define KERNEL_LOAD_VARIABLE "sysinfo"
|
||||
# define SYSINFO
|
||||
# else
|
||||
# ifdef SVR4
|
||||
# define KERNEL_LOAD_VARIABLE "avenrun"
|
||||
# else
|
||||
# define KERNEL_LOAD_VARIABLE "_avenrun"
|
||||
# endif
|
||||
# endif
|
||||
# endif /* KERNEL_LOAD_VARIABLE */
|
||||
# ifndef KERNEL_LOAD_VARIABLE
|
||||
# if defined(BSD) && (BSD >= 199103)
|
||||
# define KERNEL_LOAD_VARIABLE "_averunnable"
|
||||
# else /* BSD >= 199103 */
|
||||
# define KERNEL_LOAD_VARIABLE "_avenrun"
|
||||
# endif /* BSD >= 199103 */
|
||||
# endif /* KERNEL_LOAD_VARIABLE */
|
||||
|
||||
static struct nlist namelist[] = { /* namelist for vmunix grubbing */
|
||||
# define LOADAV 0
|
||||
# define LOADAV 0
|
||||
{KERNEL_LOAD_VARIABLE},
|
||||
{0}
|
||||
};
|
||||
@@ -592,9 +350,9 @@ static long loadavg_seek;
|
||||
|
||||
void InitLoadPoint()
|
||||
{
|
||||
# if !defined(SVR4) && !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__)
|
||||
# if !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__)
|
||||
extern void nlist();
|
||||
# endif
|
||||
# endif
|
||||
|
||||
nlist( KERNEL_FILE, namelist);
|
||||
/*
|
||||
@@ -623,34 +381,26 @@ void GetLoadPoint( w, closure, call_data )
|
||||
|
||||
(void) lseek(kmem, loadavg_seek, 0);
|
||||
|
||||
# if defined(SVR4) || (BSD >= 199103)
|
||||
# if (BSD >= 199103)
|
||||
{
|
||||
long temp;
|
||||
(void) read(kmem, (char *)&temp, sizeof(long));
|
||||
*loadavg = (double)temp/FSCALE;
|
||||
}
|
||||
# else /* else not SVR4 or BSD */
|
||||
# else /* else not BSD */
|
||||
(void) read(kmem, (char *)loadavg, sizeof(double));
|
||||
# endif /* SVR4 or ... else */
|
||||
# endif /* or ... else */
|
||||
return;
|
||||
}
|
||||
# endif /* __bsdi__ else */
|
||||
# endif /* __QNXNTO__ else */
|
||||
# endif /* __osf__ else */
|
||||
# endif /* LOADSTUB else */
|
||||
# endif /* __APPLE__ else */
|
||||
# endif /* __GNU__ else */
|
||||
# endif /* linux else */
|
||||
# endif /* SYSV && i386 else */
|
||||
# endif /* __QNXNTO__ else */
|
||||
# endif /* __APPLE__ else */
|
||||
# endif /* __GNU__ else */
|
||||
# endif /* linux else */
|
||||
# endif /* HAVE_GETLOADAVG else */
|
||||
|
||||
static void xload_error(const char *str1, const char *str2)
|
||||
{
|
||||
(void) fprintf(stderr,"xload: %s %s\n", str1, str2);
|
||||
# ifdef __bsdi__
|
||||
if (kd)
|
||||
kvm_close(kd);
|
||||
# endif
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
@@ -9,7 +12,7 @@
|
||||
/* Not all OS supports get_rload
|
||||
steal the STUB idea from get_load
|
||||
*/
|
||||
#if defined(QNX4) || defined(__CYGWIN__) || defined(_WIN32)
|
||||
#ifndef HAVE_PROTOCOLS_RWHOD_H
|
||||
#define RLOADSTUB
|
||||
#endif
|
||||
|
||||
@@ -44,6 +47,12 @@ void GetRLoadPoint(
|
||||
*(double *)call_data = 0.0; /* to be on the safe side */
|
||||
|
||||
if (fname == NULL) {
|
||||
#ifdef HAVE_ASPRINTF
|
||||
if (asprintf(&fname, "%s/whod.%s", _PATH_RWHODIR, resources.remote) < 0) {
|
||||
perror("GetRLoadPoint: asprintf() failed");
|
||||
exit(1);
|
||||
}
|
||||
#else
|
||||
if ((fname = malloc(strlen(_PATH_RWHODIR)+strlen("/whod.")+strlen(resources.remote)+1)) == NULL) {
|
||||
fprintf(stderr,"GetRLoadPoint: malloc() failed\n");
|
||||
exit(1);
|
||||
@@ -51,6 +60,7 @@ void GetRLoadPoint(
|
||||
strcpy(fname,_PATH_RWHODIR);
|
||||
strcat(fname,"/whod.");
|
||||
strcat(fname,resources.remote);
|
||||
#endif
|
||||
}
|
||||
if ((f = open(fname, O_RDONLY, 0)) < 0)
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2011-11-20.07; # UTC
|
||||
scriptversion=2020-11-14.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
@@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
@@ -97,7 +87,7 @@ dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
@@ -114,18 +104,28 @@ Options:
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Email bug reports to bug-automake@gnu.org.
|
||||
Automake home page: https://www.gnu.org/software/automake/
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
@@ -137,46 +137,62 @@ while test $# -ne 0; do
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
@@ -207,6 +223,15 @@ if test $# -eq 0; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
@@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
@@ -250,6 +275,10 @@ do
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
@@ -266,178 +295,148 @@ do
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
mkdir_mode=
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -450,14 +449,25 @@ do
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
@@ -472,20 +482,24 @@ do
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
@@ -493,24 +507,24 @@ do
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
@@ -519,9 +533,9 @@ do
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
||||
@@ -128,7 +128,6 @@ CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
@@ -139,11 +138,9 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_CMD = @INSTALL_CMD@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
.SH NAME
|
||||
xload \- system load average display for X
|
||||
.SH SYNOPSIS
|
||||
\fBxload\fP [-\fItoolkitoption\fP ...] [-scale \fIinteger\fP] [-update \fIseconds\fP]
|
||||
.br
|
||||
[-hl \fIcolor\fP] [-highlight \fIcolor\fP] [-remote \fIhost\fP]
|
||||
.br
|
||||
[-jumpscroll \fIpixels\fP] [-label \fIstring\fP] [-nolabel] [-lights]
|
||||
.nf
|
||||
\fBxload\fP [-\fItoolkitoption\fP ...] [-scale \fIinteger\fP] [-update \fIseconds\fP]
|
||||
[-hl \fIcolor\fP] [-highlight \fIcolor\fP] [-remote \fIhost\fP]
|
||||
[-jumpscroll \fIpixels\fP] [-label \fIstring\fP] [-nolabel] [-lights]
|
||||
[-help|-version]
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.I xload
|
||||
@@ -57,6 +58,12 @@ is 1 second. The default is 10.
|
||||
.TP 8
|
||||
.B \-remote \fIhost\fP
|
||||
This option tells \fIxload\fP to display the load of \fIhost\fP instead of \fIlocalhost\fP. \fIXload\fP gets the information from the \fIrwhod\fP database and consequently requires \fIrwhod\fP to be executing both on \fIlocalhost\fP and \fIhost\fP.
|
||||
.TP 8
|
||||
.B \-help
|
||||
This option specifies that \fIxload\fP should print a usage message and exit.
|
||||
.TP 8
|
||||
.B \-version
|
||||
This option specifies that \fIxload\fP should print version info and exit.
|
||||
.SH RESOURCES
|
||||
In addition to the resources available to each of the widgets used by
|
||||
\fIxload\fP there is one resource defined by the application itself.
|
||||
|
||||
@@ -28,7 +28,7 @@ from the X Consortium.
|
||||
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -140,7 +140,7 @@ static int light_update = 10 * 1000;
|
||||
*/
|
||||
|
||||
static void _X_NORETURN
|
||||
usage(void)
|
||||
usage(int exitval)
|
||||
{
|
||||
fprintf (stderr, gettext("usage: %s [-options ...]\n\n%s\n"),
|
||||
ProgramName, gettext(
|
||||
@@ -157,8 +157,10 @@ usage(void)
|
||||
" -nolabel removes the label from above the chart.\n"
|
||||
" -jumpscroll <value> number of pixels to scroll on overflow\n"
|
||||
" -lights use keyboard leds to display current load\n"
|
||||
" -help print this message\n"
|
||||
" -version print version info\n"
|
||||
));
|
||||
exit(1);
|
||||
exit(exitval);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -175,6 +177,22 @@ main(int argc, char **argv)
|
||||
|
||||
ProgramName = argv[0];
|
||||
|
||||
/* Handle args that don't require opening a display or load info source */
|
||||
for (int n = 1; n < argc; n++) {
|
||||
const char *argn = argv[n];
|
||||
/* accept single or double dash for -help & -version */
|
||||
if (argn[0] == '-' && argn[1] == '-') {
|
||||
argn++;
|
||||
}
|
||||
if (strcmp(argn, "-help") == 0) {
|
||||
usage(0);
|
||||
}
|
||||
if (strcmp(argn, "-version") == 0) {
|
||||
puts(PACKAGE_STRING);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* For security reasons, we reset our uid/gid after doing the necessary
|
||||
system initialization and before calling any X routines. */
|
||||
InitLoadPoint();
|
||||
@@ -207,7 +225,14 @@ main(int argc, char **argv)
|
||||
bindtextdomain("xload", domaindir);
|
||||
#endif
|
||||
|
||||
if (argc != 1) usage();
|
||||
if (argc != 1) {
|
||||
fputs(gettext("Unknown argument(s):"), stderr);
|
||||
for (int n = 1; n < argc; n++) {
|
||||
fprintf(stderr, " %s", argv[n]);
|
||||
}
|
||||
fputs("\n\n", stderr);
|
||||
usage(1);
|
||||
}
|
||||
|
||||
XtGetApplicationResources( toplevel, (XtPointer) &resources,
|
||||
my_resources, XtNumber(my_resources),
|
||||
|
||||
Reference in New Issue
Block a user