means “lock to end-of-file), with the PID set to <code>getpid()</code>.</p>
<p>The next step is to <code>open()</code> the file, since <code>flock()</code> needs a file descriptor of the file that’s being locked. Note that when you open the file, you need to open it in the same <em>mode</em> as you have specified in the lock, as shown in the table, below. If you open the file in the wrong mode for a given lock type, <code>fcntl()</code> will return <code>-1</code> and <code>errno</code> will be set to <