Hang on tools.c SpinUpDisk - system("sync")

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

 



> I've looked into where the hang happens and its in SpinUpDisk on the 
> line that calls system("sync") - if I comment this line out then 
> everything works perfectly!

I worked out what was happening - system(const char *string) uses /bin/sh
which in my case is bash - bash is linked to the NTPL version of glibc. I
wrote a small test which showed that executing something which uses NTPL
threads from an application which uses linuxthreads never returns.

If the caller doesn't use threading the problem doesn't seem to occur.

So I've replaced system("sync") with an fsync(f) before the file descriptor
is closed. The disk spins up fine now.

Thanks,
Chris



[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux