TTY_NAME_MAX not defiend in FreeBSD, change to _POSIX_TTY_NAME_MAX