...
Code Block | ||
---|---|---|
| ||
fd = open(ms, O_CREAT|O_EXCL|O_WRONLY|O_TRUNC); |
Note that technically it is also incorrect to pass a third argument to open()
when not creating a new file (that is, with the O_CREAT
flag not set). A POSIX implementation could, if it wished, return an EINVAL error in this case. However, in practise it is unlikely to cause a problem.
Compliant Solution (Variadic Functions)
...