1# zx_vmo_set_size
2
3## NAME
4
5vmo_set_size - resize a VMO object
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11
12zx_status_t zx_vmo_set_size(zx_handle_t handle, uint64_t size);
13
14```
15
16## DESCRIPTION
17
18**vmo_set_size**() sets the new size of a VMO object.
19
20The size will be rounded up to the next page size boundary.
21Subsequent calls to **vmo_get_size**() will return the rounded up size.
22
23## RIGHTS
24
25TODO(ZX-2399)
26
27## RETURN VALUE
28
29**vmo_set_size**() returns **ZX_OK** on success. In the event
30of failure, a negative error value is returned.
31
32## ERRORS
33
34**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
35
36**ZX_ERR_WRONG_TYPE**  *handle* is not a VMO handle.
37
38**ZX_ERR_ACCESS_DENIED**  *handle* does not have the **ZX_RIGHT_WRITE** right.
39
40**ZX_ERR_UNAVAILABLE** The VMO was created with **ZX_VMO_NON_RESIZABLE** option.
41
42**ZX_ERR_OUT_OF_RANGE**  Requested size is too large.
43
44**ZX_ERR_NO_MEMORY**  Failure due to lack of system memory.
45
46## SEE ALSO
47
48[vmo_create](vmo_create.md),
49[vmo_clone](vmo_clone.md),
50[vmo_read](vmo_read.md),
51[vmo_write](vmo_write.md),
52[vmo_get_size](vmo_get_size.md),
53[vmo_op_range](vmo_op_range.md).
54