| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| {{generator_warning}} |
| |
| #include <stdlib.h> |
| |
| #include "mojo/public/c/system/buffer.h" |
| #include "mojo/public/c/system/data_pipe.h" |
| #include "mojo/public/c/system/handle.h" |
| #include "mojo/public/c/system/message_pipe.h" |
| #include "mojo/public/c/system/result.h" |
| #include "mojo/public/c/system/time.h" |
| #include "mojo/public/c/system/wait.h" |
| #include "{{platform_dir}}/mojo_irt.h" |
| #include "native_client/src/untrusted/irt/irt.h" |
| |
| bool g_irt_mojo_valid = false; |
| struct nacl_irt_mojo g_irt_mojo; |
| |
| struct nacl_irt_mojo* get_irt_mojo() { |
| if (!g_irt_mojo_valid) { |
| size_t rc = nacl_interface_query(NACL_IRT_MOJO_v0_1, |
| &g_irt_mojo, |
| sizeof(g_irt_mojo)); |
| if (rc != sizeof(g_irt_mojo)) |
| return NULL; |
| else |
| g_irt_mojo_valid = true; |
| } |
| return &g_irt_mojo; |
| } |
| |
| {{body}} |