Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ grantpt(3) — OSF/1 3.0 αXP

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open(2)

ptsname(3)

setuid(2)

unlockpt(3)

grantpt(3)  —  Subroutines

NAME

grantpt - Permits access to the slave pty

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

int grantpt(
int fildes);

PARAMETERS

fildesSpecifies a file descriptor that is returned from a successful open of a master pty. 

DESCRIPTION

In the System V Release 4 pty name space, the grantpt() function modifies the ownership and mode of the slave pseudoterminal device associated with its master pseudoterminal counterpart. 

The modifications of mode and ownership are performed by the setuid() function in the following way:

       •The group ID is set to a reserved group. 

       •The slave user ID is set to the effective owner of the calling process. 

       •The permissions of the slave device are set so that the owner is allowed read and write access and the group is allowed write access. 

RETURN VALUES

Upon successful completion, the grantpt() function returns a value of 0 (zero). Otherwise, it returns a value of -1. 

Failure may result under the following conditions:

       •The file descriptor specified by the fildes parameter is not associated with a master device. 

       •The file descriptor specified by the fildes parameter is not an open file descriptor. 

       •The corresponding slave device cannot be accessed. 

The grantpt() function may also fail if the application has installed a signal handler to catch SIGCHLD (death of a child) signals. 

RELATED INFORMATION

Functions: open(2), ptsname(3), setuid(2), unlockpt(3). 

Guides: System V Compatibility User’s Guide

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026