add ptsname function.