/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Pager: Routines to create a "more" running out of a particular file
* descriptor.
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
* For copyright information, see copyright.h.
*/
#include "ss_internal.h"
#include "copyright.h"
#include <errno.h>
#include <stdio.h>
#include <signal.h>
extern char *_ss_pager_name;
extern char *getenv();
/*
* this needs a *lot* of work....
*
* run in same process
* handle SIGINT sensibly
* allow finer control -- put-page-break-here
*/
void ss_page_stdin();
#ifndef NO_FORK
int ss_pager_create()
{
return(-1);
switch((int) fork()) {
case -1:
return(-1);
case 0:
/*
* Child; dup read half to 0, close all but 0, 1, and 2
*/
exit(1);
default:
/*
* Parent: close "read" side of pipe, return
* "write" side.
*/
return(filedes[1]);
}
}
#else /* don't fork */
int ss_pager_create()
{
int fd;
return fd;
}
#endif
void ss_page_stdin()
{
int i;
#ifdef POSIX_SIGNALS
#endif
/*
*/
closefrom(3);
#ifdef POSIX_SIGNALS
#else
#endif
{
#ifdef POSIX_SIGNALS
sigemptyset(&mask);
#else
#endif
}
if (_ss_pager_name == (char *)NULL) {
}
{
/* minimal recovery if pager program isn't found */
register int n;
}
}