You should consider several topics when working with file systems in multithreaded programs.
The Root, QOpenSys, User-Defined (UDFS), QNTC, QSYS.LIB, QOPT, and QLANSrv file systems are threadsafe and do not have any restrictions. The QDLS, NFS, QFileSvr.400, and QNetWare file systems are not threadsafe. If you try to use an integrated file system application programming interface (API) or command on a file or file descriptor that represents an object in a file system that is not threadsafe, it fails with ENOTSAFE. This failure occurs only when multiple threads are in a job.
An attempt to spawn a program from a job that has multiple threads fails with ENOTSAFE if you inherit the current working directory or open file descriptors that represent files in a file system that is not threadsafe.
All of the integrated file system APIs are threadsafe when directed to an object that resides in a threadsafe file system. If you do not know the file system where an object resides, you can query the path to see if the threadsafe integrated file system interfaces can safely access it. You can use the pathconf(), fpathconf(), statvfs(), and fstatvfs() APIs to determine whether a path or file descriptor refers to an object in one of the threadsafe file systems.