Go to main content

man pages section 3: Extended Library Functions, Volume 1

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

devfs_get_product_info (3DEVINFO)

Name

devfs_get_product_info - return product info strings

Synopsis

#include <libdevinfo.h>
int devfs_get_product_info(devfs_prodinfo_t id, char *s, int32_t n);

Parameters

id

The identifier of the desired product information string

s

A buffer in which the string is returned

n

Length of the buffer in bytes, must be DEVFS_PRODINFO_LEN

Description

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.

Return Values

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.

Errors

The devfs_get_product_info() function will fail if:

EINVAL

The size of the buffer is not supported

EFAULT

Illegal address

Examples

Example 1 Returning the Product Name of the System

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);

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Safe

See Also

prtconf(8), libdevinfo(3LIB)