Open and write data to binary file in Kernel
Hi All,
My Ask is to write data to a binary file in Kernel code.Is there any option in kernel to save data as binary file.
In userspace we have functions like fwrite() and fread() to operate on binary file, Similarly need some functions in kernel.
Used vfs_write() in order to store the data as hex. Similarly need function to store it as bin.
file = file_open(log_file, O_CREAT | O_BINARY | O_RDWR | O_APPEND, 00644);
vfs_write(file, data, size, &offset);
Used this O_BINARY option, but this doesn't help. Is there any other way to write it as binary data.?
Any help is much appreciated.
#linux #binary #vfs_write #O_BINARY
Thanks in Advance,
Ashok
|