*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> getpty (3)              
Title
Content
Arch
Section
 

Contents


GETPTY(3)							     GETPTY(3)


NAME    [Toc]    [Back]

     _getpty, mkpts - get a PTY	or Pseudo-TTY

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/stat.h>
     #include <unistd.h>
     #include <fcntl.h>

     char *_getpty(int *fildes,	int oflag, mode_t mode,
		    int	nofork);

DESCRIPTION    [Toc]    [Back]

     This function finds and allocates a pair of devices making	a pseudo-TTY,
     described in pty(7M).

     If	filedes	is not null, then the file descriptor for the master or
     controlling side of the pty is stored through the pointer.	 If
     successful, a pointer to an internal, static area containing the name of
     the slave device node is returned.	 The file descriptor is	opened with
     the value oflag, constructed as described in open(2).

     The access	bits of	the slave device node are set to mode.	The owner of
     the slave device is set to	the real UID of	the caller, and	the GID	is
     reset.

     If	nofork is 0 and	the process does not have effective UID	0, then	this
     function may execute /usr/sbin/mkpts to change the	owner and permissions
     of	the node for the slave device.

     The slave device file in /dev will	be created if it does not already
     exist.

     This function may also use	the facilities described in getgrent(3C) to
     set the group of the slave	device node.

SEE ALSO    [Toc]    [Back]

      
      
     chmod(2), chown(2), getgrent(3C), open(2),	pty(7M), tty(1), tty(7)

DIAGNOSTICS    [Toc]    [Back]

     A returned	value of 0 indicates failure, with errno indicating the	nature
     of	the problem.

BUGS    [Toc]    [Back]

     When _getpty(3) uses /usr/sbin/mkpts, it waits for	it to finish with
     waitpid(2).  This requires	that the caller	not have set SIGCLD to
     SIG_IGN.  Instead,	_getpty(3) should save and restore the signal handler.
     See wait(2) and signal(2).	 The nofork argument can used to avoid
     undesirable forks.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
pty IRIX pseudo terminal driver
pty HP-UX pseudo terminal driver
pty FreeBSD pseudo terminal driver
pty Tru64 Pseudo terminal driver
ptm OpenBSD pseudo terminal driver
pty OpenBSD pseudo terminal driver
BN_pseudo_rand Tru64 Generate pseudo-random number
tun OpenBSD network tunnel pseudo-device
read_random FreeBSD supply pseudo-random numbers
arc4random FreeBSD supply pseudo-random numbers
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service