注意,儘管使用了不安全的tempnam(3)函數,但是它被包裝在循環中,並使用了O_CREAT和O_EXCL選項,從而抵消了它的安全弱點,所以這樣做是可以的。
Note that, although the insecure function tempnam (3) is being used, it is wrapped inside a loop using O_CREAT and O_EXCL to counteract its security weaknesses, so this use is OK.