Libptytty 1.0 review

Download
by rbytes.net on

Libptytty is a small library that offers pseudo-TTY management in an OS-independent way. It was created out of frustration over th

License: GPL (GNU General Public License)
File size: 203K
Developer: Emanuele Giaquinta & Marc A. Lehmann
0 stars award from rbytes.net

Libptytty is a small library that offers pseudo-TTY management in an OS-independent way.

It was created out of frustration over the many differences of PTY/TTY handling in different operating systems for use inside "rxvt-unicode".

It also offers session database support (utmp and optional wtmp/lastlog updates for login shells) and supports forking after startup and dropping privileges in the calling process. It offers C++ and C-only APIs.

SYNOPSIS:

cc ... -lptytty

#include

// C++
ptytty *pty = ptytty::create ();

if (!pty->get ())
// error allocating pty

if (we want utmp)
pty->login (process_pid, 0, "remote.host");
else if (we want utmp AND wtmp/lastlog)
pty->login (process_pid, 1, "remote.host");

// we are done with it
delete pty;

// C
PTYTTY pty = ptytty_create ();

if (!ptytty_get (pty))
// error allocating pty

if (we want utmp)
ptytty_login (pty, process_pid, 0, "remote.host");
else if (we want utmp AND wtmp/lastlog)
ptytty_login (pty, process_pid, 1, "remote.host");

// we are done with it
ptytty_delete (pty);

What's New in This Release:
The documentation has been improved and clarified.
Some minor bugs were fixed.
Portability was improved.

Libptytty 1.0 search tags