prop_*_copyout takes an object as second parameter, not a pointer to object.diff -r1.10 -r1.11 src/common/include/prop/prop_array.h
(bouyer)
--- src/common/include/prop/prop_array.h 2011/01/19 20:34:23 1.10
+++ src/common/include/prop/prop_array.h 2011/01/20 11:17:58 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: prop_array.h,v 1.10 2011/01/19 20:34:23 bouyer Exp $ */ | 1 | /* $NetBSD: prop_array.h,v 1.11 2011/01/20 11:17:58 bouyer Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -67,27 +67,27 @@ prop_array_t prop_array_internalize_from | @@ -67,27 +67,27 @@ prop_array_t prop_array_internalize_from | |||
67 | 67 | |||
68 | #if defined(__NetBSD__) | 68 | #if defined(__NetBSD__) | |
69 | struct plistref; | 69 | struct plistref; | |
70 | 70 | |||
71 | #if !defined(_KERNEL) && !defined(_STANDALONE) | 71 | #if !defined(_KERNEL) && !defined(_STANDALONE) | |
72 | bool prop_array_externalize_to_pref(prop_array_t, struct plistref *); | 72 | bool prop_array_externalize_to_pref(prop_array_t, struct plistref *); | |
73 | int prop_array_send_ioctl(prop_array_t, int, unsigned long); | 73 | int prop_array_send_ioctl(prop_array_t, int, unsigned long); | |
74 | int prop_array_recv_ioctl(int, unsigned long, prop_array_t *); | 74 | int prop_array_recv_ioctl(int, unsigned long, prop_array_t *); | |
75 | bool prop_array_send_syscall(prop_array_t, struct plistref *); | 75 | bool prop_array_send_syscall(prop_array_t, struct plistref *); | |
76 | bool prop_array_recv_syscall(const struct plistref *, | 76 | bool prop_array_recv_syscall(const struct plistref *, | |
77 | prop_array_t *); | 77 | prop_array_t *); | |
78 | #elif defined(_KERNEL) | 78 | #elif defined(_KERNEL) | |
79 | int prop_array_copyin(const struct plistref *, prop_array_t *); | 79 | int prop_array_copyin(const struct plistref *, prop_array_t *); | |
80 | int prop_array_copyout(struct plistref *, prop_array_t *); | 80 | int prop_array_copyout(struct plistref *, prop_array_t); | |
81 | int prop_array_copyin_ioctl(const struct plistref *, const u_long, | 81 | int prop_array_copyin_ioctl(const struct plistref *, const u_long, | |
82 | prop_array_t *); | 82 | prop_array_t *); | |
83 | int prop_array_copyout_ioctl(struct plistref *, const u_long, | 83 | int prop_array_copyout_ioctl(struct plistref *, const u_long, | |
84 | prop_array_t); | 84 | prop_array_t); | |
85 | #endif | 85 | #endif | |
86 | #endif /* __NetBSD__ */ | 86 | #endif /* __NetBSD__ */ | |
87 | 87 | |||
88 | /* | 88 | /* | |
89 | * Utility routines to make it more convenient to work with values | 89 | * Utility routines to make it more convenient to work with values | |
90 | * stored in dictionaries. | 90 | * stored in dictionaries. | |
91 | */ | 91 | */ | |
92 | bool prop_array_get_bool(prop_array_t, unsigned int, | 92 | bool prop_array_get_bool(prop_array_t, unsigned int, | |
93 | bool *); | 93 | bool *); |
--- src/common/include/prop/prop_dictionary.h 2011/01/19 20:34:23 1.11
+++ src/common/include/prop/prop_dictionary.h 2011/01/20 11:17:58 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: prop_dictionary.h,v 1.11 2011/01/19 20:34:23 bouyer Exp $ */ | 1 | /* $NetBSD: prop_dictionary.h,v 1.12 2011/01/20 11:17:58 bouyer Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -91,27 +91,27 @@ int prop_dictionary_send_ioctl(prop_dic | @@ -91,27 +91,27 @@ int prop_dictionary_send_ioctl(prop_dic | |||
91 | int prop_dictionary_recv_ioctl(int, unsigned long, | 91 | int prop_dictionary_recv_ioctl(int, unsigned long, | |
92 | prop_dictionary_t *); | 92 | prop_dictionary_t *); | |
93 | int prop_dictionary_sendrecv_ioctl(prop_dictionary_t, | 93 | int prop_dictionary_sendrecv_ioctl(prop_dictionary_t, | |
94 | int, unsigned long, | 94 | int, unsigned long, | |
95 | prop_dictionary_t *); | 95 | prop_dictionary_t *); | |
96 | bool prop_dictionary_send_syscall(prop_dictionary_t, | 96 | bool prop_dictionary_send_syscall(prop_dictionary_t, | |
97 | struct plistref *); | 97 | struct plistref *); | |
98 | bool prop_dictionary_recv_syscall(const struct plistref *, | 98 | bool prop_dictionary_recv_syscall(const struct plistref *, | |
99 | prop_dictionary_t *); | 99 | prop_dictionary_t *); | |
100 | #elif defined(_KERNEL) | 100 | #elif defined(_KERNEL) | |
101 | int prop_dictionary_copyin(const struct plistref *, | 101 | int prop_dictionary_copyin(const struct plistref *, | |
102 | prop_dictionary_t *); | 102 | prop_dictionary_t *); | |
103 | int prop_dictionary_copyout(struct plistref *, | 103 | int prop_dictionary_copyout(struct plistref *, | |
104 | prop_dictionary_t *); | 104 | prop_dictionary_t); | |
105 | int prop_dictionary_copyin_ioctl(const struct plistref *, | 105 | int prop_dictionary_copyin_ioctl(const struct plistref *, | |
106 | const u_long, | 106 | const u_long, | |
107 | prop_dictionary_t *); | 107 | prop_dictionary_t *); | |
108 | int prop_dictionary_copyout_ioctl(struct plistref *, | 108 | int prop_dictionary_copyout_ioctl(struct plistref *, | |
109 | const u_long, | 109 | const u_long, | |
110 | prop_dictionary_t); | 110 | prop_dictionary_t); | |
111 | #endif | 111 | #endif | |
112 | #endif /* __NetBSD__ */ | 112 | #endif /* __NetBSD__ */ | |
113 | 113 | |||
114 | /* | 114 | /* | |
115 | * Utility routines to make it more convenient to work with values | 115 | * Utility routines to make it more convenient to work with values | |
116 | * stored in dictionaries. | 116 | * stored in dictionaries. | |
117 | */ | 117 | */ |
--- src/common/lib/libprop/prop_kern.c 2011/01/19 20:34:23 1.15
+++ src/common/lib/libprop/prop_kern.c 2011/01/20 11:17:58 1.16
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: prop_kern.c,v 1.15 2011/01/19 20:34:23 bouyer Exp $ */ | 1 | /* $NetBSD: prop_kern.c,v 1.16 2011/01/20 11:17:58 bouyer Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -461,39 +461,39 @@ _prop_object_copyout(struct plistref *pr | @@ -461,39 +461,39 @@ _prop_object_copyout(struct plistref *pr | |||
461 | } | 461 | } | |
462 | } | 462 | } | |
463 | 463 | |||
464 | free(buf, M_TEMP); | 464 | free(buf, M_TEMP); | |
465 | 465 | |||
466 | return (error); | 466 | return (error); | |
467 | } | 467 | } | |
468 | 468 | |||
469 | /* | 469 | /* | |
470 | * prop_array_copyout -- | 470 | * prop_array_copyout -- | |
471 | * Copy out an array to a syscall arg. | 471 | * Copy out an array to a syscall arg. | |
472 | */ | 472 | */ | |
473 | int | 473 | int | |
474 | prop_array_copyout(struct plistref *pref, prop_array_t *arrayp) | 474 | prop_array_copyout(struct plistref *pref, prop_array_t array) | |
475 | { | 475 | { | |
476 | return (_prop_object_copyout(pref, (prop_object_t *)arrayp)); | 476 | return (_prop_object_copyout(pref, array)); | |
477 | } | 477 | } | |
478 | 478 | |||
479 | /* | 479 | /* | |
480 | * prop_dictionary_copyout -- | 480 | * prop_dictionary_copyout -- | |
481 | * Copy out a dictionary to a syscall arg. | 481 | * Copy out a dictionary to a syscall arg. | |
482 | */ | 482 | */ | |
483 | int | 483 | int | |
484 | prop_dictionary_copyout(struct plistref *pref, prop_dictionary_t *dictp) | 484 | prop_dictionary_copyout(struct plistref *pref, prop_dictionary_t dict) | |
485 | { | 485 | { | |
486 | return (_prop_object_copyout(pref, (prop_object_t *)dictp)); | 486 | return (_prop_object_copyout(pref, dict)); | |
487 | } | 487 | } | |
488 | 488 | |||
489 | static int | 489 | static int | |
490 | _prop_object_copyout_ioctl(struct plistref *pref, const u_long cmd, | 490 | _prop_object_copyout_ioctl(struct plistref *pref, const u_long cmd, | |
491 | prop_object_t obj) | 491 | prop_object_t obj) | |
492 | { | 492 | { | |
493 | if ((cmd & IOC_OUT) == 0) | 493 | if ((cmd & IOC_OUT) == 0) | |
494 | return (EFAULT); | 494 | return (EFAULT); | |
495 | return _prop_object_copyout(pref, obj); | 495 | return _prop_object_copyout(pref, obj); | |
496 | } | 496 | } | |
497 | 497 | |||
498 | 498 | |||
499 | /* | 499 | /* |