I believe the libc function (for OS X) you're looking for is realpath(3), though it returns the full path beginning with /.
I believe the libc function (for OS X) you're looking for is realpath(3), though it returns the full path beginning with /.