int
prop_array_copyin_ioctl(
const struct plistref *pref
, const u_long cmd
, prop_array_t *arrayp
)
int
prop_array_copyout_ioctl(
struct plistref *pref
, const u_long cmd
, prop_array_t array
)
int
prop_dictionary_copyin_ioctl(
const struct plistref *pref
, const u_long cmd
, prop_dictionary_t *dictp
)
int
prop_dictionary_copyout_ioctl(
struct plistref *pref
, const u_long cmd
, prop_dictionary_t dict
)
A kernel ioctl routine receiving or returning a property list will be passed a pointer to a This structure encapsulates the reference to the property list in externalized form.
)
and
prop_dictionary_copyin_ioctl(
)
will fail if:
EFAULT
]
EIO
]
ENOMEM
]
ENOTSUP
]
prop_array_copyout_ioctl()
and
prop_dictionary_copyout_ioctl(
)
will fail if:
EFAULT
]
ENOMEM
]
ENOTSUP
]
)
and
prop_dictionary_copyout_ioctl(
)
in an ioctl routine:
extern prop_dictionary_t fooprops;
int
fooioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
{
prop_dictionary_t dict, odict;
int error;
switch (cmd) {
case FOOSETPROPS: {
const struct plistref *pref = (const struct plistref *) data;
error = prop_dictionary_copyin_ioctl(pref, cmd, &dict);
if (error)
return (error);
odict = fooprops;
fooprops = dict;
prop_object_release(odict);
break;
}
case FOOGETPROPS: {
struct plistref *pref = (struct plistref *) data;
error = prop_dictionary_copyout_ioctl(pref, cmd, fooprops);
break;
}
default:
return (EPASSTHROUGH);
}
return (error);
}