Simply checking the permissions on /tmp before you start is not good enough because it has all the usual race conditions. There would need to be some additional flags to open() to specify 'I expect the containing directory to have the following permissions'.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds