On Thu, Apr 22, 2010 at 11:07:55PM -0700, Alan Coopersmith wrote: > Glenn Fowler wrote: > > On Thu, 22 Apr 2010 20:52:54 -0700 Alan Coopersmith wrote: > >> Glenn Fowler wrote: > >>> what is the name of the kernel getcwd() > >>> man getcwd on the solaris I have access to describes getcwd(3) > > > >> That's it - libc getcwd() simply calls the system call: > >> http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/getcwd.c > > > > can you point me to getcwd(2) or the place in getcwd(3) > > where it mentions the system call > > The system call is a private implementation detail of the libc function. > Documenting how getcwd gets the information is not necessary for you to > be able to use it correctly and safely. (System calls on Solaris are > generally private implementation details, subject to change without > warning, and you should always call the libc functions to access them.)
IIUC the _ast_ prefix thing is an artifact of the Solaris integration, which would explain why upstream might want to call the getcwd syscall directly. What Glenn could do is dlsym(RTLD_DEFAULT, "getcwd"), and if it's not the same as the AST getcwd, then call it, else use the traditional getcwd algorithm. The Solaris integration could also just include an alternative implementation of _ast_getcwd() that just calls getcwd(). I'd like to see the rename vs. interpose decision revisited too. Nico -- _______________________________________________ ksh93-integration-discuss mailing list ksh93-integration-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss