Regarding the behavior of fork() and exec() system calls in a multithreaded process (specifically under POSIX standards), which of the following statements are TRUE?
A (a) When fork() is invoked by a thread in a multithreaded process, the resulting child process contains duplicates of all threads that were running in the parent process at the time of the call.
B (b) If a thread (other than the one calling fork()) holds a lock (e.g., a mutex) at the moment fork() is called, that lock will exist in the child process in a locked state, but the thread holding it will not exist in the child to unlock it, leading to potential deadlocks if the child tries to acquire this lock.
C (c) It is generally unsafe to call complex library functions (like printf or malloc) in the child process between fork() and exec() because these functions may rely on internal locks that were left in an inconsistent state during the fork.
D (d) The exec() system call allows the child process to retain the memory space and thread context of the parent process while simply resetting the Program Counter (PC) to the beginning of the main() function.