### Namespace

# GioUnix – 2.0

Unix-specific APIs in Gio

Version | 2.80.4
Authors | GLib Development Team
License | LGPL-2.1-or-later
Website | https://www.gtk.org
Source | https://gitlab.gnome.org/GNOME/glib/

#### Build

C headers | `gio/gdesktopappinfo.h, gio/gfiledescriptorbased.h, gio/gio.h, gio/gunixfdmessage.h, gio/gunixinputstream.h, gio/gunixmounts.h, gio/gunixoutputstream.h`
pkg-config files | `gio-unix-2.0`

#### Dependencies

GLib—2.0 | The base utility library
| Browse documentation
GModule—2.0 | Portable API for dynamically loading modules
| Browse documentation
GObject—2.0 | The base type system library
| Browse documentation
Gio—2.0 | A library of useful classes for I/O, networking and IPC
| Browse documentation

#### Additional documentation

- UNIX Mounts
- Classes Hierarchy

#### Classes

DesktopAppInfo | `GDesktopAppInfo` is an implementation of `GAppInfo` based on desktop files.
FDMessage | This `GSocketControlMessage` contains a `GUnixFDList`. It may be sent using `g_socket_send_message()` and received using `g_socket_receive_message()` over UNIX sockets (ie: sockets in the `G_SOCKET_FAMILY_UNIX` family). The file descriptors are copied between processes by the kernel.
InputStream | `GUnixInputStream` implements `GInputStream` for reading from a UNIX file descriptor, including asynchronous operations. (If the file descriptor refers to a socket or pipe, this will use `poll()` to do asynchronous I/O. If it refers to a regular file, it will fall back to doing asynchronous I/O in another thread.).
MountMonitor | Watches `GUnixMounts` for changes.
OutputStream | `GUnixOutputStream` implements `GOutputStream` for writing to a UNIX file descriptor, including asynchronous operations. (If the file descriptor refers to a socket or pipe, this will use `poll()` to do asynchronous I/O. If it refers to a regular file, it will fall back to doing asynchronous I/O in another thread.).

#### Interfaces

DesktopAppInfoLookup | `GDesktopAppInfoLookup` is an opaque data structure and can only be accessed using the following functions. deprecated: 2.28
FileDescriptorBased | `GFileDescriptorBased` is an interface for file descriptor based IO. since: 2.24

#### Structs

MountEntry | Defines a Unix mount entry (e.g. /media/cdrom). This corresponds roughly to a mtab entry.
MountPoint | Defines a Unix mount point (e.g. /dev). This corresponds roughly to a fstab entry.

#### Callbacks

DesktopAppLaunchCallback | During invocation, `g_desktop_app_info_launch_uris_as_manager()` may create one or more child processes. This callback is invoked once for each, providing the process ID.

#### Functions

is_mount_path_system_internal | Determines if `mount_path` is considered an implementation of the OS. This is primarily used for hiding mountable and mounted volumes that only are used in the OS and has little to no relevance to the casual user.
is_system_device_path | Determines if `device_path` is considered a block device path which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs to read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux `/proc` filesystem. since: 2.56
is_system_fs_type | Determines if `fs_type` is considered a type of file system which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs to read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux `/proc` filesystem. since: 2.56
mount_at | Gets a `GUnixMountEntry` for a given mount path. If `time_read` is set, it will be filled with a unix timestamp for checking if the mounts have changed since with g_unix_mounts_changed_since().
mount_compare | Compares two unix mounts.
mount_copy | Makes a copy of `mount_entry`. since: 2.54
mount_for | Gets a `GUnixMountEntry` for a given file path. If `time_read` is set, it will be filled with a unix timestamp for checking if the mounts have changed since with g_unix_mounts_changed_since(). since: 2.52
mount_free | Frees a unix mount.
mount_get_device_path | Gets the device path for a unix mount.
mount_get_fs_type | Gets the filesystem type for the unix mount.
mount_get_mount_path | Gets the mount path for a unix mount.
mount_get_options | Gets a comma-separated list of mount options for the unix mount. For example, `rw,relatime,seclabel,data=ordered`. since: 2.58
mount_get_root_path | Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes. since: 2.60
mount_guess_can_eject | Guesses whether a Unix mount can be ejected.
mount_guess_icon | Guesses the icon of a Unix mount.
mount_guess_name | Guesses the name of a Unix mount. The result is a translated string.
mount_guess_should_display | Guesses whether a Unix mount should be displayed in the UI.
mount_guess_symbolic_icon | Guesses the symbolic icon of a Unix mount. since: 2.34
mount_is_readonly | Checks if a unix mount is mounted read only.
mount_is_system_internal | Checks if a Unix mount is a system mount. This is the Boolean OR of g_unix_is_system_fs_type(), `g_unix_is_system_device_path()` and `g_unix_is_mount_path_system_internal()` on `mount_entry`’s properties.
mount_points_changed_since | Checks if the unix mount points have changed since a given unix time.
mount_points_get | Gets a `GList` of `GUnixMountPoint` containing the unix mount points. If `time_read` is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with g_unix_mount_points_changed_since().
mounts_changed_since | Checks if the unix mounts have changed since a given unix time.
mounts_get | Gets a `GList` of `GUnixMountEntry` containing the unix mounts. If `time_read` is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with g_unix_mounts_changed_since().

#### Constants

DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME | Extension point for default handler to URI association. See [Extending GIO][extending-gio]. deprecated: 2.28