Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 1 | // Copyright 2016 The Bazel Authors. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 14 | |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 15 | #ifndef BAZEL_SRC_MAIN_CPP_SERVER_PROCESS_INFO_H_ |
| 16 | #define BAZEL_SRC_MAIN_CPP_SERVER_PROCESS_INFO_H_ |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 17 | |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 18 | #include <sys/types.h> |
laszlocsomor | 6f66539 | 2019-08-27 08:15:51 -0700 | [diff] [blame] | 19 | |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 20 | #include <string> |
| 21 | #include <vector> |
| 22 | |
laszlocsomor | 6f66539 | 2019-08-27 08:15:51 -0700 | [diff] [blame] | 23 | #include "src/main/cpp/util/path.h" |
Laszlo Csomor | 3b89d2d | 2016-11-28 14:04:27 +0000 | [diff] [blame] | 24 | #include "src/main/cpp/util/port.h" // pid_t on Windows/MSVC |
| 25 | |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 26 | namespace blaze { |
| 27 | |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 28 | // Encapsulates information around the blaze server process and its |
| 29 | // configuration. |
| 30 | class ServerProcessInfo final { |
| 31 | public: |
laszlocsomor | 6f66539 | 2019-08-27 08:15:51 -0700 | [diff] [blame] | 32 | ServerProcessInfo(const blaze_util::Path &output_base, |
| 33 | const blaze_util::Path &server_jvm_out); |
Thiago Farina | 676cb9f | 2016-10-06 11:00:43 +0000 | [diff] [blame] | 34 | |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 35 | // When running as a daemon, where the deamonized server's stdout and stderr |
| 36 | // should be written. |
laszlocsomor | 6f66539 | 2019-08-27 08:15:51 -0700 | [diff] [blame] | 37 | const blaze_util::Path jvm_log_file_; |
michajlo | f74f9fe | 2018-01-29 09:06:44 -0800 | [diff] [blame] | 38 | |
| 39 | // Whether or not the jvm_log_file should be opened with O_APPEND. |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 40 | const bool jvm_log_file_append_; |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 41 | |
jingwen | 68c57f0 | 2018-11-21 16:17:17 -0800 | [diff] [blame] | 42 | // TODO(laszlocsomor) 2016-11-28: move pid_t usage out of here and wherever |
Laszlo Csomor | 3b89d2d | 2016-11-28 14:04:27 +0000 | [diff] [blame] | 43 | // else it appears. Find some way to not have to declare a pid_t here, either |
| 44 | // by making PID handling platform-independent or some other idea. |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 45 | pid_t server_pid_; |
Nathan Harmata | bf98f39 | 2016-01-07 22:58:29 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace blaze |
Thiago Farina | 319fd3a | 2016-01-14 19:42:24 +0000 | [diff] [blame] | 49 | |
michajlo | f40241c | 2019-07-17 17:43:15 -0700 | [diff] [blame] | 50 | #endif // BAZEL_SRC_MAIN_CPP_SERVER_PROCESS_INFO_H_ |