Container info

Container info — Information about the eventual container that is currently in use

Functions

Properties

gchar * flatpak-version Read / Write / Construct Only
gchar * host-directory Read / Write / Construct Only
SrtOsInfo * host-os-info Read / Write / Construct Only
SrtContainerType type Read / Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ╰── SrtContainerType
    GObject
    ╰── SrtContainerInfo

Includes

#include <steam-runtime-tools/steam-runtime-tools.h>

Description

Functions

srt_container_info_get_container_type ()

SrtContainerType
srt_container_info_get_container_type (SrtContainerInfo *self);

If the program appears to be running in a container, return what sort of container it is.

Implementation of srt_system_info_get_container_type().

Parameters

self

A SrtContainerInfo object

 

Returns

A recognised container type, or SRT_CONTAINER_TYPE_NONE if a container cannot be detected, or SRT_CONTAINER_TYPE_UNKNOWN if unsure.


srt_container_info_get_container_host_directory ()

const gchar *
srt_container_info_get_container_host_directory
                               (SrtContainerInfo *self);

If the program appears to be running in a container, return the directory where host files can be found. For example, if this function returns /run/host, it might be possible to load the host system's /usr/lib/os-release by reading /run/host/usr/lib/os-release.

The returned directory is usually not complete. For example, in a Flatpak app, /run/host will sometimes contain the host system's /etc and /usr, but only if suitable permissions flags are set.

Implementation of srt_system_info_dup_container_host_directory().

Parameters

self

A SrtContainerInfo object

 

Returns

A path from which at least some host-system files can be loaded, typically /run/host, or NULL if unknown or unavailable.

[type filename][nullable]


srt_container_info_get_container_host_os_info ()

SrtOsInfo *
srt_container_info_get_container_host_os_info
                               (SrtContainerInfo *self);

If the program appears to be running in a container, return information about the host's operating system if possible.

Parameters

self

A SrtContainerInfo object

 

Returns

Information about the host operating system, or NULL if unknown or unavailable.

[transfer none][nullable]


srt_container_info_get_flatpak_version ()

const gchar *
srt_container_info_get_flatpak_version
                               (SrtContainerInfo *self);

If the program appears to be running in a container type SRT_CONTAINER_TYPE_FLATPAK, return the Flatpak version.

Parameters

self

A SrtContainerInfo object

 

Returns

A filename, or NULL if the container type is not SRT_CONTAINER_TYPE_FLATPAK or if it was not able to identify the Flatpak version.

[type filename][nullable]

Types and Values

enum SrtContainerType

A type of container.

Members

SRT_CONTAINER_TYPE_NONE

No container detected

 

SRT_CONTAINER_TYPE_FLATPAK

Running in a Flatpak app (see flatpak.org)

 

SRT_CONTAINER_TYPE_PRESSURE_VESSEL

Running in a Steam Runtime container using pressure-vessel

 

SRT_CONTAINER_TYPE_DOCKER

Running in a Docker container (see docker.com)

 

SRT_CONTAINER_TYPE_PODMAN

Running in a Podman container (see podman.io)

 

SRT_CONTAINER_TYPE_SNAP

Running in a Snap app (see snapcraft.io)

 

SRT_CONTAINER_TYPE_UNKNOWN

Unknown container type

 

Property Details

The “flatpak-version” property

  “flatpak-version”          gchar *

Which Flatpak version, if any, is in use.

Flags: Read / Write / Construct Only

Default value: NULL


The “host-directory” property

  “host-directory”           gchar *

Absolute path where important files from the host system can be found.

Flags: Read / Write / Construct Only

Default value: NULL


The “host-os-info” property

  “host-os-info”             SrtOsInfo *

Information about the OS of the host-directory if available.

Flags: Read / Write / Construct Only


The “type” property

  “type”                     SrtContainerType

Which container type is currently in use.

Flags: Read / Write / Construct Only

Default value: SRT_CONTAINER_TYPE_UNKNOWN