The address sanitizer complains about the following code, which looks good to me:
pwrite(1, &buf, 0, 0);
clang++ -fno-omit-frame-pointer -fno-optimize-sibiling-calls -fsanitize=address -ggdb ./pwrite.c
This is Clang compiled from trunk, many months ago:
$ clang++ --version
clang version 3.3 (trunk 172721)
Thread model: posix
I’ll try with current Clang trunk.