Top | ![]() |
![]() |
![]() |
![]() |
SrtSystemInfo is an opaque object representing information about the system. Information is retrieved "lazily"; when it has been retrieved, it is cached until the SrtSystemInfo is destroyed.
This is a reference-counted object: use g_object_ref()
and
g_object_unref()
to manage its lifecycle.
The SrtSystemInfo object is not thread-aware. It should be considered to be "owned" by the thread that created it. Only the thread that "owns" the SrtSystemInfo may call its methods. Other threads may create their own parallel SrtSystemInfo object and use that instead, if desired.
The majority of the SrtSystemInfo API involves child processes, and
requires SIGCHLD
to be handled (somehow) by the host process:
SIGCHLD
must not have been ignored (by sigaction(2)
with SIG_IGN
)
or blocked (for example with sigprocmask(2)
) in the thread that is
acting on the SrtSystemInfo. If this cannot be guaranteed, please run
steam-runtime-system-info(1)
as a child process and inspect its
JSON output instead of calling library functions directly.
Ownership can be transferred to other threads by an operation that
implies a memory barrier, such as g_atomic_pointer_set()
or
g_object_ref()
, but after this is done the previous owner must not
continue to call methods.
SrtSystemInfo *
srt_system_info_new (const char *expectations
);
Return a new SrtSystemInfo.
The expectations
directory should contain a subdirectory for each
supported CPU architecture, named for the multiarch tuple as printed
by gcc -print-multiarch
in the Steam Runtime (in practice this means
SRT_ABI_I386
or SRT_ABI_X86_64
).
The per-architecture directories may contain files whose names end with
.symbols
. Those files are interpreted as describing libraries that
the runtime environment should support, in
deb-symbols(5) format.
SrtSystemInfo * srt_system_info_new_from_json (const char *path
,GError **error
);
Return a new SrtSystemInfo with the info parsed from an existing JSON report. The SrtSystemInfo will be immutable: whatever information was in the JSON report, that will be the only information that is available.
const char *
srt_system_info_get_version (SrtSystemInfo *self
);
Return the version of the steam-runtime-tools library that gathered
this system information.
Normally, this is the same as the libsteam-runtime-tools version number.
If self
was constructed from a saved JSON report, instead return the
version number that was saved in the report, or NULL
if none.
const char *
srt_system_info_get_saved_tool_path (SrtSystemInfo *self
);
If self
was constructed from a saved JSON report, return the
path to the steam-runtime-system-info or similar tool that produced
the report, or NULL
if unknown. Otherwise, return NULL
.
gboolean srt_system_info_can_run (SrtSystemInfo *self
,const char *multiarch_tuple
);
Check whether an executable for the given ABI can be run.
For this check (and all similar checks) to work as intended, the
contents of the libsteam-runtime-tools-0-helpers:i386
package must
be available in the same directory hierarchy as the
libsteam-runtime-tools-0
shared library, something like this:
1 2 3 4 5 6 7 8 |
any directory/ lib/ x86_64-linux-gnu/ libsteam-runtime-tools-0.so.0 libexec/ steam-runtime-tools-0/ i386-linux-gnu-* x86_64-linux-gnu-* |
self |
A SrtSystemInfo object |
|
multiarch_tuple |
A multiarch tuple defining an ABI, as printed
by |
SrtOsInfo *
srt_system_info_check_os (SrtSystemInfo *self
);
Gather and return information about the current operating system.
SrtContainerInfo *
srt_system_info_check_container (SrtSystemInfo *self
);
Gather and return information about the container that is currently in use.
SrtContainerType
srt_system_info_get_container_type (SrtSystemInfo *self
);
If the program appears to be running in a container, return what sort of container it is.
A recognised container type, or SRT_CONTAINER_TYPE_NONE
if a container cannot be detected, or SRT_CONTAINER_TYPE_UNKNOWN
if unsure.
gchar *
srt_system_info_dup_container_host_directory
(SrtSystemInfo *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.
A path from which at least some host-system files can be
loaded, typically /run/host
, or NULL
if unknown or unavailable
SrtVirtualizationInfo *
srt_system_info_check_virtualization (SrtSystemInfo *self
);
Gather and return information about the virtualization, emulation or hypervisor in use.
gboolean
srt_system_info_can_write_to_uinput (SrtSystemInfo *self
);
Return TRUE
if the current user can write to /dev/uinput
.
This is required for the Steam client to be able to emulate gamepads,
keyboards, mice and other input devices based on input from the
Steam Controller or a remote streaming client.
SrtLibraryIssues srt_system_info_check_libraries (SrtSystemInfo *self
,const gchar *multiarch_tuple
,GList **libraries_out
);
Check if the running system has all the expected libraries, and related symbols,
as listed in the deb-symbols(5)
files *.symbols
in the multiarch
subdirectory of “expectations”.
self |
The SrtSystemInfo object to use. |
|
multiarch_tuple |
A multiarch tuple like |
|
libraries_out |
Used to return a GList object where every element of said list is an
SrtLibrary object, representing every |
[out][optional][element-type SrtLibrary][transfer full] |
SrtLibraryIssues srt_system_info_check_library (SrtSystemInfo *self
,const gchar *multiarch_tuple
,const gchar *requested_name
,SrtLibrary **more_details_out
);
Check if requested_name
is available in the running system and whether
it conforms to the deb-symbols(5)
files *.symbols
in the multiarch
subdirectory of “expectations”.
self |
The SrtSystemInfo object to use. |
|
multiarch_tuple |
A multiarch tuple like |
|
requested_name |
The |
[type filename] |
more_details_out |
Used to return an
SrtLibrary object representing the shared library provided
by |
[out][optional][transfer full] |
SrtGraphicsIssues srt_system_info_check_graphics (SrtSystemInfo *self
,const char *multiarch_tuple
,SrtWindowSystem window_system
,SrtRenderingInterface rendering_interface
,SrtGraphics **details_out
);
self |
The SrtSystemInfo object to use. |
|
multiarch_tuple |
A multiarch tuple like |
|
window_system |
The window system to check. |
|
rendering_interface |
The graphics renderng interface to check. |
|
details_out |
Used to return an
SrtGraphics object representing the items tested and results.
Free with |
[out][optional][transfer full] |
GList * srt_system_info_check_all_graphics (SrtSystemInfo *self
,const char *multiarch_tuple
);
Check whether various combinations of rendering interface and windowing
system are available. The specific combinations of rendering interface and
windowing system that are returned are not guaranteed, but will include at
least SRT_RENDERING_INTERFACE_GL
on SRT_WINDOW_SYSTEM_GLX
. Additional combinations
will be added in future versions of this library.
self |
The SrtSystemInfo object to use. |
|
multiarch_tuple |
A multiarch tuple like |
A list of SrtGraphics objects representing the items tested and results. Free with 'g_list_free_full(list, g_object_unref)`.
[transfer full][type SrtGraphics]
GList * srt_system_info_list_egl_icds (SrtSystemInfo *self
,const char * const *multiarch_tuples
);
List the available EGL ICDs, using the same search paths as GLVND.
This function is not architecture-specific and may return a mixture of ICDs for more than one architecture or ABI, because the way the GLVND EGL loader works is to read a single search path for metadata describing ICDs, then filter out the ones that are for the wrong architecture at load time.
Some of the entries in the result might describe a bare SONAME in the standard library search path, which might exist for any or all architectures simultaneously (this is the most common approach for EGL). Other entries might describe the relative or absolute path to a specific library, which will only be usable for the architecture for which it was compiled.
Duplicated EGL ICDs are searched by their absolute path, obtained
using "inspect-library" in multiarch_tuples
, or
if srt_system_info_dup_multiarch_tuples()
NULL
.
Also, if running in a Flatpak environment, the multiarch tuples are used
to march the search paths used by the freedesktop.org runtime's patched
GLVND.
self |
The SrtSystemInfo object |
|
multiarch_tuples |
Force the usage of the provided multiarch tuples like |
[nullable][array zero-terminated=1][element-type utf8] |
A list of
opaque SrtEglIcd objects. Free with
g_list_free_full(icds, srt_egl_icd_unref)
.
[transfer full][element-type SrtEglIcd]
GList * srt_system_info_list_egl_external_platforms (SrtSystemInfo *self
,const char * const *multiarch_tuples
);
List the available EGL external platform modules, using the same
search paths as the NVIDIA proprietary driver libEGL_nvidia.so.0
.
This function is not architecture-specific and may return a mixture of modules for more than one architecture or ABI, because the way this loader appears to work is to read a single search path for metadata describing modules, then filter out the ones that are for the wrong architecture at load time.
Some of the entries in the result might describe a bare SONAME in the standard library search path, which might exist for any or all architectures simultaneously (this is the most common approach for EGL). Other entries might describe the relative or absolute path to a specific library, which will only be usable for the architecture for which it was compiled.
Duplicated modules are searched by their absolute path, obtained
using "inspect-library" in multiarch_tuples
, or
if srt_system_info_dup_multiarch_tuples()
NULL
.
self |
The SrtSystemInfo object |
|
multiarch_tuples |
Force the usage of the provided multiarch tuples like |
[nullable][array zero-terminated=1][element-type utf8] |
A list of
opaque SrtEglExternalPlatform objects. Free with
g_list_free_full(list, srt_egl_icd_unref)
.
[transfer full][element-type SrtEglExternalPlatform]
GList * srt_system_info_list_vulkan_icds (SrtSystemInfo *self
,const char * const *multiarch_tuples
);
List the available Vulkan ICDs, using the same search paths as the reference vulkan-loader.
This function is not architecture-specific and may return a mixture of ICDs for more than one architecture or ABI, because the way the reference vulkan-loader works is to read a single search path for metadata describing ICDs, then filter out the ones that are for the wrong architecture at load time.
Some of the entries in the result might describe a bare SONAME in the standard library search path, which might exist for any or all architectures simultaneously (for example, this approach is used for the NVIDIA binary driver on Debian systems). Other entries might describe the relative or absolute path to a specific library, which will only be usable for the architecture for which it was compiled (for example, this approach is used in Mesa).
Duplicated Vulkan ICDs are searched by their absolute path, obtained
using "inspect-library" in multiarch_tuples
, or
if srt_system_info_dup_multiarch_tuples()
NULL
.
Also, if running in a Flatpak environment, the multiarch tuples are used
to march the search paths used by the freedesktop.org runtime's patched
vulkan-loader.
self |
The SrtSystemInfo object |
|
multiarch_tuples |
Force the usage of the provided multiarch tuples like |
[nullable][array zero-terminated=1][element-type utf8] |
A list of
opaque SrtVulkanIcd objects. Free with
g_list_free_full(icds, srt_vulkan_icd_unref)
.
[transfer full][element-type SrtVulkanIcd]
GList *
srt_system_info_list_explicit_vulkan_layers
(SrtSystemInfo *self
);
List the available explicit Vulkan layers, using the same search paths as the reference vulkan-loader.
This function is not architecture-specific and may return a mixture of layers for more than one architecture or ABI, because the way the reference vulkan-loader works is to read a single search path for metadata describing layers, then filter out the ones that are for the wrong architecture at load time.
Some of the entries in the result might describe a bare SONAME in the standard library search path, which might exist for any or all architectures simultaneously. Other entries might describe the relative or absolute path to a specific library, which will only be usable for the architecture for which it was compiled.
Duplicated Vulkan layers are searched by their absolute path, obtained
using "inspect-library" in the multiarch tuples set using
"srt_system_info_set_multiarch_tuples()
".
A list of
opaque SrtVulkanLayer objects. Free with
g_list_free_full(layers, g_object_unref)
.
[transfer full][element-type SrtVulkanLayer]
GList *
srt_system_info_list_implicit_vulkan_layers
(SrtSystemInfo *self
);
List the available implicit Vulkan layers, using the same search paths as the reference vulkan-loader.
This function is not architecture-specific and may return a mixture of layers for more than one architecture or ABI, because the way the reference vulkan-loader works is to read a single search path for metadata describing layers, then filter out the ones that are for the wrong architecture at load time.
Some of the entries in the result might describe a bare SONAME in the standard library search path, which might exist for any or all architectures simultaneously. Other entries might describe the relative or absolute path to a specific library, which will only be usable for the architecture for which it was compiled.
Duplicated Vulkan layers are searched by their absolute path, obtained
using "inspect-library" in the multiarch tuples set using
"srt_system_info_set_multiarch_tuples()
".
A list of
opaque SrtVulkanLayer objects. Free with
g_list_free_full(layers, g_object_unref)
.
[transfer full][element-type SrtVulkanLayer]
GList * srt_system_info_list_dri_drivers (SrtSystemInfo *self
,const char *multiarch_tuple
,SrtDriverFlags flags
);
List of the available Mesa DRI modules.
For the search $LIBGL_DRIVERS_PATH will be used if set. Otherwise some implementation-dependent paths will be used instead.
Note that if $LIBGL_DRIVERS_PATH
is set, all drivers outside that
path will be treated as "extra", and omitted from the list unless
SRT_DRIVER_FLAGS_INCLUDE_ALL
is used.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A Debian-style multiarch
tuple such as |
[not nullable][type filename] |
flags |
Filter the list of DRI drivers accordingly to these flags.
For example, "extra" drivers that are unlikely to be found by
the Mesa DRI loader will only be included if the
|
A list of
opaque SrtDriDriver objects, or NULL
if nothing was found. Free with
g_list_free_full(list, g_object_unref)
.
[transfer full][element-type SrtDriDriver][nullable]
GList * srt_system_info_list_va_api_drivers (SrtSystemInfo *self
,const char *multiarch_tuple
,SrtDriverFlags flags
);
List of the available VA-API drivers.
For the search $LIBVA_DRIVERS_PATH will be used if set. Otherwise some implementation-dependent paths will be used instead.
Note that if $LIBVA_DRIVERS_PATH
is set, all drivers outside that
path will be treated as "extra", and omitted from the list unless
SRT_DRIVER_FLAGS_INCLUDE_ALL
is used.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A Debian-style multiarch
tuple such as |
[not nullable][type filename] |
flags |
Filter the list of VA-API drivers accordingly to these flags.
For example, "extra" drivers that are unlikely to be found by
the VA-API loader will only be included if the
|
A list of
opaque SrtVaApiDriver objects, or NULL
if nothing was found. Free with
g_list_free_full(list, g_object_unref)
.
[transfer full][element-type SrtVaApiDriver][nullable]
GList * srt_system_info_list_vdpau_drivers (SrtSystemInfo *self
,const char *multiarch_tuple
,SrtDriverFlags flags
);
List of the available VDPAU drivers.
For the search $VDPAU_DRIVER_PATH will be used if set. Otherwise some implementation-dependent paths will be used instead.
Note that if $VDPAU_DRIVER_PATH
is set, all drivers outside that
path will be treated as "extra", and omitted from the list unless
SRT_DRIVER_FLAGS_INCLUDE_ALL
is used.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A Debian-style multiarch
tuple such as |
[not nullable][type filename] |
flags |
Filter the list of VDPAU drivers accordingly to these flags.
For example, "extra" drivers that are unlikely to be found by
the VDPAU loader will only be included if the
|
A list of
opaque SrtVaApiDriver objects, or NULL
if nothing was found. Free with
g_list_free_full(list, g_object_unref)
.
[transfer full][element-type SrtVaApiDriver][nullable]
GList * srt_system_info_list_glx_icds (SrtSystemInfo *self
,const char *multiarch_tuple
,SrtDriverFlags flags
);
List the available GLX ICDs, in an unspecified order.
These are the drivers used by libGL.so.1
or libGLX.so.0
if it is the loader library provided by
GLVND
(if this is the case, srt_graphics_library_is_vendor_neutral()
for
the combination of SRT_WINDOW_SYSTEM_X11
and SRT_RENDERING_INTERFACE_GL
will return TRUE
and indicate SRT_GRAPHICS_LIBRARY_VENDOR_GLVND
).
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A Debian-style multiarch
tuple such as |
[not nullable][type filename] |
flags |
Filter the list of GLX ICDs accordingly to these flags.
At the moment no filters are available, so there are no practical
differences between |
void srt_system_info_set_environ (SrtSystemInfo *self
,gchar * const *env
);
Use env
instead of the real environment variable block environ
when locating the Steam Runtime.
If env
is NULL
, go back to using the real environment variables.
This method is not valid to call on a SrtSystemInfo that was
constructed with srt_system_info_new_from_json()
.
self |
The SrtSystemInfo |
|
env |
An array of environment variables. |
[nullable][array zero-terminated=1][element-type filename][transfer none] |
void srt_system_info_set_sysroot (SrtSystemInfo *self
,const char *root
);
Use root
instead of the real root directory when investigating
system properties.
If root
is NULL
or /
, go back to using the real root.
To bypass any filesystem virtualization that might be imposed by
something like FEX-Emu, use the "magic symlink" /proc/self/root
.
This method is not valid to call on a SrtSystemInfo that was
constructed with srt_system_info_new_from_json()
.
self |
The SrtSystemInfo |
|
root |
Path to the sysroot. |
[nullable][type filename][transfer none] |
void srt_system_info_set_helpers_path (SrtSystemInfo *self
,const gchar *path
);
Look for helper executables used to inspect the system state in path
,
instead of the normal installed location.
If path
is NULL
, go back to using the installed location.
This method is not valid to call on a SrtSystemInfo that was
constructed with srt_system_info_new_from_json()
.
const char *
srt_system_info_get_primary_multiarch_tuple
(SrtSystemInfo *self
);
Return the multiarch tuple set by
srt_system_info_set_primary_multiarch_tuple()
if any,
or the multiarch tuple corresponding to the steam-runtime-tools
library itself.
a Debian-style multiarch
tuple such as SRT_ABI_I386
or SRT_ABI_X86_64
.
[type filename][transfer none]
void srt_system_info_set_primary_multiarch_tuple (SrtSystemInfo *self
,const gchar *tuple
);
Set the primary architecture that is used to find helper
executables where the architecture does not matter, such as
checking locales.
The primary architecture is the first element from the list of
ABIs, editable by
.
If the list was not srt_system_info_set_multiarch_tuples()
NULL
, the previous primary multiarch
tuple will be demoted to be foreign and the new primary
multiarch tuple will be moved/added to the top of the list.
If tuple
is NULL
, revert to the default behaviour, which
is that the primary architecture is the architecture of the
steam-runtime-tools library.
This method is not valid to call on a SrtSystemInfo that was
constructed with srt_system_info_new_from_json()
.
self |
The SrtSystemInfo |
|
tuple |
A Debian-style
multiarch tuple such as |
[nullable][type filename][transfer none] |
void srt_system_info_set_multiarch_tuples (SrtSystemInfo *self
,const gchar * const *tuples
);
Set the list of ABIs that will be checked by default in contexts
where multiple ABIs are inspected at the same time, such as
. The first one listed is
assumed to be the primary architecture, and is used to find helper
executables where the architecture does not matter, such as
checking locales. The second and subsequent (if any) are assumed
to be "foreign" architectures.srt_system_info_list_dri_drivers()
If tuples
is NULL
or empty, revert to the default behaviour,
which is that the primary architecture is the architecture of the
steam-runtime-tools library, and there are no foreign architectures.
For example, to check the x86_64 and i386 ABIs on an x86 platform or the native ABI otherwise, you might use code like this:
1 2 3 4 5 6 7 8 9 10 11 12 |
#ifdef __x86_64__ const char const tuples[] = { SRT_ABI_X86_64, SRT_ABI_I386, NULL }; #elif defined(__i386__) const char const tuples[] = { SRT_ABI_I386, SRT_ABI_X86_64, NULL }; #else const char const tuples[] = { NULL }; #endif srt_system_info_set_multiarch_tuples (info, tuples); |
This method is not valid to call on a SrtSystemInfo that was
constructed with srt_system_info_new_from_json()
.
self |
The SrtSystemInfo |
|
tuples |
An array of Debian-style multiarch tuples such as |
[nullable][array zero-terminated=1][element-type filename][transfer none] |
GStrv
srt_system_info_dup_multiarch_tuples (SrtSystemInfo *self
);
Return the ABIs for which this object will carry out checks,
in the form of multiarch tuples as printed by
gcc -print-multiarch
in the Steam Runtime (in practice
this means SRT_ABI_I386
or SRT_ABI_X86_64
).
The ABIs that are to be checked can be set with
srt_system_info_set_multiarch_tuples()
.
The
ABIs used for various checks. Free with g_strfreev()
.
[array zero-terminated=1][transfer full]
void srt_system_info_set_test_flags (SrtSystemInfo *self
,SrtTestFlags flags
);
Alter the behaviour of the SrtSystemInfo to make automated tests quicker or give better test coverage.
This function should not be called in production code.
void srt_system_info_set_expected_runtime_version (SrtSystemInfo *self
,const char *version
);
Set the expected version number of the Steam Runtime. Invalidate any cached information about the Steam Runtime if it differs from the previous expectation.
self |
The SrtSystemInfo object |
|
version |
The expected version number, such as |
[nullable] |
gchar *
srt_system_info_dup_expected_runtime_version
(SrtSystemInfo *self
);
SrtRuntimeIssues
srt_system_info_get_runtime_issues (SrtSystemInfo *self
);
Detect and return any problems encountered with the Steam Runtime.
Any problems detected with the Steam Runtime,
or SRT_RUNTIME_ISSUES_NONE
if no problems were detected
gchar *
srt_system_info_dup_runtime_path (SrtSystemInfo *self
);
Return the absolute path to the Steam Runtime in use.
For the LD_LIBRARY_PATH
-based Steam Runtime, this is the directory
containing run.sh
, version.txt
and similar files.
If running in a Steam Runtime container or chroot, this function
returns /
to indicate that the entire container is the Steam Runtime.
This will typically be below
srt_system_info_dup_steam_installation_path()
, unless overridden.
If the Steam Runtime has been disabled or could not be found, at
least one flag will be set in the result of
srt_system_info_get_runtime_issues()
to indicate why.
gchar *
srt_system_info_dup_runtime_version (SrtSystemInfo *self
);
Return the version number of the Steam Runtime
in use, for example 0.20190711.3
, or NULL
if it could not be
determined. This could either be the LD_LIBRARY_PATH
-based Steam
Runtime, or a Steam Runtime container or chroot.
If the Steam Runtime has been disabled or could not be found, or its
version number could not be read, then at least one flag will be set
in the result of srt_system_info_get_runtime_issues()
to indicate why.
SrtSteamIssues
srt_system_info_get_steam_issues (SrtSystemInfo *self
);
Detect and return any problems encountered with the Steam installation.
Any problems detected with the Steam installation,
or SRT_STEAM_ISSUES_NONE
if no problems were detected
SrtSteam *
srt_system_info_get_steam_details (SrtSystemInfo *self
);
Gather and return information about the Steam installation.
gchar *
srt_system_info_dup_steam_installation_path
(SrtSystemInfo *self
);
Return the absolute path to the Steam installation in use (the
directory containing steam.sh
and ubuntu12_32/
among other
files and directories).
This directory is analogous to C:\Program Files\Steam
in a
typical Windows installation of Steam, and is typically of the form
/home/me/.local/share/Steam
. It is also known as the "Steam root",
and is canonically accessed via the symbolic link ~/.steam/root
(known as the "Steam root link").
Under normal circumstances, this is the same directory as
srt_system_info_dup_steam_data_path()
. However, it is possible to
construct situations where they are different, for example when a
Steam developer tests a new client build in its own installation
directory in conjunction with an existing data directory from the
production client, or when Steam was first installed using a Debian
package that suffered from
916303
(which resulted in ~/.steam/steam
being a plain directory, not a
symbolic link).
If the Steam installation could not be found, flags will
be set in the result of srt_system_info_get_steam_issues()
to indicate
why: at least SRT_STEAM_ISSUES_CANNOT_FIND
, and possibly others.
gchar *
srt_system_info_dup_steam_data_path (SrtSystemInfo *self
);
Return the absolute path to the Steam data directory in use (the
directory containing appcache/
, userdata/
and the default
steamapps/
or SteamApps/
installation path for games, among other
files and directories).
This directory is analogous to C:\Program Files\Steam
in a
typical Windows installation of Steam, and is typically of the form
/home/me/.local/share/Steam
. It is canonically accessed via the
symbolic link ~/.steam/steam
(known as the "Steam data link").
Under normal circumstances, this is the same directory as
srt_system_info_dup_steam_installation_path()
. However, it is possible
to construct situations where they are different, for example when a
Steam developer tests a new client build in its own installation
directory in conjunction with an existing data directory from the
production client, or when Steam was first installed using a Debian
package that suffered from
916303
(which resulted in ~/.steam/steam
being a plain directory, not a
symbolic link).
If the Steam data could not be found, flags will
be set in the result of srt_system_info_get_steam_issues()
to indicate
why: at least SRT_STEAM_ISSUES_CANNOT_FIND_DATA
, and possibly others.
gchar *
srt_system_info_dup_steam_bin32_path (SrtSystemInfo *self
);
Return the absolute path to the Steam ubuntu12_32
directory in use
(the directory containing steam-runtime/
among other files and
directories).
Under normal circumstances, this is a ubuntu12_32
direct subdirectory
under the srt_system_info_dup_steam_installation_path()
.
Typically of the form /home/me/.local/share/Steam/ubuntu12_32
.
It is canonically accessed via the symbolic link ~/.steam/bin32
.
gchar ** srt_system_info_list_pressure_vessel_overrides (SrtSystemInfo *self
,gchar ***messages
);
If running in a Steam Runtime container using pressure-vessel
,
list the libraries from the container that have been overridden
with libraries from the host system.
The output is intended to be human-readable debugging information, rather than something to use programmatically, and its format is not guaranteed.
Similarly, messages
is intended to be human-readable debugging
information.
self |
The SrtSystemInfo object |
|
messages |
If
not |
[optional][out][array zero-terminated=1][transfer full] |
A
NULL
-terminated array of libraries that have been overridden,
or NULL
if this process does not appear to be in a pressure-vessel
container. Free with g_strfreev()
.
[array zero-terminated=1][transfer full][nullable]
gchar ** srt_system_info_list_pinned_libs_32 (SrtSystemInfo *self
,gchar ***messages
);
If running in an LD_LIBRARY_PATH
-based Steam Runtime, return
information about SRT_ABI_I386
libraries that have been "pinned".
Normally, the Steam Runtime infrastructure prefers to use shared
libraries from the host OS, if available, rather than the
library of the same SONAME
from the Steam Runtime. However, if
a library in the Steam Runtime is newer then the version in the
host OS, or if it is known to be incompatible with newer
libraries with the same SONAME
, then the library from the
Steam Runtime is said to have been "pinned": it is used with a
higher precedence than libraries from the host OS.
If not in an LD_LIBRARY_PATH
-based Steam Runtime, return NULL
.
The output is intended to be human-readable debugging information, rather than something to use programmatically, and its format is not guaranteed.
Similarly, messages
is intended to be human-readable debugging
information.
self |
The SrtSystemInfo object |
|
messages |
If
not |
[optional][out][array zero-terminated=1][transfer full] |
An array of strings, or NULL
if not in an LD_LIBRARY_PATH
-based Steam
Runtime or if it was not possible to list the pinned libs.
Free with g_strfreev()
.
[array zero-terminated=1][transfer full][element-type utf8][nullable]
gchar ** srt_system_info_list_pinned_libs_64 (SrtSystemInfo *self
,gchar ***messages
);
If running in an LD_LIBRARY_PATH
-based Steam Runtime, return
information about SRT_ABI_X86_64
libraries that have been "pinned".
Normally, the Steam Runtime infrastructure prefers to use shared
libraries from the host OS, if available, rather than the
library of the same SONAME
from the Steam Runtime. However, if
a library in the Steam Runtime is newer then the version in the
host OS, or if it is known to be incompatible with newer
libraries with the same SONAME
, then the library from the
Steam Runtime is said to have been "pinned": it is used with a
higher precedence than libraries from the host OS.
If not in an LD_LIBRARY_PATH
-based Steam Runtime, return NULL
.
The output is intended to be human-readable debugging information, rather than something to use programmatically, and its format is not guaranteed.
Similarly, messages
is intended to be human-readable debugging
information.
self |
The SrtSystemInfo object |
|
messages |
If
not |
[optional][out][array zero-terminated=1][transfer full] |
An array of strings, or NULL
if not in an LD_LIBRARY_PATH
-based Steam
Runtime or if it was not possible to list the pinned libs.
Free with g_strfreev()
.
[array zero-terminated=1][transfer full][element-type utf8][nullable]
SrtLocaleIssues
srt_system_info_get_locale_issues (SrtSystemInfo *self
);
Check that the locale specified by environment variables, and some other commonly-assumed locales, are available and suitable.
SrtLocale * srt_system_info_check_locale (SrtSystemInfo *self
,const char *requested_name
,GError **error
);
Check whether the given locale can be set successfully.
self |
The SrtSystemInfo |
|
requested_name |
The locale to request, for example |
|
error |
Used to return an error on failure |
A SrtLocale object, or NULL
if the requested locale could not be set.
Free with g_object_unref()
if non-NULL
.
[transfer full][nullable]
gchar *
srt_system_info_dup_os_build_id (SrtSystemInfo *self
);
Return a machine-readable identifier for the system image used as the
origin for a distribution, for example 0.20190925.0
. If called
from inside a Steam Runtime container, return the Steam Runtime build
ID, which currently looks like 0.20190925.0
.
In operating systems that do not use image-based installation, such
as Debian, this will be NULL
.
This is the BUILD_ID
from os-release(5).
gchar *
srt_system_info_dup_os_id (SrtSystemInfo *self
);
Return a lower-case machine-readable operating system identifier,
for example debian
or arch
. If called from inside a Steam Runtime
container, return steamrt
.
This is the ID
in os-release(5). If os-release(5) is not available,
future versions of this library might derive a similar ID from
lsb_release(1).
gchar ** srt_system_info_dup_os_id_like (SrtSystemInfo *self
,gboolean include_self
);
Return an array of lower-case machine-readable operating system
identifiers similar to srt_system_info_dup_os_id()
describing OSs
that this one resembles or is derived from.
For example, the Steam Runtime 1 'scout' is derived from Ubuntu,
which is itself derived from Debian, so srt_system_info_dup_os_id_like()
would return { "debian", "ubuntu", NULL }
if include_self
is false,
{ "steamrt", "debian", "ubuntu", NULL }
otherwise.
This is the ID_LIKE
field from os-release(5), possibly combined
with the ID
field.
self |
The SrtSystemInfo object |
|
include_self |
If |
An
array of OS IDs, or NULL
if nothing is known.
Free with g_strfreev()
.
[array zero-terminated=1][transfer full][element-type utf8][nullable]
gchar *
srt_system_info_dup_os_name (SrtSystemInfo *self
);
Return a human-readable identifier for the operating system without
its version, for example Debian GNU/Linux
or Arch Linux
.
This is the NAME
in os-release(5). If os-release(5) is not
available, future versions of this library might derive a similar
name from lsb_release(1).
gchar *
srt_system_info_dup_os_pretty_name (SrtSystemInfo *self
);
Return a human-readable identifier for the operating system,
including its version if any, for example Debian GNU/Linux 10 (buster)
or Arch Linux
.
If the OS uses rolling releases, this will probably be the same as
or similar to srt_system_info_dup_os_name()
.
This is the PRETTY_NAME
in os-release(5). If os-release(5) is not
available, future versions of this library might derive a similar
name from lsb_release(1).
gchar *
srt_system_info_dup_os_variant (SrtSystemInfo *self
);
Return a human-readable identifier for the operating system variant,
for example Workstation Edition
, Server Edition
or
Raspberry Pi Edition
. In operating systems that do not have
formal variants this will usually be NULL
.
This is the VARIANT
in os-release(5).
gchar *
srt_system_info_dup_os_variant_id (SrtSystemInfo *self
);
Return a lower-case machine-readable identifier for the operating system
variant in a form suitable for use in filenames, for example
workstation
, server
or rpi
. In operating systems that do not
have formal variants this will usually be NULL
.
This is the VARIANT_ID
in os-release(5).
gchar *
srt_system_info_dup_os_version_codename
(SrtSystemInfo *self
);
Return a lower-case machine-readable identifier for the operating
system version codename, for example buster
for Debian 10 "buster".
In operating systems that do not use codenames in machine-readable
contexts, this will usually be NULL
.
This is the VERSION_CODENAME
in os-release(5). If os-release(5) is not
available, future versions of this library might derive a similar
codename from lsb_release(1).
gchar *
srt_system_info_dup_os_version_id (SrtSystemInfo *self
);
Return a machine-readable identifier for the operating system version,
for example 10
for Debian 10 "buster". In operating systems that
only have rolling releases, such as Arch Linux, or in OS branches
that behave like rolling releases, such as Debian unstable, this
will usually be NULL
.
This is the VERSION_ID
in os-release(5). If os-release(5) is not
available, future versions of this library might derive a similar
identifier from lsb_release(1).
gchar **
srt_system_info_list_driver_environment
(SrtSystemInfo *self
);
List of the driver-selection environment variables.
Some drivers have an environment variable that overrides the automatic
detection of which driver should be used.
For example Mesa has MESA_LOADER_DRIVER_OVERRIDE
, VA-API has
LIBVA_DRIVER_NAME
and so on.
The output will contain a list, in the form "NAME=VALUE", of the well-known driver environment variables that are currently being set.
The drivers will be in lexicographic order, for example
LIBVA_DRIVER_NAME=radeonsi
, VDPAU_DRIVER=radeonsi
,
__GLX_FORCE_VENDOR_LIBRARY_0=i965
, in that order.
An array of strings, or NULL
if we were unable to find driver-selection
environment variables. Free with g_strfreev()
.
[array zero-terminated=1][transfer full][element-type utf8][nullable]
GList *
srt_system_info_list_desktop_entries (SrtSystemInfo *self
);
List all the available desktop applications that are able to handle the type "x-scheme-handler/steam".
This function will also search for well known desktop applications ID like
the Flathub com.valvesoftware.Steam.desktop
and they'll be included even
if they are not able to handle the steam:
URI.
Using
it is possible to filter them out.srt_desktop_entry_is_steam_handler()
The returned list is in no particular order.
Please note that the environment variables of the current process will be used.
Any possible custom environ set with
will be
ignored.srt_system_info_set_environ()
A list of
opaque SrtDesktopEntry objects or NULL
if nothing was found. Free with
g_list_free_full (entries, g_object_unref)
.
[transfer full][element-type SrtDesktopEntry][nullable]
SrtDisplayInfo *
srt_system_info_check_display (SrtSystemInfo *self
);
Gather and return information about the display server that is currently in use.
SrtX86FeatureFlags
srt_system_info_get_x86_features (SrtSystemInfo *self
);
Detect and return a list of x86 features that the CPU supports.
x86 CPU supported features, or SRT_X86_FEATURE_NONE
if none of the checked features are supported.
SrtX86FeatureFlags
srt_system_info_get_known_x86_features
(SrtSystemInfo *self
);
Return a list of x86 CPU features that has been checked.
x86 CPU checked features, or SRT_X86_FEATURE_NONE
if no features were checked, e.g. when the CPU is not x86 based.
gchar *
srt_system_info_dup_steamscript_path (SrtSystemInfo *self
);
Return the absolute path to the script used to launch Steam, if known.
If the application using this library was not run as a child process
of the Steam client, then this will usually be NULL
.
This will usually be /usr/bin/steam
for the packaged Steam launcher
released by Valve, /app/bin/steam
for the Flatpak app, or either
/usr/bin/steam
or /usr/games/steam
for third-party packaged versions
of the Steam client.
gchar *
srt_system_info_dup_steamscript_version
(SrtSystemInfo *self
);
Return the version of the script used to launch Steam, if known.
If the application using this library was not run as a child process
of the Steam client, then this will usually be NULL
.
Typical values look like 1.0.0.66
for the packaged Steam launcher
released by Valve, 1.0.0.66-2/Debian
for recent Debian packages, or
NULL
for older Debian/Ubuntu packages. Future Ubuntu packages might
produce a string like 1.0.0.66-2ubuntu1/Ubuntu
.
GList *
srt_system_info_list_xdg_portal_backends
(SrtSystemInfo *self
);
List the XDG portal backends that have been checked, with information about their eventual availability.
Examples of XDG portal backends are "org.freedesktop.impl.portal.desktop.gtk" and "org.freedesktop.impl.portal.desktop.kde".
The returned list is in the same arbitrary order as the check-xdg-portal helper used to return them.
A list of opaque SrtXdgPortalBackend objects or NULL
if an error
occurred trying to check the backends availability or if we were unable to
check them, e.g. if we are in a Flatpak environment.
Free with g_list_free_full (backends, g_object_unref)
.
[transfer full][element-type SrtXdgPortalBackend][nullable]
GList *
srt_system_info_list_xdg_portal_interfaces
(SrtSystemInfo *self
);
List the XDG portal interfaces that have been checked, with information about their eventual availability and version property.
Examples of XDG portal interfaces are "org.freedesktop.portal.OpenURI" and "org.freedesktop.portal.Email".
The returned list is in the same arbitrary order as the check-xdg-portal helper used to return them.
A list of opaque SrtXdgPortalInterface objects or NULL
if an error
occurred trying to check the interfaces availability. Free with
g_list_free_full (interfaces, g_object_unref)
.
[transfer full][element-type SrtXdgPortalInterface][nullable]
SrtXdgPortalIssues srt_system_info_get_xdg_portal_issues (SrtSystemInfo *self
,gchar **messages
);
Check if the current system supports the XDG portals.
self |
The SrtSystemInfo object |
|
messages |
If not |
[optional][out] |
gboolean srt_system_info_check_runtime_linker (SrtSystemInfo *self
,const char *multiarch_tuple
,gchar **resolved
,GError **error
);
Check whether the runtime linker ld.so(8)
for the ABI described
by multiarch_tuple
, as returned by
srt_architecture_get_expected_runtime_linker()
, is available.
If ld.so
is unavailable, return FALSE
with error
set.
If not enough information is available to determine whether ld.so
is available, raise SRT_ARCHITECTURE_ERROR_NO_INFORMATION
.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A multiarch tuple defining an ABI, as printed
by |
|
resolved |
Used
to return the path to the runtime linker after resolving all
symbolic links. Free with |
[out][type filename][transfer full][optional] |
error |
Used to raise an error on failure. |
gchar * srt_system_info_dup_libdl_lib (SrtSystemInfo *self
,const char *multiarch_tuple
,GError **error
);
Return the expansion of the dynamic linker string token $LIB
,
if possible.
If the library path to be loaded with
or similar contains
the literal tokens dlopen()
$LIB
or ${LIB}
, the dynamic linker will replace
them with the library directory returned by this function. See ld.so(8)
section "Dynamic string tokens" for more details.
Because there is currently no glibc API to determine how this token would
be expanded, only a finite number of known values can currently be detected.
If called on a platform where $LIB
has a different expansion, this
function will return NULL
.
NULL
is also returned if an error occurs while attempting to determine the
expansion of this token.
Typical values look like lib
, lib32
, lib64
, lib/x86-64-linux-gnu
or lib/i386-linux-gnu
.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A multiarch tuple defining an ABI, as printed
by |
|
error |
Used to raise an error on failure. |
gchar * srt_system_info_dup_libdl_platform (SrtSystemInfo *self
,const char *multiarch_tuple
,GError **error
);
Return the expansion of the dynamic linker string token $PLATFORM
,
if possible.
If the library path to be loaded with
or similar contains
the literal tokens dlopen()
$PLATFORM
or ${PLATFORM}
, the dynamic linker will
replace them with the library directory returned by this function. See
ld.so(8)
section "Dynamic string tokens" for more details.
Because there is currently no glibc API to determine how this token would
be expanded, only a finite number of known values can currently be detected.
If called on a platform where $PLATFORM
has a different expansion, this
function will return NULL
.
NULL
is also returned if an error occurs while attempting to determine the
expansion of this token.
Typical values look like x86_64
, haswell
, xeon_phi
, i386
, i486
,
i586
, i686
, or aarch64
.
self |
The SrtSystemInfo object |
|
multiarch_tuple |
A multiarch tuple defining an ABI, as printed
by |
|
error |
Used to raise an error on failure. |
A bitfield with flags representing behaviour changes used in automated
tests, or SRT_TEST_FLAGS_NONE
(which is numerically zero) for normal
production behaviour.
A bitfield with flags representing filters, used when retrieving a
list of drivers. Use SRT_DRIVER_FLAGS_NONE
for a list of the drivers that
are believed to be on the search path that will be used in practice.
Get all the drivers that have been found,
even if they are in directories that we do not believe will normally be
loaded ( |
||
Get just the drivers found in the canonical folders |
“expectations”
property“expectations” gchar *
Path to a directory containing information about the properties we expect the system to have, or NULL if unknown.
Flags: Read / Write / Construct Only
Default value: NULL