[Tsan] Fix the getline_nohang.cc test to build on FreeBSD

Differential Revision: http://reviews.llvm.org/D5666

llvm-svn: 219482
This commit is contained in:
Viktor Kutuzov 2014-10-10 07:07:26 +00:00
parent 348758bbca
commit e3b6a6a379
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,10 @@
// Make sure TSan doesn't deadlock on a file stream lock at program shutdown.
// See https://code.google.com/p/thread-sanitizer/issues/detail?id=47
#ifdef __FreeBSD__
#define _WITH_GETLINE // to declare getline()
#endif
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>