Disable check for OSABI field, now that I have changed it to 0 in binutils
[nativeclient.git] / service_runtime / nacl_desc_io.h
blob31480e6d9d0bfdf9cf544fbb519f73cdc919731a
1 /*
2 * Copyright 2008, Google Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * NaCl service runtime. NaClDescIoDesc subclass of NaClDesc.
35 #ifndef NATIVE_CLIENT_SERVICE_RUNTIME_NACL_DESC_IO_H_
36 #define NATIVE_CLIENT_SERVICE_RUNTIME_NACL_DESC_IO_H_
38 #include "native_client/include/portability.h"
40 #include "native_client/include/nacl_base.h"
42 EXTERN_C_BEGIN
44 struct NaClDesc;
45 struct NaClDescEffector;
46 struct NaClDescIoDesc;
47 struct NaClDescXferState;
48 struct NaClHostDesc;
49 struct NaClMessageHeader;
50 struct nacl_abi_stat;
51 struct nacl_abi_timespec;
53 int NaClDescIoDescCtor(struct NaClDescIoDesc *self,
54 struct NaClHostDesc *hd);
56 void NaClDescIoDescDtor(struct NaClDesc *vself);
58 struct NaClDescIoDesc *NaClDescIoDescMake(struct NaClHostDesc *nhdp);
60 /* a simple factory */
61 struct NaClDescIoDesc *NaClDescIoDescOpen(char *path,
62 int mode,
63 int perms);
65 int NaClDescIoDescMap(struct NaClDesc *vself,
66 struct NaClDescEffector *effp,
67 void *start_addr,
68 size_t len,
69 int prot,
70 int flags,
71 off_t offset);
73 int NaClDescIoDescUnmapUnsafe(struct NaClDesc *vself,
74 struct NaClDescEffector *effp,
75 void *start_addr,
76 size_t len);
78 int NaClDescIoDescUnmap(struct NaClDesc *vself,
79 struct NaClDescEffector *effp,
80 void *start_addr,
81 size_t len);
83 ssize_t NaClDescIoDescRead(struct NaClDesc *vself,
84 struct NaClDescEffector *effp,
85 void *buf,
86 size_t len);
88 ssize_t NaClDescIoDescWrite(struct NaClDesc *vself,
89 struct NaClDescEffector *effp,
90 void const *buf,
91 size_t len);
93 int NaClDescIoDescSeek(struct NaClDesc *vself,
94 struct NaClDescEffector *effp,
95 off_t offset,
96 int whence);
98 int NaClDescIoDescIoctl(struct NaClDesc *vself,
99 struct NaClDescEffector *effp,
100 int request,
101 void *arg);
103 int NaClDescIoDescFstat(struct NaClDesc *vself,
104 struct NaClDescEffector *effp,
105 struct nacl_abi_stat *statbuf);
107 int NaClDescIoDescClose(struct NaClDesc *vself,
108 struct NaClDescEffector *effp);
110 int NaClDescIoDescExternalizeSize(struct NaClDesc *vself,
111 size_t *nbytes,
112 size_t *nhandles);
114 int NaClDescIoDescExternalize(struct NaClDesc *vself,
115 struct NaClDescXferState *xfer);
117 EXTERN_C_END
119 #endif