1di_devlink_dup(3DEVINFDOe)vice Information Library Functiodnis_devlink_dup(3DEVINFO)
2
3
4

NAME

6       di_devlink_dup, di_devlink_free - copy and free a devlink object
7

SYNOPSIS

9       cc [ flag... ] file... -ldevinfo [ library... ]
10       #include <libdevinfo.h>
11
12       di_devlink_t di_devlink_dup(di_devlink_t devlink);
13
14
15       int di_devlink_free(di_devlink_t devlink);
16
17

PARAMETERS

19       devlink    An opaque handle to a devlink.
20
21

DESCRIPTION

23       Typically,  a  di_devlink_t  object  is only accessible from within the
24       scope  of  the   di_devlink_walk(3DEVINFO)   callback   function.   The
25       di_devlink_dup()  function  allows the callback function implementation
26       to make a duplicate copy of the di_devlink_t object. The duplicate copy
27       is valid and accessible until di_devlink_free() is called.
28
29
30       The  di_devlink_dup()  function returns a copy of a devlink object. The
31       di_devlink_free() function frees this copy.
32

RETURN VALUES

34       Upon successful completion, di_devlink_dup()  returns  a  copy  of  the
35       devlink object passed in.  Otherwise, NULL is returned and errno is set
36       to indicate the error.
37
38
39       Upon successful completion, di_devlink_free() returns 0. Otherwise,  -1
40       is returned and errno is set to indicate the error.
41

ERRORS

43       The di_devlink_dup() and di_devlink_free() functions will fail if:
44
45       EINVAL    The devlink argument is not a valid handle.
46
47
48
49       The di_devlink_dup() function can set errno to any error value that can
50       also be set by malloc(3C).
51

ATTRIBUTES

53       See attributes(5)  for descriptions of the following attributes:
54
55
56
57
58       ┌─────────────────────────────┬─────────────────────────────┐
59       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
60       ├─────────────────────────────┼─────────────────────────────┤
61       │Interface Stability          │Committed                    │
62       ├─────────────────────────────┼─────────────────────────────┤
63       │MT-Level                     │Safe                         │
64       └─────────────────────────────┴─────────────────────────────┘
65

SEE ALSO

67       di_devlink_init(3DEVINFO),                   di_devlink_path(3DEVINFO),
68       di_devlink_walk(3DEVINFO), libdevinfo(3LIB), malloc(3C), attributes(5)
69
70
71
72SunOS 5.11                        15 May 2008         di_devlink_dup(3DEVINFO)
Impressum