Mercurial > hg > graal-jvmci-8
comparison src/share/vm/utilities/vmError.cpp @ 22989:915ca3e9d15e
8078470: [Linux] Replace syscall use in os::fork_and_exec with glibc fork() and execve()
Reviewed-by: stuefe, dsamersoff, dcubed
author | dholmes |
---|---|
date | Wed, 29 Apr 2015 19:37:10 -0400 |
parents | 61be834a44f0 |
children | dd9cc155639c 59eb74ac51f2 |
comparison
equal
deleted
inserted
replaced
22988:99edc344d77c | 22989:915ca3e9d15e |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
1011 #endif | 1011 #endif |
1012 out.print_raw ("\""); | 1012 out.print_raw ("\""); |
1013 out.print_raw (cmd); | 1013 out.print_raw (cmd); |
1014 out.print_raw_cr("\" ..."); | 1014 out.print_raw_cr("\" ..."); |
1015 | 1015 |
1016 os::fork_and_exec(cmd); | 1016 if (os::fork_and_exec(cmd) < 0) { |
1017 out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); | |
1018 } | |
1017 } | 1019 } |
1018 | 1020 |
1019 // done with OnError | 1021 // done with OnError |
1020 OnError = NULL; | 1022 OnError = NULL; |
1021 } | 1023 } |
1096 #elif defined(SOLARIS) | 1098 #elif defined(SOLARIS) |
1097 tty->print ("/usr/bin/sh -c "); | 1099 tty->print ("/usr/bin/sh -c "); |
1098 #endif | 1100 #endif |
1099 tty->print_cr("\"%s\"...", cmd); | 1101 tty->print_cr("\"%s\"...", cmd); |
1100 | 1102 |
1101 os::fork_and_exec(cmd); | 1103 if (os::fork_and_exec(cmd) < 0) { |
1104 tty->print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); | |
1105 } | |
1102 } | 1106 } |
1103 } | 1107 } |
1104 | 1108 |
1105 void VMError::report_java_out_of_memory() { | 1109 void VMError::report_java_out_of_memory() { |
1106 if (OnOutOfMemoryError && OnOutOfMemoryError[0]) { | 1110 if (OnOutOfMemoryError && OnOutOfMemoryError[0]) { |