devfs_get_product_info - return product info strings
#include <libdevinfo.h> int devfs_get_product_info(devfs_prodinfo_t id, char *s, int32_t n);
The identifier of the desired product information string
A buffer in which the string is returned
Length of the buffer in bytes, must be DEVFS_PRODINFO_LEN
The devfs_get_product_info() returns the respective product information string as defined for that product by the vendor. Not all products provide each product information string.
The number of bytes written to the buffer is returned, and excludes the terminating null. If a product string is not supported, 0 is returned and the buffer is not modified. A negative value is returned in the case of an error.
The devfs_get_product_info() function will fail if:
The size of the buffer is not supported
Illegal address
This example returns the product name of the system.
int n; char s[DEVFS_PRODINFO_LEN]; if ((n = devfs_get_product_info(DEVFS_PRODINFO_NAME, s, DEVFS_PRODINFO_LEN)) > 0) printf("name: %s\n", s);
See attributes(7) for descriptions of the following attributes:
|