2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 #include "native_client/src/trusted/service_runtime/load_file.h"
9 #include "native_client/src/trusted/desc/nacl_desc_base.h"
10 #include "native_client/src/trusted/desc/nacl_desc_io.h"
11 #include "native_client/src/trusted/service_runtime/include/sys/fcntl.h"
12 #include "native_client/src/trusted/service_runtime/nacl_valgrind_hooks.h"
13 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
16 NaClErrorCode NaClAppLoadFileFromFilename(struct NaClApp *nap,
17 const char *filename) {
21 NaClFileNameForValgrind(filename);
23 nd = (struct NaClDesc *) NaClDescIoDescOpen(filename, NACL_ABI_O_RDONLY,
26 return LOAD_OPEN_ERROR;
29 NaClAppLoadModule(nap, nd, NULL, NULL);
30 err = NaClWaitForLoadModuleStatus(nap);