2 * Copyright 2010 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.
8 * Subclass of the gio object for use in trusted code. Provides write
9 * buffering into a shared memory object that may grow as needed.
12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_
13 #define NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_
15 #include "native_client/src/include/nacl_base.h"
17 #include "native_client/src/shared/gio/gio.h"
19 #include "native_client/src/trusted/gio/gio_shm.h"
25 struct NaClGioShmUnbounded {
28 struct NaClGioShm *ngsp;
33 size_t io_offset; /* deal with seeks */
38 * When the NaClGioShmUnbounded buffer writes are all done,
39 * NaClGioShmUnboundedGetNaClDesc is used to obtain the NaClDesc
40 * pointer -- caller is responsible for taking another reference with
41 * NaClDescRef, if the lifetime must extend beyond that of the
42 * NaClGioShmUnbounded object -- and the actual size. Actual size is
43 * the largest offset written, not number of bytes written, due to
44 * Seek and the potential of overlapping Writes (or gaps).
46 struct NaClDesc *NaClGioShmUnboundedGetNaClDesc(
47 struct NaClGioShmUnbounded *self,
51 int NaClGioShmUnboundedCtor(struct NaClGioShmUnbounded *self);
56 #endif /* NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_ */