0

my device is xylinx zynq ultrascale zcu106 evk. and i reserve 4GB of DDR memory for specific usage.
this area is platform device and also controlled by character device driver.

if i want write data to physical storage immediately, open file with flag "O_SYNC".
fd = open("myfile",O_RDWR|O_SYNC);

also i can use these file i/o interface for control character device driver.
shell : mknod /dev/my_chrdev c 99 0
c program : fd = open("/dev/my_chrdev",O_RDWR|O_SYNC);

  • I want to know what effect it has when opening a character device node with the "O_SYNC" flag.

  • And how can I guarantee the cache coherent of i/o for the character device?.

  • Does the file io interface give feedback when a device node is opened through the sync flag in the user level application?

shkim
  • 611
  • 1
  • 5
  • 12
  • Does this answer your question? [How are the O\_SYNC and O\_DIRECT flags in open(2) different/alike?](https://stackoverflow.com/questions/5055859/how-are-the-o-sync-and-o-direct-flags-in-open2-different-alike) – wxz Apr 26 '21 at 15:08
  • 1
    There is no default handling of `O_SYNC` for character special device files (it is usually ignored), but you could add code to handle it in your driver's "write" or "write_iter" file operation handlers. – Ian Abbott Apr 26 '21 at 15:33

0 Answers0