flockfile.c
1 #include <errno.h> 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include "darwintest.h" 5 6 T_DECL(flockfile_preserve_errno, "flockfile preserves errno") 7 { 8 errno = EBUSY; 9 flockfile(stderr); 10 T_ASSERT_EQ(errno, EBUSY, "flockfile preserves errno"); 11 } 12 13 T_DECL(funlockfile_preserve_errno, "funlockfile preserves errno") 14 { 15 errno = EBUSY; 16 funlockfile(stderr); 17 T_ASSERT_EQ(errno, EBUSY, "funlockfile preserves errno"); 18 } 19 20 T_DECL(ftrylockfile_preserve_errno, "ftrylockfile preserves errno") 21 { 22 errno = EBUSY; 23 ftrylockfile(stderr); 24 T_ASSERT_EQ(errno, EBUSY, "ftrylockfile preserves errno"); 25 } 26