I have no idea what you are tying to achieve with this.
I think you really need to read about pmem and try to understand it first.
Things that will make the code work:
1a) Use a sane path in open (for instance: "/mnt/dax/someFileName").
Make sure that you have permissions to /mnt/dax directory.
1b) Use devdax instead of fsdax provided you want to open whole device
directly. Make sure you have permissions for it.
1c) Run as root and remove at least flag O_TRUNC if you are really
sure that you want to open /dev/pmem0 rather than a file on filesystem
mounted there, but I strongly doubt that you want this option.
2) Fix mode from '0x0777' to '0777' or else you end up with some
bizarre permissions
3) Be more verbose about the reason of errors - errno, perror,
strerror, glibc error function etc. are there to tell you why open
failed.
I really recommend you to go through resources on pmem first.
Regards,
Jan
> --
> You received this message because you are subscribed to the Google Groups
> "pmem" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
pmem+uns...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/pmem/f3c06bb7-f359-42a6-88e2-54239840c543n%40googlegroups.com.
>