qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] pty/tty functions for BSD too


From: Jamie Lokier
Subject: Re: [Qemu-devel] pty/tty functions for BSD too
Date: Mon, 18 Aug 2008 20:42:39 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Blue Swirl wrote:
> And ptsname() is used to get the pty name, which uses either hard
> coded buffer length of _PATH_DEVPTS or _PATH_TTY:
> http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/ptsname.c?rev=1.15&content-type=text/x-cvsweb-markup&cvsroot=glibc
> 
> OpenBSD forces the name to be in format "/dev/ptyXX":
> http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/pty.c?rev=1.15&content-type=text/x-cvsweb-markup
> 
> NetBSD is similar, except also /dev/ttyXX is possible:
> http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libutil/pty.c?rev=1.29&content-type=text/x-cvsweb-markup

Other platforms use slightly longer names, but I've never heard of one
that wouldn't fit into PATH_MAX - assuming PATH_MAX is sane.

I'd still use ptsname()/ptsname_r() when available though.

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]