// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. enclave { include "inc/stat.h" include "inc/dirent.h" trusted { /* define ECALLs here. */ }; untrusted { int u_open_ocall([out] int *error, [in, string] const char *pathname, int flags); int u_open64_ocall([out] int *error, [in, string] const char *path, int oflag, int mode); int u_fstat_ocall([out] int *error, int fd, [out] struct stat_t *buf); int u_fstat64_ocall([out] int *error, int fd, [out] struct stat64_t *buf); int u_stat_ocall([out] int *error, [in, string] const char *path, [out] struct stat_t *buf); int u_stat64_ocall([out] int *error, [in, string] const char *path, [out] struct stat64_t *buf); int u_lstat_ocall([out] int *error, [in, string] const char *path, [out] struct stat_t *buf); int u_lstat64_ocall([out] int *error, [in, string] const char *path, [out] struct stat64_t *buf); uint64_t u_lseek_ocall([out] int *error, int fd, int64_t offset, int whence); int64_t u_lseek64_ocall([out] int *error, int fd, int64_t offset, int whence); int u_ftruncate_ocall([out] int *error, int fd, int64_t length); int u_ftruncate64_ocall([out] int *error, int fd, int64_t length); int u_truncate_ocall([out] int *error, [in, string] const char *path, int64_t length); int u_truncate64_ocall([out] int *error, [in, string] const char *path, int64_t length); int u_fsync_ocall([out] int *error, int fd); int u_fdatasync_ocall([out] int *error, int fd); int u_fchmod_ocall([out] int *error, int fd, uint32_t mode); int u_unlink_ocall([out] int *error, [in, string] const char *pathname); int u_link_ocall([out] int *error, [in, string] const char *oldpath, [in, string] const char *newpath); int u_rename_ocall([out] int *error, [in, string] const char *oldpath, [in, string] const char *newpath); int u_chmod_ocall([out] int *error, [in, string] const char *path, uint32_t mode); size_t u_readlink_ocall([out] int *error, [in, string] const char *path, [out, size=bufsz] char *buf, size_t bufsz); int u_symlink_ocall([out] int *error, [in, string] const char *path1, [in, string] const char *path2); char *u_realpath_ocall([out] int *error, [in, string] const char *pathname); int u_mkdir_ocall([out] int *error, [in, string] const char *pathname, uint32_t mode); int u_rmdir_ocall([out] int *error, [in, string] const char *pathname); void *u_opendir_ocall([out] int *error, [in, string] const char *pathname); int u_readdir64_r_ocall([user_check] void *dirp, [in, out] struct dirent64_t *entry, [out] struct dirent64_t **result); int u_closedir_ocall([out] int *error, [user_check] void *dirp); int u_dirfd_ocall([out] int *error, [user_check] void *dirp); int u_fstatat64_ocall([out] int *error, int dirfd, [in, string] const char *pathname, [out] struct stat64_t *buf, int flags); }; };