I'm doing test nacl sample.
Add a source to system() or popen() api.
The code is failed.
my code is below.
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/var.h"
#include <errno.h>
#include <cstdio>
#include <cstdlib>
#include <iostream>
class HelloTutorialInstance : public pp::Instance {
public:
explicit HelloTutorialInstance(PP_Instance instance) : pp::Instance(instance)
{}
virtual ~HelloTutorialInstance() {}
const char* const kHelloString = "test_nacl";
const char* const kReplyString = "hello 1111";
virtual void HandleMessage(const pp::Var& var_message) {
int s = system("ls");
std::string bbb = strerror(errno);
PostMessage(bbb.c_str());
PostMessage(errno);
PostMessage("----------");
}
};
class HelloTutorialModule : public pp::Module {
public:
HelloTutorialModule() : pp::Module() {}
virtual ~HelloTutorialModule() {}
virtual pp::Instance* CreateInstance(PP_Instance instance) {
return new HelloTutorialInstance(instance);
}
};
namespace pp {
Module* CreateModule() {
return new HelloTutorialModule();
}
} // namespace pp