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

📄 addarg.c,v

📁 关于SHELL方面的
💻 C,V
字号:
head	1.1;access;symbols;locks	dls:1.1; strict;comment	@ * @;1.1date	97.09.21.19.29.03;	author dls;	state Dist;branches;next	;desc@@1.1log@pre-3e code@text@/* addarg.c - addarg */#include <conf.h>#include <kernel.h>#include <proc.h>#include <shell.h>/*------------------------------------------------------------------------ *  addarg  -  copy arguments to area reserved on process stack *------------------------------------------------------------------------ */addarg(pid, nargs, len)int	pid;				/* process to receive arguments	*/int	nargs;				/* number of arguments to copy	*/int	len;				/* size of arg. area (in bytes)	*/{	struct	pentry	*pptr;	char	**fromarg;	long	*toarg;	char	*to;	if (isbadpid(pid) || (pptr= &proctab[pid])->pstate != PRSUSP)		return(SYSERR);	toarg = (long *) ( ((unsigned)pptr->pbase) - (unsigned)len );	to = (char *) (toarg + (nargs + 2));	*toarg++ = (long) (toarg + 1);	for (fromarg=Shl.shtok ; nargs > 0 ; nargs--) {		*toarg++ = (long)to;		strcpy(to, *fromarg++);		to += strlen(to) + 1;			}	*toarg = 0;	return(OK);}@

⌨️ 快捷键说明

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