& |
int settrans(const char *path, char *cmd, size_t size, int flags);Set a translator on a file pointed by path. cmd is the buffer where the path to the translator and it's arguments are stored; size determines it's size. flags is a combination of flags TRANS* defined in fcntl.h. The translator and its arguments are strings separated with NULLs. There should be no NULL at the end. It returns 0 in the case of success and non-zero otherwise. The error description is in errno.
int gettrans(const char *path, char *cmd, size_t size);Get a passive translator set on a file pointed to by path. cmd points to a buffer where the kernel should store the translator path and it's arguments in a way it is set in settrans. It has to be at least size bytes big. If the translator and it's arguments contain more than size bytes, only the firstsize bytes are stored. The actual number of bytes stored is returned from the function. It may also be a -1, which indicates an error. errno is set to indicate the precise cause.
struct vop_settrans_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; char *a_cmd; size_t a_size; kauth_cred_t a_cred; }All the arguments are exactly the same as in the syscall except that a\_cmd should reside in the kernel space.
struct vop_gettrans_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; struct uio *a_uio; size_t *a_size; kauth_cred_t a_cred; }The a_uio should contain the the buffer in which the translator will be stored. The actual size written will be stored in *a_size.
|