Actually, according to the documentation, you probably can use opendir(), readdir(), and closedir() from a Guardian object file.
I have never done this, but there seems to be a thorough description of what functions can be used from what environments in Appendix B of the "Open System Services Programmer's Guide". Many of the library functions can be called either Guardian or OSS programs without doing anything special. That is pretty well-known.
What is probably less well-known is that it is possible to mix in one object file modules compiled for OSS and modules compiled for Guardian. Some library functions that can only be called from a module compiled for OSS can be used in a Guardian process by putting the calls in a module that is compiled for OSS, but included in the Guardian object file. I have never had a chance to try such mixing myself, so I don't know how easy it is to get working (and the manual does seem to say that not every library function works in such a mixed process, so it won't solve all cases).
The opendir() and readdir() functions are listed as ones that can be called from either Guardian or OSS modules. For some reason closedir() is documented as only being callable from an OSS module, but the module can be used in either a Guardian process or an OSS process. I have a feeling that all three of the functions work in the same environments, but I don't know whether the documentation for closedir() is correct or the documentation for opendir() and readdir() is correct. (There is a chance that all of them are incorrect, of course.) If I were you, I would try using the functions in your program or in a small test program compiled for Guardian and see what happens. If that arrangement does not work, try putting the calls to opendir() etc. in a module compiled for OSS and call that module from a test program compiled for Guardian and see whether you can get that to work. If you cannot get it to work, describe what you did and how it fails and we'll try to help.