Function

Gmdevice_tree_get_compatibles

Declaration [src]

GStrv
gm_device_tree_get_compatibles (
  const char* sysfs_root,
  GError** error
)

Description [src]

Read compatible machine types from sysfs_root/firmware/devicetree/base/compatible on Linux. If the path doesn’t exist or host is not Linux return NULL.

For debugging purposes GMOBILE_DT_COMPATIBLES can be set to a : separated list of compatibles which will be returned instead.

Parameters

sysfs_root

Type: const char*

Path where /sys is mounted. Defaults to /sys if NULL is passed.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: An array of utf8

Compatible machine types or NULL.

The array is NULL-terminated.
Each element is a NUL terminated UTF-8 string.