test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java
changeset 58295 7973073dd048
parent 52778 dbbf46b13d52
child 58313 8a2bc12d2a9a
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Tue Sep 24 17:08:19 2019 +0200
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/Launcher.java	Tue Sep 24 16:19:11 2019 +0100
@@ -1,5 +1,4 @@
 /*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,6 +74,15 @@
         return socks[1];
     }
 
+    /**
+     * Launch specified class with an AF_UNIX socket created externally, and one String arg to child VM
+     */
+    public static void launchWithUnixDomainSocket(String className, UnixDomainSocket socket, String arg) throws IOException {
+        String[] args = new String[1];
+        args[0] = arg;
+        launch(className, null, args, socket.fd());
+    }
+
     /*
      * Launch 'java' with specified class with the specified arguments (may be null).
      * The launched process will inherit a connected TCP socket. The remote endpoint