PROP_SEND_SYCALL(3) BSD Library Functions Manual PROP_SEND_SYCALL(3)NAME
prop_array_send_syscall, prop_array_recv_syscall, prop_dictionary_send_syscall, prop_dictionary_recv_syscall -- send and receive property
lists to and from the kernel using syscalls
SYNOPSIS
#include <prop/proplib.h>
int
prop_array_send_syscall(prop_array_t array, struct plistref *prefp);
int
prop_array_recv_syscall(const struct plistref *prefp, prop_array_t *arrayp);
int
prop_dictionary_send_syscall(prop_dictionary_t dict, struct plistref *prefp);
int
prop_dictionary_recv_syscall(const struct plistref *prefp, prop_dictionary_t *dictp);
DESCRIPTION
The prop_array_send_syscall, prop_array_recv_syscall, prop_dictionary_send_syscall, and prop_dictionary_recv_syscall functions implement the
user space side of a protocol for sending property lists to and from the kernel using syscall(2).
RETURN VALUES
If successful, functions return zero. Otherwise, an error number is returned to indicate the error.
EXAMPLES
The following (simplified) example demonstrates using prop_dictionary_send_syscall() and prop_dictionary_recv_syscall() in an application:
void
foo_setprops(prop_dictionary_t dict)
{
struct pref pref;
(void) prop_dictionary_send_syscall(dict, &pref);
(void) my_syscall_set(&pref);
}
prop_dictionary_t
foo_getprops(void)
{
prop_dictionary_t dict;
struct pref pref;
(void) my_syscall_get(&pref);
if (prop_dictionary_recv_syscall(&pref, &dict) != 0)
return (NULL);
return (dict);
}
ERRORS
prop_array_send_syscall() and prop_dictionary_send_syscall() will fail if:
[ENOMEM] Cannot allocate memory
[ENOTSUP] Not supported
prop_array_recv_syscall() and prop_dictionary_recv_syscall() will fail if:
[EIO] Input/output error
[ENOTSUP] Not supported
SEE ALSO prop_array(3), prop_dictionary(3), proplib(3), prop_copyin_ioctl(9)HISTORY
The proplib property container object library first appeared in NetBSD 4.0.
BSD January 17, 2011 BSD
Check Out this Related Man Page
PROP_COPYIN_IOCTL(9) BSD Kernel Developer's Manual PROP_COPYIN_IOCTL(9)NAME
prop_array_copyin_ioctl, prop_array_copyout_ioctl, prop_array_copyin, prop_array_copyout, prop_dictionary_copyin_ioctl,
prop_dictionary_copyout_ioctl, prop_dictionary_copyin, prop_dictionary_copyout -- Copy property lists to and from kernel space
SYNOPSIS
#include <prop/proplib.h>
int
prop_array_copyin_ioctl(const struct plistref *pref, const u_long cmd, prop_array_t *arrayp);
int
prop_array_copyin(const struct plistref *pref, prop_array_t *arrayp);
int
prop_array_copyout_ioctl(struct plistref *pref, const u_long cmd, prop_array_t array);
int
prop_array_copyout(struct plistref *pref, prop_array_t array);
int
prop_dictionary_copyin_ioctl(const struct plistref *pref, const u_long cmd, prop_dictionary_t *dictp);
int
prop_dictionary_copyin(const struct plistref *pref, prop_dictionary_t *dictp);
int
prop_dictionary_copyout_ioctl(struct plistref *pref, const u_long cmd, prop_dictionary_t dict);
int
prop_dictionary_copyout(struct plistref *pref, prop_dictionary_t dict);
DESCRIPTION
The prop_array_copyin_ioctl, prop_array_copyout_ioctl, prop_dictionary_copyin_ioctl, and prop_dictionary_copyout_ioctl functions implement
the kernel side of a protocol for copying property lists to and from the kernel using ioctl(2). The functions prop_array_copyin,
prop_array_copyout, prop_dictionary_copyin, and prop_dictionary_copyout implement the kernel side of a protocol for copying property lists to
the kernel as arguments of normal system calls.
A kernel routine receiving or returning a property list will be passed a pointer to a struct plistref. This structure encapsulates the ref-
erence to the property list in externalized form.
RETURN VALUES
If successful, functions return zero. Otherwise, an error number will be returned to indicate the error.
EXAMPLES
The following (simplified) example demonstrates using prop_dictionary_copyin_ioctl() 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);
}
The following (simplified) example demonstrates using prop_array_copyin() in a routine:
int
foocopyin(const struct plistref *pref))
{
prop_array_t array;
int error;
error = prop_array_copyin(pref, &array);
if (error)
return (error);
...
}
ERRORS
prop_array_copyin_ioctl() and prop_dictionary_copyin_ioctl() will fail if:
[EFAULT] Bad address
[EIO] Input/output error
[ENOMEM] Cannot allocate memory
[ENOTSUP] Not supported
prop_array_copyout_ioctl() and prop_dictionary_copyout_ioctl() will fail if:
[EFAULT] Bad address
[ENOMEM] Cannot allocate memory
[ENOTSUP] Not supported
SEE ALSO prop_array(3), prop_dictionary(3), prop_send_ioctl(3), prop_send_syscall(3), proplib(3)HISTORY
The proplib property container object library first appeared in NetBSD 4.0.
BSD January 17, 2011 BSD