title: How to generate random file name for socket under Linux?
body: <p>I want to make a small program which use local namespace socket and I will need to use temporary file name as address of the socket.</p>
  
  <p>So how to generate random file name under Linux?</p>
  
  <p>&#43; I'm using the C programming language under Debian Linux.<br/>
  &#43; Acoording to the GNU C Library Reference,tmpname is not safe.But the safe ones tmpfile and mkstemp <strong>create</strong> and <strong>open</strong> the generated file.Is there any <strong>safe</strong> and <strong>non-create-open</strong> to this.In other words, the function should forbidden any other request to create the generated file name under specific directory.</p>
  
  <p>thanks.</p>