177 {
178 return (NULL);
179 }
180
181 static const ps_ops_t P_default_ops = {
182 .pop_pread = (pop_pread_t)Pdefault_ssizet,
183 .pop_pwrite = (pop_pwrite_t)Pdefault_ssizet,
184 .pop_read_maps = (pop_read_maps_t)Pdefault_int,
185 .pop_read_aux = (pop_read_aux_t)Pdefault_void,
186 .pop_cred = (pop_cred_t)Pdefault_int,
187 .pop_priv = (pop_priv_t)Pdefault_int,
188 .pop_psinfo = (pop_psinfo_t)Pdefault_voidp,
189 .pop_status = (pop_status_t)Pdefault_void,
190 .pop_lstatus = (pop_lstatus_t)Pdefault_voidp,
191 .pop_lpsinfo = (pop_lpsinfo_t)Pdefault_voidp,
192 .pop_fini = (pop_fini_t)Pdefault_void,
193 .pop_platform = (pop_platform_t)Pdefault_voidp,
194 .pop_uname = (pop_uname_t)Pdefault_int,
195 .pop_zonename = (pop_zonename_t)Pdefault_voidp,
196 .pop_execname = (pop_execname_t)Pdefault_voidp,
197 #if defined(__i386) || defined(__amd64)
198 .pop_ldt = (pop_ldt_t)Pdefault_int
199 #endif
200 };
201
202 /*
203 * Initialize the destination ops vector with functions from the source.
204 * Functions which are NULL in the source ops vector are set to corresponding
205 * default function in the destination vector.
206 */
207 void
208 Pinit_ops(ps_ops_t *dst, const ps_ops_t *src)
209 {
210 *dst = P_default_ops;
211
212 if (src->pop_pread != NULL)
213 dst->pop_pread = src->pop_pread;
214 if (src->pop_pwrite != NULL)
215 dst->pop_pwrite = src->pop_pwrite;
216 if (src->pop_read_maps != NULL)
222 if (src->pop_priv != NULL)
223 dst->pop_priv = src->pop_priv;
224 if (src->pop_psinfo != NULL)
225 dst->pop_psinfo = src->pop_psinfo;
226 if (src->pop_status != NULL)
227 dst->pop_status = src->pop_status;
228 if (src->pop_lstatus != NULL)
229 dst->pop_lstatus = src->pop_lstatus;
230 if (src->pop_lpsinfo != NULL)
231 dst->pop_lpsinfo = src->pop_lpsinfo;
232 if (src->pop_fini != NULL)
233 dst->pop_fini = src->pop_fini;
234 if (src->pop_platform != NULL)
235 dst->pop_platform = src->pop_platform;
236 if (src->pop_uname != NULL)
237 dst->pop_uname = src->pop_uname;
238 if (src->pop_zonename != NULL)
239 dst->pop_zonename = src->pop_zonename;
240 if (src->pop_execname != NULL)
241 dst->pop_execname = src->pop_execname;
242 #if defined(__i386) || defined(__amd64)
243 if (src->pop_ldt != NULL)
244 dst->pop_ldt = src->pop_ldt;
245 #endif
246 }
|
177 {
178 return (NULL);
179 }
180
181 static const ps_ops_t P_default_ops = {
182 .pop_pread = (pop_pread_t)Pdefault_ssizet,
183 .pop_pwrite = (pop_pwrite_t)Pdefault_ssizet,
184 .pop_read_maps = (pop_read_maps_t)Pdefault_int,
185 .pop_read_aux = (pop_read_aux_t)Pdefault_void,
186 .pop_cred = (pop_cred_t)Pdefault_int,
187 .pop_priv = (pop_priv_t)Pdefault_int,
188 .pop_psinfo = (pop_psinfo_t)Pdefault_voidp,
189 .pop_status = (pop_status_t)Pdefault_void,
190 .pop_lstatus = (pop_lstatus_t)Pdefault_voidp,
191 .pop_lpsinfo = (pop_lpsinfo_t)Pdefault_voidp,
192 .pop_fini = (pop_fini_t)Pdefault_void,
193 .pop_platform = (pop_platform_t)Pdefault_voidp,
194 .pop_uname = (pop_uname_t)Pdefault_int,
195 .pop_zonename = (pop_zonename_t)Pdefault_voidp,
196 .pop_execname = (pop_execname_t)Pdefault_voidp,
197 .pop_secflags = (pop_secflags_t)Pdefault_int,
198 #if defined(__i386) || defined(__amd64)
199 .pop_ldt = (pop_ldt_t)Pdefault_int
200 #endif
201 };
202
203 /*
204 * Initialize the destination ops vector with functions from the source.
205 * Functions which are NULL in the source ops vector are set to corresponding
206 * default function in the destination vector.
207 */
208 void
209 Pinit_ops(ps_ops_t *dst, const ps_ops_t *src)
210 {
211 *dst = P_default_ops;
212
213 if (src->pop_pread != NULL)
214 dst->pop_pread = src->pop_pread;
215 if (src->pop_pwrite != NULL)
216 dst->pop_pwrite = src->pop_pwrite;
217 if (src->pop_read_maps != NULL)
223 if (src->pop_priv != NULL)
224 dst->pop_priv = src->pop_priv;
225 if (src->pop_psinfo != NULL)
226 dst->pop_psinfo = src->pop_psinfo;
227 if (src->pop_status != NULL)
228 dst->pop_status = src->pop_status;
229 if (src->pop_lstatus != NULL)
230 dst->pop_lstatus = src->pop_lstatus;
231 if (src->pop_lpsinfo != NULL)
232 dst->pop_lpsinfo = src->pop_lpsinfo;
233 if (src->pop_fini != NULL)
234 dst->pop_fini = src->pop_fini;
235 if (src->pop_platform != NULL)
236 dst->pop_platform = src->pop_platform;
237 if (src->pop_uname != NULL)
238 dst->pop_uname = src->pop_uname;
239 if (src->pop_zonename != NULL)
240 dst->pop_zonename = src->pop_zonename;
241 if (src->pop_execname != NULL)
242 dst->pop_execname = src->pop_execname;
243 if (src->pop_secflags != NULL)
244 dst->pop_secflags = src->pop_secflags;
245 #if defined(__i386) || defined(__amd64)
246 if (src->pop_ldt != NULL)
247 dst->pop_ldt = src->pop_ldt;
248 #endif
249 }
|