---
name: "libvsgpt"
section: "3"
platform: "linux"
package: "libvsgpt-dev"
version: "0~20240504-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libvsgpt"
---

# libvsgpt(3)

Library to access the GUID Partition Table (GPT) volume system format

## NAME

**libvsgpt.h** – Library to access the GUID Partition Table (GPT) volume system format

## SYNOPSIS

**#include \<libvsgpt.h\>**

Support functions

*const* *char* *\**\

**libvsgpt\_get\_version**(*void*);

*int*\

**libvsgpt\_get\_access\_flags\_read**(*void*);

*int*\

**libvsgpt\_get\_access\_flags\_read\_write**(*void*);

*int*\

**libvsgpt\_get\_access\_flags\_write**(*void*);

*int*\

**libvsgpt\_get\_codepage**(*int \*codepage*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_set\_codepage**(*int codepage*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_check\_volume\_signature**(*const char \*filename*, *libvsgpt\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libvsgpt\_check\_volume\_signature\_wide**(*const wchar\_t \*filename*, *libvsgpt\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libvsgpt\_check\_volume\_signature\_file\_io\_handle**(*libbfio\_handle\_t \*file\_io\_handle*, *libvsgpt\_error\_t \*\*error*);

Notify functions

*void*\

**libvsgpt\_notify\_set\_verbose**(*int verbose*);

*int*\

**libvsgpt\_notify\_set\_stream**(*FILE \*stream*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_notify\_stream\_open**(*const char \*filename*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_notify\_stream\_close**(*libvsgpt\_error\_t \*\*error*);

Error functions

*void*\

**libvsgpt\_error\_free**(*libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_error\_fprint**(*libvsgpt\_error\_t \*error*, *FILE \*stream*);

*int*\

**libvsgpt\_error\_sprint**(*libvsgpt\_error\_t \*error*, *char \*string*, *size\_t size*);

*int*\

**libvsgpt\_error\_backtrace\_fprint**(*libvsgpt\_error\_t \*error*, *FILE \*stream*);

*int*\

**libvsgpt\_error\_backtrace\_sprint**(*libvsgpt\_error\_t \*error*, *char \*string*, *size\_t size*);

Volume functions

*int*\

**libvsgpt\_volume\_initialize**(*libvsgpt\_volume\_t \*\*volume*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_free**(*libvsgpt\_volume\_t \*\*volume*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_signal\_abort**(*libvsgpt\_volume\_t \*volume*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_open**(*libvsgpt\_volume\_t \*volume*, *const char \*filename*, *int access\_flags*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_close**(*libvsgpt\_volume\_t \*volume*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_get\_bytes\_per\_sector**(*libvsgpt\_volume\_t \*volume*, *uint32\_t \*bytes\_per\_sector*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_get\_disk\_identifier**(*libvsgpt\_volume\_t \*volume*, *uint8\_t \*guid\_data*, *size\_t guid\_data\_size*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_get\_number\_of\_partitions**(*libvsgpt\_volume\_t \*volume*, *int \*number\_of\_partitions*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_get\_partition\_by\_index**(*libvsgpt\_volume\_t \*volume*, *int partition\_index*, *libvsgpt\_partition\_t \*\*partition*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_has\_partition\_with\_identifier**(*libvsgpt\_volume\_t \*volume*, *uint32\_t entry\_index*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_volume\_get\_partition\_by\_identifier**(*libvsgpt\_volume\_t \*volume*, *uint32\_t entry\_index*, *libvsgpt\_partition\_t \*\*partition*, *libvsgpt\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libvsgpt\_volume\_open\_wide**(*libvsgpt\_volume\_t \*volume*, *const wchar\_t \*filename*, *int access\_flags*, *libvsgpt\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libvsgpt\_volume\_open\_file\_io\_handle**(*libvsgpt\_volume\_t \*volume*, *libbfio\_handle\_t \*file\_io\_handle*, *int access\_flags*, *libvsgpt\_error\_t \*\*error*);

Partition functions

*int*\

**libvsgpt\_partition\_free**(*libvsgpt\_partition\_t \*\*partition*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_entry\_index**(*libvsgpt\_partition\_t \*partition*, *uint32\_t \*entry\_index*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_identifier**(*libvsgpt\_partition\_t \*partition*, *uint8\_t \*guid\_data*, *size\_t guid\_data\_size*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_type\_identifier**(*libvsgpt\_partition\_t \*partition*, *uint8\_t \*guid\_data*, *size\_t guid\_data\_size*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_type**(*libvsgpt\_partition\_t \*partition*, *uint8\_t \*type*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_volume\_offset**(*libvsgpt\_partition\_t \*partition*, *off64\_t \*volume\_offset*, *libvsgpt\_error\_t \*\*error*);

*ssize\_t*\

**libvsgpt\_partition\_read\_buffer**(*libvsgpt\_partition\_t \*partition*, *void \*buffer*, *size\_t buffer\_size*, *libvsgpt\_error\_t \*\*error*);

*ssize\_t*\

**libvsgpt\_partition\_read\_buffer\_at\_offset**(*libvsgpt\_partition\_t \*partition*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libvsgpt\_error\_t \*\*error*);

*off64\_t*\

**libvsgpt\_partition\_seek\_offset**(*libvsgpt\_partition\_t \*partition*, *off64\_t offset*, *int whence*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_offset**(*libvsgpt\_partition\_t \*partition*, *off64\_t \*offset*, *libvsgpt\_error\_t \*\*error*);

*int*\

**libvsgpt\_partition\_get\_size**(*libvsgpt\_partition\_t \*partition*, *size64\_t \*size*, *libvsgpt\_error\_t \*\*error*);

## DESCRIPTION

The **libvsgpt\_get\_version**() function is used to retrieve the library version.

## RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libvsgpt.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

libvsgpt can be compiled with wide character support (wchar\_t).

To compile libvsgpt with wide character support use: *./configure* *--enable-wide-character-type=yes*\
  or define: *\_UNICODE*\
  or *UNICODE*\
  during compilation.

*LIBVSGPT\_WIDE\_CHARACTER\_TYPE*\
  in libvsgpt/features.h can be used to determine if libvsgpt was compiled with wide character support.

## BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libvsgpt/issues

## AUTHOR

These man pages are generated from "libvsgpt.h".

## COPYRIGHT

Copyright (C) 2019-2024, Joachim Metz \<joachim.metz@gmail.com\>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

the libvsgpt.h include file
