using hard-code flags would open succeed, but passed by invoker would be failed. same errno mentioned here: #31