author | mfang |
Wed, 17 Aug 2011 14:18:26 -0700 | |
changeset 10294 | 8fcdae2a7ec7 |
parent 5506 | 202f599c92aa |
child 14786 | a9f61e0cbe61 |
permissions | -rw-r--r-- |
5159
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
1 |
# |
5506 | 2 |
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
5159
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
4 |
# |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
8 |
# |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
13 |
# accompanied this code). |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
14 |
# |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License version |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
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. |
|
5159
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
22 |
# |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
23 |
|
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
24 |
# @test |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
25 |
# @bug 6368984 |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
26 |
# @summary configuring unconnected Socket before passing to implAccept can cause fd leak |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
27 |
# @build AcceptCauseFileDescriptorLeak |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
28 |
# @run shell AcceptCauseFileDescriptorLeak.sh |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
29 |
|
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
30 |
OS=`uname -s` |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
31 |
case "$OS" in |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
32 |
Windows_* | CYGWIN* ) |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
33 |
echo "ulimit not on Windows" |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
34 |
exit 0 |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
35 |
;; |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
36 |
* ) |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
37 |
CLASSPATH=${TESTCLASSES}:${TESTSRC} |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
38 |
;; |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
39 |
esac |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
40 |
export CLASSPATH |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
41 |
|
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
42 |
# hard limit needs to be less than 1024 for this bug |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
43 |
NOFILES=`ulimit -n -H` |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
44 |
if [ "$NOFILES" = "unlimited" ] || [ $NOFILES -ge 1024 ]; then |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
45 |
ulimit -n 1024 |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
46 |
fi |
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
47 |
|
55d38eeb1e33
6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents:
diff
changeset
|
48 |
${TESTJAVA}/bin/java AcceptCauseFileDescriptorLeak |