summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2001-07-11 22:27:39 (GMT)
committerThomas Wouters <thomas@python.org>2001-07-11 22:27:39 (GMT)
commitcac2498815dc526a5888fa534386c0f778667ad6 (patch)
treee7308899d8b4893ee7643f5a014cb9d8c6c9c772 /configure.in
parentd11f5f3eb51180c7cf55cb61ef5848fbafa03925 (diff)
downloadcpython-cac2498815dc526a5888fa534386c0f778667ad6.zip
cpython-cac2498815dc526a5888fa534386c0f778667ad6.tar.gz
cpython-cac2498815dc526a5888fa534386c0f778667ad6.tar.bz2
Re-do the broken-nice() patch to break less platforms. Hopefully none :P
Also note that it isn't just Linux nice() that is broken: at least FreeBSD and BSDI also have this problem. os.nice() should probably just be emulated using getpriority()/setpriority(), if they are available, but that isn't worth putting in 2.1.1.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in19
1 files changed, 18 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 4867868..7e0ca73 100644
--- a/configure.in
+++ b/configure.in
@@ -384,7 +384,7 @@ signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \
sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \
sys/param.h sys/select.h sys/socket.h sys/time.h sys/times.h \
sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
-ndbm.h db1/ndbm.h gdbm/ndbm.h)
+ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h)
AC_HEADER_DIRENT
# checks for typedefs
@@ -1334,6 +1334,23 @@ fi
AC_CHECK_LIB(readline, rl_completion_matches,
AC_DEFINE(HAVE_RL_COMPLETION_MATCHES), , -ltermcap)
+AC_MSG_CHECKING(for broken nice())
+AC_CACHE_VAL(ac_cv_broken_nice, [
+AC_TRY_RUN([
+int main()
+{
+ int val1 = nice(1);
+ if (val1 != -1 && val1 == nice(2))
+ exit(0);
+ exit(1);
+}
+],ac_cv_broken_nice=yes, ac_cv_broken_nice=no)])
+AC_MSG_RESULT($ac_cv_broken_nice)
+if test "$ac_cv_broken_nice" = yes
+then
+ AC_DEFINE(HAVE_BROKEN_NICE)
+fi
+
# THIS MUST BE LAST, IT CAN BREAK OTHER TESTS!
# Add sys/socket.h to confdefs.h
cat >> confdefs.h <<\EOF