1 /*
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
109 int nargv; /* number of argv array elements */
110 int argvBytes; /* total number of bytes in argv array */
111 int nenvv; /* number of envv array elements */
112 int envvBytes; /* total number of bytes in envv array */
113 int dirlen; /* length of home directory string */
114 int nparentPathv; /* number of elements in parentPathv array */
115 int parentPathvBytes; /* total number of bytes in parentPathv array */
116 } SpawnInfo;
117
118 /* If ChildStuff.sendAlivePing is true, child shall signal aliveness to
119 * the parent the moment it gains consciousness, before any subsequent
120 * pre-exec errors could happen.
121 * This code must fit into an int and not be a valid errno value on any of
122 * our platforms. */
123 #define CHILD_IS_ALIVE 65535
124
125 /**
126 * The cached and split version of the JDK's effective PATH.
127 * (We don't support putenv("PATH=...") in native code)
128 */
129 const char * const *parentPathv;
130
131 ssize_t restartableWrite(int fd, const void *buf, size_t count);
132 int restartableDup2(int fd_from, int fd_to);
133 int closeSafely(int fd);
134 int isAsciiDigit(char c);
135 int closeDescriptors(void);
136 int moveDescriptor(int fd_from, int fd_to);
137
138 int magicNumber();
139 ssize_t readFully(int fd, void *buf, size_t nbyte);
140 void initVectorFromBlock(const char**vector, const char* block, int count);
141 void execve_as_traditional_shell_script(const char *file,
142 const char *argv[],
143 const char *const envp[]);
144 void execve_with_shell_fallback(int mode, const char *file,
145 const char *argv[],
146 const char *const envp[]);
147 void JDK_execvpe(int mode, const char *file,
148 const char *argv[],
149 const char *const envp[]);
|
1 /*
2 * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
109 int nargv; /* number of argv array elements */
110 int argvBytes; /* total number of bytes in argv array */
111 int nenvv; /* number of envv array elements */
112 int envvBytes; /* total number of bytes in envv array */
113 int dirlen; /* length of home directory string */
114 int nparentPathv; /* number of elements in parentPathv array */
115 int parentPathvBytes; /* total number of bytes in parentPathv array */
116 } SpawnInfo;
117
118 /* If ChildStuff.sendAlivePing is true, child shall signal aliveness to
119 * the parent the moment it gains consciousness, before any subsequent
120 * pre-exec errors could happen.
121 * This code must fit into an int and not be a valid errno value on any of
122 * our platforms. */
123 #define CHILD_IS_ALIVE 65535
124
125 /**
126 * The cached and split version of the JDK's effective PATH.
127 * (We don't support putenv("PATH=...") in native code)
128 */
129 extern const char * const *parentPathv;
130
131 ssize_t restartableWrite(int fd, const void *buf, size_t count);
132 int restartableDup2(int fd_from, int fd_to);
133 int closeSafely(int fd);
134 int isAsciiDigit(char c);
135 int closeDescriptors(void);
136 int moveDescriptor(int fd_from, int fd_to);
137
138 int magicNumber();
139 ssize_t readFully(int fd, void *buf, size_t nbyte);
140 void initVectorFromBlock(const char**vector, const char* block, int count);
141 void execve_as_traditional_shell_script(const char *file,
142 const char *argv[],
143 const char *const envp[]);
144 void execve_with_shell_fallback(int mode, const char *file,
145 const char *argv[],
146 const char *const envp[]);
147 void JDK_execvpe(int mode, const char *file,
148 const char *argv[],
149 const char *const envp[]);
|