struct file_operations hello_fops = {
owner: THIS_MODULE,
read: hello_read,
write: hello_write,
ioctl: hello_ioctl,
open: hello_open,
release: hello_release,
};
Here what is the meaning of : after struct field i.e owner:
Somewhere I ‘ve also seen like .owner:=
Also how can I see what are the other available options for “owner“. I want to give permissions to all to issue ioctl calls.
What is meaning of . here
Can anybody explain this
is a C99-style initializer.
is a GCC-style initializer.
ownerhas nothing to do with permissions. Permissions are the normal file permissions, you may want to use anudevrule to set appropiate permissions. Anioctlcall will typically require additional permissions, depending on its meaning, e.g: CAP_NET_ADMIN for some network relted ioctl’s.