The solutions so far assume your b.c is compiled into a separate executable or runs on a separate thread from a.c?
Anything that involves crossing threads or process will involve platform specific API calls because threads and processes are platform specific things.
However if a.c and b.c are part of the same executable and you're only running one thread then you simply set a flag in a.c
int iOpenFlag = 0;
fp = fopen("abc.txt","rw");
iOpenFlag = 1;
iOpenFlag = 0;
then in b.c
extern int iOpenFlag;
if( iOpenFlag == 0 )
Clearly error and return value checking are needed to ensure the flag is only set and cleared when it should be.