author | alanb |
Fri, 10 Sep 2010 18:48:49 +0100 | |
changeset 6538 | cb0da65ba680 |
parent 5506 | 202f599c92aa |
child 7668 | d4a77089c587 |
permissions | -rw-r--r-- |
2444
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
1 |
# |
5506 | 2 |
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2444
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
4 |
# |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
8 |
# |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
13 |
# accompanied this code). |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
14 |
# |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License version |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
18 |
# |
5506 | 19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
# or visit www.oracle.com if you need additional information or have any |
|
21 |
# questions. |
|
2444
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
22 |
# |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
23 |
|
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
24 |
# @test |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
25 |
# @bug 6824477 |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
26 |
# @summary Selector.select can fail with IOException "Invalid argument" on |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
27 |
# Solaris if maximum number of file descriptors is less than 10000 |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
28 |
# @build LotsOfUpdates |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
29 |
# @run shell lots_of_updates.sh |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
30 |
|
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
31 |
OS=`uname -s` |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
32 |
case "$OS" in |
4657
d0bd64fbe430
6911113: These tests do not work with CYGWIN: java/nio
ohair
parents:
2444
diff
changeset
|
33 |
Windows_* | CYGWIN* ) |
2444
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
34 |
echo "ulimit not on Windows" |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
35 |
exit 0 |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
36 |
;; |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
37 |
* ) |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
38 |
CLASSPATH=${TESTCLASSES}:${TESTSRC} |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
39 |
;; |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
40 |
esac |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
41 |
export CLASSPATH |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
42 |
|
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
43 |
# hard limit needs to be less than 10000 for this bug |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
44 |
NOFILES=`ulimit -n -H` |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
45 |
if [ "$NOFILES" = "unlimited" ] || [ $NOFILES -ge 10000 ]; then |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
46 |
ulimit -n 2048 |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
47 |
fi |
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
48 |
|
282b8abf92eb
6824477: (se) Selector.select fails with IOException: "Invalid argument" if maximum file descriptors is low
alanb
parents:
diff
changeset
|
49 |
${TESTJAVA}/bin/java LotsOfUpdates |