Re: [libvirt] PATCH: 15/25: Prohibit non-threadsafe POSIX apis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 13, 2009 at 05:44:51PM +0000, Daniel P. Berrange wrote:
> The readdir one is also unneccessary, since reading from a single
> DIR* is safe from a single thread. readdir_r is also horrific
> 
> http://womble.decadentplace.org.uk/readdir_r-advisory.html

That web page also says that readdir isn't thread safe, in that an
implementation could still use some global state (outside of the
DIR*):

<quote>
  Programs using readdir_r may be able to use readdir. According to
  POSIX the buffer readdir uses is not shared between directory
  streams. However readdir is not guaranteed to be thread-safe and some
  implementations may use global state, so for portability the use of
  readdir in a multithreaded program should be controlled using a mutex.
</quote>

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]