⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extract.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
字号:
/*      @(#)extract.c 1.1 92/07/30 SMI                              *//* * Copyright (c) 1988 by Sun Microsystems, Inc. */#include "install.h"#include "sysexits.h"extern char *sprintf();extract(path,arch,tape_device,fsf,bs,name,tapehost, progname)        char *path, *arch, *name, *tape_device, *tapehost, *progname;        int fsf, bs;{        int id, child;        union wait stat;        char file_no[5], bsize[5], device[25];	char filename[MAXPATHLEN];	(void) sprintf(file_no,"%d",fsf);	(void) sprintf(bsize,"%d",bs);	(void) sprintf(device,"/dev/nr%s",tape_device);	(void) sprintf(filename,"%sextracting",path);        if (( child = fork()) == 0) { /* child */                execl(filename,filename,arch,device,file_no,bsize,name,		    tapehost,0);		(void) fprintf(stderr,		    "%s: Unable to execute %s\n",progname,filename);		exit(EX_UNAVAILABLE);        } else if ( child != -1 ) { /* parent */                if((id = wait(&stat)) == -1) {                        perror("wait");                        exit(EX_OSERR);                } else if ( id == child ) {                        /*                         * check status                         */                        if ( stat.w_status != 0 ) {				(void) fprintf(stderr,				    "%s:\t%s terminated with nonzero status\n",				    progname, filename);				exit(EX_SOFTWARE);			}                }        } else {                perror("fork");                exit(EX_OSERR);        }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -