namespace {
+#if BUILDFLAG(IS_TIZEN_TV)
+static const size_t kDummyArgLength = 2048;
+#endif
+
// Get the process's "environment" (i.e. the thing that setenv/getenv
// work with).
char** GetEnvironment() {
fd_shuffle2.reserve(options.fds_to_remap.size());
std::vector<char*> argv_cstr;
+#if BUILDFLAG(IS_TIZEN_TV)
+ argv_cstr.reserve(argv.size() + 2);
+#else
argv_cstr.reserve(argv.size() + 1);
+#endif
for (const auto& arg : argv)
argv_cstr.push_back(const_cast<char*>(arg.c_str()));
+#if BUILDFLAG(IS_TIZEN_TV)
+ // Append dummy argument in order to increase buffer size of command line
+ // for forked process from launched process.
+ char dummy_arg[kDummyArgLength];
+ memset(dummy_arg, ' ', kDummyArgLength);
+ dummy_arg[kDummyArgLength - 1] = '\0';
+ argv_cstr.push_back(dummy_arg);
argv_cstr.push_back(nullptr);
+#else
+ argv_cstr.push_back(nullptr);
+#endif
std::unique_ptr<char* []> new_environ;
char* const empty_environ = nullptr;