---
name: "libfsxfs"
section: "3"
platform: "linux"
package: "libfsxfs-dev"
version: "20240501-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libfsxfs"
---

# libfsxfs(3)

Library to support the X File System (XFS) format

## NAME

**libfsxfs.h** – Library to support the X File System (XFS) format

## SYNOPSIS

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

Support functions

*const* *char* *\**\

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

*int*\

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

*int*\

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

*int*\

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

*int*\

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

Available when compiled with wide character string support:

*int*\

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

Available when compiled with libbfio support:

*int*\

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

Notify functions

*void*\

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

*int*\

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

*int*\

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

*int*\

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

Error functions

*void*\

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

*int*\

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

*int*\

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

*int*\

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

*int*\

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

Volume functions

*int*\

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

*int*\

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

*int*\

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

*int*\

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

*int*\

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

*int*\

**libfsxfs\_volume\_get\_format\_version**(*libfsxfs\_volume\_t \*volume*, *uint8\_t \*format\_version*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_utf8\_label\_size**(*libfsxfs\_volume\_t \*volume*, *size\_t \*utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_utf8\_label**(*libfsxfs\_volume\_t \*volume*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_utf16\_label\_size**(*libfsxfs\_volume\_t \*volume*, *size\_t \*utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_utf16\_label**(*libfsxfs\_volume\_t \*volume*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_root\_directory**(*libfsxfs\_volume\_t \*volume*, *libfsxfs\_file\_entry\_t \*\*file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_file\_entry\_by\_inode**(*libfsxfs\_volume\_t \*volume*, *uint64\_t inode\_number*, *libfsxfs\_file\_entry\_t \*\*file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_file\_entry\_by\_utf8\_path**(*libfsxfs\_volume\_t \*volume*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfsxfs\_file\_entry\_t \*\*file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_volume\_get\_file\_entry\_by\_utf16\_path**(*libfsxfs\_volume\_t \*volume*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfsxfs\_file\_entry\_t \*\*file\_entry*, *libfsxfs\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

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

Available when compiled with libbfio support:

*int*\

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

File entry functions

*int*\

**libfsxfs\_file\_entry\_free**(*libfsxfs\_file\_entry\_t \*\*file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_inode\_number**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint64\_t \*inode\_number*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_creation\_time**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int64\_t \*posix\_time*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_modification\_time**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int64\_t \*posix\_time*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_access\_time**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int64\_t \*posix\_time*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_inode\_change\_time**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int64\_t \*posix\_time*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_file\_mode**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*file\_mode*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_number\_of\_links**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*number\_of\_links*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_owner\_identifier**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*owner\_identifier*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_group\_identifier**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*group\_identifier*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_device\_identifier**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*device\_identifier*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_device\_number**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*major\_device\_number*, *uint32\_t \*minor\_device\_number*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf8\_name\_size**(*libfsxfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf8\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf16\_name\_size**(*libfsxfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf16\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf8\_symbolic\_link\_target\_size**(*libfsxfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf8\_symbolic\_link\_target**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf16\_symbolic\_link\_target\_size**(*libfsxfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_utf16\_symbolic\_link\_target**(*libfsxfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_number\_of\_extended\_attributes**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_extended\_attributes*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_extended\_attribute\_by\_index**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int extended\_attribute\_index*, *libfsxfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_has\_extended\_attribute\_by\_utf8\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_has\_extended\_attribute\_by\_utf16\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_extended\_attribute\_by\_utf8\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfsxfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_extended\_attribute\_by\_utf16\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfsxfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_number\_of\_sub\_file\_entries**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_sub\_entries*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_sub\_file\_entry\_by\_index**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int sub\_file\_entry\_index*, *libfsxfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_sub\_file\_entry\_by\_utf8\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfsxfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_sub\_file\_entry\_by\_utf16\_name**(*libfsxfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfsxfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfsxfs\_error\_t \*\*error*);

*ssize\_t*\

**libfsxfs\_file\_entry\_read\_buffer**(*libfsxfs\_file\_entry\_t \*file\_entry*, *void \*buffer*, *size\_t buffer\_size*, *libfsxfs\_error\_t \*\*error*);

*ssize\_t*\

**libfsxfs\_file\_entry\_read\_buffer\_at\_offset**(*libfsxfs\_file\_entry\_t \*file\_entry*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libfsxfs\_error\_t \*\*error*);

*off64\_t*\

**libfsxfs\_file\_entry\_seek\_offset**(*libfsxfs\_file\_entry\_t \*file\_entry*, *off64\_t offset*, *int whence*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_offset**(*libfsxfs\_file\_entry\_t \*file\_entry*, *off64\_t \*offset*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_size**(*libfsxfs\_file\_entry\_t \*file\_entry*, *size64\_t \*size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_number\_of\_extents**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_extents*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_file\_entry\_get\_extent\_by\_index**(*libfsxfs\_file\_entry\_t \*file\_entry*, *int extent\_index*, *off64\_t \*extent\_offset*, *size64\_t \*extent\_size*, *uint32\_t \*extent\_flags*, *libfsxfs\_error\_t \*\*error*);

Extended attribute functions

*int*\

**libfsxfs\_extended\_attribute\_free**(*libfsxfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_utf8\_name\_size**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *size\_t \*utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_utf8\_name**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_utf16\_name\_size**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *size\_t \*utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_utf16\_name**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfsxfs\_error\_t \*\*error*);

*ssize\_t*\

**libfsxfs\_extended\_attribute\_read\_buffer**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *void \*buffer*, *size\_t buffer\_size*, *libfsxfs\_error\_t \*\*error*);

*ssize\_t*\

**libfsxfs\_extended\_attribute\_read\_buffer\_at\_offset**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libfsxfs\_error\_t \*\*error*);

*off64\_t*\

**libfsxfs\_extended\_attribute\_seek\_offset**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *off64\_t offset*, *int whence*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_offset**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *off64\_t \*offset*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_size**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *size64\_t \*size*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_number\_of\_extents**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *int \*number\_of\_extents*, *libfsxfs\_error\_t \*\*error*);

*int*\

**libfsxfs\_extended\_attribute\_get\_extent\_by\_index**(*libfsxfs\_extended\_attribute\_t \*extended\_attribute*, *int extent\_index*, *off64\_t \*extent\_offset*, *size64\_t \*extent\_size*, *uint32\_t \*extent\_flags*, *libfsxfs\_error\_t \*\*error*);

## DESCRIPTION

The **libfsxfs\_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 "libfsxfs.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

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

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

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

## BUGS

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

## AUTHOR

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

## COPYRIGHT

Copyright (C) 2020-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 libfsxfs.h include file
