#ifndef WH_PTYIMPL_H_10ecea4b_ #define WH_PTYIMPL_H_10ecea4b_ /* Copyright status: this file is in the public domain. */ /* * This is the interface between serialconsole.c and the pty module * (ptydummy.c or an OS-specific pty module). */ /* * Called to set up a pty pair for -console or -command mode. * * Args: int *mfdp, int *sfdp, char **devp, char **errp * * On success, stores master fd through mfdp, slave fd through sfdp, * a path to the slave side through *devp, and nil through errp. On * failure, stores an error string through *errp and nothing through * any other argument. Strings returned through *devp or *errp are * owned by the caller and may be freed with free(). * * devp may be nil, in which case that string is not generated. */ extern void ptypair_setup(int *, int *, char **, char **); /* * Called to set up a pty pair for -ptyexport mode; this includes * running the program and testing its exit status. * * Args: const char *pgm, int *mfdp, int *sfdp, char **errp * * On success, stores master fd through mfdp, slave fd through sfdp, * and nil through errp. On failure, stores an error string through * errp and nothing through any other argument. On failure, *errp is * owned by the caller and may be freed with free(). */ extern void ptyexport_setup(const char *, int *, int *, char **); /* * Called to make a pty the process's controlling terminal (and also * puts the process into its own process group). * * Args: int sfd * * sfd must be open onto the slave side of a pty pair. */ extern void pty_ctty(int); #endif