| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: prop_send_ioctl.3,v 1.6 2011/01/20 10:44:42 wiz Exp $ | | 1 | .\" $NetBSD: prop_send_ioctl.3,v 1.7 2011/01/20 10:45:10 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Jason R. Thorpe. | | 7 | .\" by Jason R. Thorpe. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -55,52 +55,26 @@ | | | @@ -55,52 +55,26 @@ |
55 | The | | 55 | The |
56 | .Nm prop_array_send_ioctl , | | 56 | .Nm prop_array_send_ioctl , |
57 | .Nm prop_array_recv_ioctl , | | 57 | .Nm prop_array_recv_ioctl , |
58 | .Nm prop_dictionary_send_ioctl , | | 58 | .Nm prop_dictionary_send_ioctl , |
59 | .Nm prop_dictionary_recv_ioctl , | | 59 | .Nm prop_dictionary_recv_ioctl , |
60 | and | | 60 | and |
61 | .Nm prop_dictionary_sendrecv_ioctl | | 61 | .Nm prop_dictionary_sendrecv_ioctl |
62 | functions implement the user space side of a protocol for sending property | | 62 | functions implement the user space side of a protocol for sending property |
63 | lists to and from the kernel using | | 63 | lists to and from the kernel using |
64 | .Xr ioctl 2 . | | 64 | .Xr ioctl 2 . |
65 | .Sh RETURN VALUES | | 65 | .Sh RETURN VALUES |
66 | If successful, functions return zero. | | 66 | If successful, functions return zero. |
67 | Otherwise, an error number is returned to indicate the error. | | 67 | Otherwise, an error number is returned to indicate the error. |
68 | .Sh ERRORS | | | |
69 | .Fn prop_array_send_ioctl | | | |
70 | and | | | |
71 | .Fn prop_dictionary_send_ioctl | | | |
72 | will fail if: | | | |
73 | .Bl -tag -width Er | | | |
74 | .It Bq Er ENOMEM | | | |
75 | Cannot allocate memory | | | |
76 | .It Bq Er ENOTSUP | | | |
77 | Not supported | | | |
78 | .El | | | |
79 | .Pp | | | |
80 | .Fn prop_array_recv_ioctl | | | |
81 | and | | | |
82 | .Fn prop_dictionary_recv_ioctl | | | |
83 | will fail if: | | | |
84 | .Bl -tag -width Er | | | |
85 | .It Bq Er EIO | | | |
86 | Input/output error | | | |
87 | .It Bq Er ENOTSUP | | | |
88 | Not supported | | | |
89 | .El | | | |
90 | .Pp | | | |
91 | In addition to these, | | | |
92 | .Xr ioctl 2 | | | |
93 | errors may be returned. | | | |
94 | .Sh EXAMPLES | | 68 | .Sh EXAMPLES |
95 | The following | | 69 | The following |
96 | .Pq simplified | | 70 | .Pq simplified |
97 | example demonstrates using | | 71 | example demonstrates using |
98 | .Fn prop_dictionary_send_ioctl | | 72 | .Fn prop_dictionary_send_ioctl |
99 | and | | 73 | and |
100 | .Fn prop_dictionary_recv_ioctl | | 74 | .Fn prop_dictionary_recv_ioctl |
101 | in an application: | | 75 | in an application: |
102 | .Bd -literal | | 76 | .Bd -literal |
103 | void | | 77 | void |
104 | foo_setprops(prop_dictionary_t dict) | | 78 | foo_setprops(prop_dictionary_t dict) |
105 | { | | 79 | { |
106 | int fd; | | 80 | int fd; |
| @@ -128,23 +102,49 @@ foo_getprops(void) | | | @@ -128,23 +102,49 @@ foo_getprops(void) |
128 | return (NULL); | | 102 | return (NULL); |
129 | | | 103 | |
130 | (void) close(fd); | | 104 | (void) close(fd); |
131 | | | 105 | |
132 | return (dict); | | 106 | return (dict); |
133 | } | | 107 | } |
134 | .Ed | | 108 | .Ed |
135 | .Pp | | 109 | .Pp |
136 | The | | 110 | The |
137 | .Nm prop_dictionary_sendrecv_ioctl | | 111 | .Nm prop_dictionary_sendrecv_ioctl |
138 | function combines the send and receive functionality, allowing for | | 112 | function combines the send and receive functionality, allowing for |
139 | ioctls that require two-way communication | | 113 | ioctls that require two-way communication |
140 | .Pq for example to specify arguments for the ioctl operation . | | 114 | .Pq for example to specify arguments for the ioctl operation . |
| | | 115 | .Sh ERRORS |
| | | 116 | .Fn prop_array_send_ioctl |
| | | 117 | and |
| | | 118 | .Fn prop_dictionary_send_ioctl |
| | | 119 | will fail if: |
| | | 120 | .Bl -tag -width Er |
| | | 121 | .It Bq Er ENOMEM |
| | | 122 | Cannot allocate memory |
| | | 123 | .It Bq Er ENOTSUP |
| | | 124 | Not supported |
| | | 125 | .El |
| | | 126 | .Pp |
| | | 127 | .Fn prop_array_recv_ioctl |
| | | 128 | and |
| | | 129 | .Fn prop_dictionary_recv_ioctl |
| | | 130 | will fail if: |
| | | 131 | .Bl -tag -width Er |
| | | 132 | .It Bq Er EIO |
| | | 133 | Input/output error |
| | | 134 | .It Bq Er ENOTSUP |
| | | 135 | Not supported |
| | | 136 | .El |
| | | 137 | .Pp |
| | | 138 | In addition to these, |
| | | 139 | .Xr ioctl 2 |
| | | 140 | errors may be returned. |
141 | .Sh SEE ALSO | | 141 | .Sh SEE ALSO |
142 | .Xr prop_array 3 , | | 142 | .Xr prop_array 3 , |
143 | .Xr prop_dictionary 3 , | | 143 | .Xr prop_dictionary 3 , |
144 | .Xr proplib 3 , | | 144 | .Xr proplib 3 , |
145 | .Xr prop_copyin_ioctl 9 | | 145 | .Xr prop_copyin_ioctl 9 |
146 | .Sh HISTORY | | 146 | .Sh HISTORY |
147 | The | | 147 | The |
148 | .Nm proplib | | 148 | .Nm proplib |
149 | property container object library first appeared in | | 149 | property container object library first appeared in |
150 | .Nx 4.0 . | | 150 | .Nx 4.0 . |