Can I use system() or popen API in nacl?

Skip to first unread message

Aug 9, 2018, 5:49:51 PM8/9/18
to Native-Client-Discuss

I'm doing test nacl sample.
basic sample is successed
Add a source to system() or popen() api.
The code is failed.

How can I use system() api?

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 {
  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);



class HelloTutorialModule : public pp::Module {
  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

Aug 9, 2018, 9:11:28 PM8/9/18
to Native-Client-Discuss
bbb.c_str() result "Function not implemented"
errno result 38
I use OSX.

2018년 8월 10일 금요일 오전 6시 49분 51초 UTC+9, 님의 말:

Derek Schuff

Aug 10, 2018, 1:26:25 PM8/10/18
The short answer is no. Native Client programs do not have access to underlying system calls; they have essentially the same capabilities as JS code on the web. You'll need to use the PPAPI APIs in the browser.

You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit
Reply all
Reply to author
0 new messages