亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nfsdlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
    nfsstat       authorized;	/* request is authorized if == NFS_OK*/        /* Initialize task for VxWorks RPC work */        rpcTaskInit ();    transp = svcudp_create(-1);    /* Work loop is repeated until catastrophic error encountered */        FOREVER	{	/* Get the next message */		if (msgQReceive (nfsRequestQ, (char *) &request, sizeof(request),			 WAIT_FOREVER) == ERROR)	    {	    perror ("NFS server aborted abnormally");	    return;	    }	/* Break down the incoming message */		local        = request.routine;	argument     = request.argument;	xdr_argument = request.xdrArg;  	xdr_result   = request.xdrResult;	addr         = &request.sockAddr;	xid          = request.xid;	sock         = request.socket;	/* Create a new RPC transport to reply.  Need to do this as	 * next incoming client request will alter xid field of old	 * transport, and replies won't match the correct request.	 */	transp->xp_sock = sock;	((struct svcudp_data *) transp->xp_p2)->su_xid = xid;	transp->xp_raddr = *addr;	memset (&transp->xp_verf, 0, sizeof(transp->xp_verf));	transp->xp_addrlen = sizeof (transp->xp_raddr);	/* Authenticate the request, then call the correct NFS routine */	if (nfsdAuthHook)	    {	    authorized = (*nfsdAuthHook) (NFS_PROGRAM, NFS_VERSION,					  request.procNum, request.sockAddr,					  argument);	    }	else	    authorized = NFS_OK;	if (authorized  != NFS_OK)	    {	    result = KHEAP_ALLOC(sizeof (nfsstat));	    if (NULL != result)		{		bzero ((char *)result, sizeof (nfsstat));		}	    *((nfsstat *) result) = authorized;	    }	else	    result = (char *) (*local)(argument);	/* Send the result */		if (result != NULL && !svc_sendreply(transp, xdr_result, result))	    {	    svcerr_systemerr(transp);	    }	/* Free any space used by RPC/XDR */		if (!svc_freeargs(transp, xdr_argument, argument))	    {	    perror ("unable to free arguments for NFS server");	    return;	    }	/* Free space allocated when request was queued up */		KHEAP_FREE((char *)result);	KHEAP_FREE((char *)argument);	/* Unfortunately, there's no way to tell svc_destroy() to not close	 * the socket.  So, set the socket to -1. svc_destroy() doesn't	 * check the value of the close() anyway.  If errno is set to	 * S_iosLib_INVALID_FILE_DESCRIPTOR due to the close (-1), reset it	 * to OK.  (svc_destroy() returns NULL, so there's no way to check	 * its return value.)	 */		}    transp->xp_sock = -1;    svc_destroy (transp);    if (errno == S_iosLib_INVALID_FILE_DESCRIPTOR)        errno = OK;    }/******************************************************************************** nfsd - NFS daemon process** Used as the entrypoint to a task spawned from nfsdInit().  This task* sets up the NFS RPC service, and calls svc_run(), which should never return.* nfsdRequestEnqueue() is called from the svc_run() call.** This routine is not declared LOCAL only because the symbol for its entry* point should be displayed by i().* * NOTE:  Some of this routine was generated by rpcgen.* * RETURNS:  Never returns unless an error is encountered.* * SEE ALSO: nfsdRequestEnqueue().* * NOMANUAL*/void nfsd    (    void    )    {    register SVCXPRT * transp;	/* RPC transport */    int                sock;	/* NFS socket */    struct sockaddr_in addr;	/* Address of NFS (port 2049 */    int                optVal = NFS_MAXDATA * 2 + sizeof (struct rpc_msg) * 2;                                /* XXX - too much space is wasted here */        /* Initialize the task to use VxWorks RPC code */        rpcTaskInit();    /* Create NFS socket and bind it to correct address */        sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);    /* Set up the socket address */        addr.sin_family             = AF_INET;    addr.sin_addr.s_addr        = INADDR_ANY;    addr.sin_port               = htons (NFS_PORT);    bzero (addr.sin_zero, sizeof (addr.sin_zero));    if (bind (sock, (struct sockaddr *) &addr, sizeof (addr)) == ERROR)	{	perror ("Could not bind to NFS port address");	return;	}    /* Unset any previous NFS services */    pmap_unset(NFS_PROGRAM, NFS_VERSION);    /* Set socket buffer large enough to accommodate max NFS message */    if ((setsockopt (sock, SOL_SOCKET, SO_SNDBUF, (char *)&optVal,		     sizeof (optVal)) == ERROR)	|| (setsockopt (sock, SOL_SOCKET, SO_RCVBUF, (char *)&optVal,			sizeof (optVal)) == ERROR))        return;    /* Create RPC transport */    transp = svcudp_create(sock);    if (transp == NULL)	{	fprintf(stderr, "cannot create udp service.");	exit(1);	}    /* Register NFS */    if (!svc_register(transp, NFS_PROGRAM, NFS_VERSION, nfsdRequestEnqueue,		      IPPROTO_UDP))	{	perror ("unable to register (NFS_PROGRAM, NFS_VERSION, udp).\n");	return;	}    /* Start the RPC service, and never come back */    svc_run();    /* Should never get to this point */        perror ("NFS svc_run returned");    }/******************************************************************************** nfsproc_null_2 - do nothing** RETURNS: A pointer to malloced spaced that contains no information.** NOMANUAL*/void * nfsproc_null_2    (    void    )    {    nfsdServerStatus.nullCalls++;        return ((void *) KHEAP_ALLOC(0));    }/******************************************************************************** nfsproc_getattr_2 - get file attributes** If the reply status is NFS_OK, then the reply attributes contains the* attributes for the file given by the input fhandle.* * RETURNS: A pointer to an attrstat struct.** NOMANUAL*/attrstat * nfsproc_getattr_2    (    nfs_fh *   fh /* File handle to get attributes of */    )    {    attrstat * retVal = KHEAP_ALLOC(sizeof (attrstat)); /* Struct to fill in */    nfsdServerStatus.getattrCalls++;    nfsdFhNtoh ((NFS_FILE_HANDLE *) fh);        if (retVal == NULL)        return (NULL);    /* Get the attributes for the file */        if (nfsdFattrGet ((NFS_FILE_HANDLE *) fh,			 &retVal->attrstat_u.attributes) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    else        retVal->status = NFS_OK;        return (retVal);    }/******************************************************************************** nfsproc_setattr_2 - set the attributes for a file* * The "attr" argument contains fields which are either -1 or are* the new value for the attributes of "file".  If the reply status is* NFS_OK, then the reply attributes have the attributes of the file* after the "SETATTR" operation has completed.* * Notes:  The use of -1 to indicate an unused field in "attributes" is* changed in the next version of the protocol.** NOMANUAL*/attrstat * nfsproc_setattr_2    (    sattrargs *    attr		/* Attributes to change */    )    {    attrstat *     retVal = KHEAP_ALLOC(sizeof (attrstat));/* Return info */    char *         fileName;    /* Name of the file being changed */    int 	   fd;		/* File descriptor for file being changed */    struct utimbuf timeBuf;	/* New time settings for file */    if (retVal == NULL)        return (NULL);         if ((fileName = (char *) alloca (nfsMaxPath)) == NULL)	return (NULL);    nfsdServerStatus.setattrCalls++;    nfsdFhNtoh ((NFS_FILE_HANDLE *) &attr->file);    /* Make sure the file system is writeable */    if (nfsdFsReadOnly((NFS_FILE_HANDLE *) &attr->file))	{	retVal->status = NFSERR_ACCES;	return (retVal);	}    if (nfsdFhToName ((NFS_FILE_HANDLE *) &attr->file, fileName) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    if (attr->attributes.mode != -1)        /* Currently don't have any way to set the mode */        ;            if (attr->attributes.uid != -1)        /* Currently don't have any way to set the uid */        ;            if (attr->attributes.gid != -1)        /* Currently don't have any way to set the gid */        ;            if (attr->attributes.size != -1)	{	/* Set the size of the file using FIOTRUNC ioctl, as VxWorks	 * doesn't have ftruncate() */	        fd = open (fileName, O_RDWR, 0666);	if (fd != ERROR)	    {	    if (ioctl (fd, FIOTRUNC, attr->attributes.size) == ERROR)		{		retVal->status = nfsdErrToNfs (errno);		close (fd);		return (retVal);		}	    else	        close (fd);	    }	else	    {	    retVal->status = nfsdErrToNfs (errno);	    close (fd);	    return (retVal);	    }	}    /* Set file time.     *     * As there's no way to set only one of these fields, if only one     * is set, set the other one to the same value.     */        if (attr->attributes.atime.seconds != -1)	timeBuf.modtime = timeBuf.actime = attr->attributes.atime.seconds;        if (attr->attributes.mtime.seconds != -1)	{	timeBuf.modtime = attr->attributes.mtime.seconds;	if (attr->attributes.atime.seconds == -1)	    timeBuf.actime = timeBuf.modtime;	}    if ((attr->attributes.atime.seconds != -1) ||	(attr->attributes.mtime.seconds != -1))        if (utime (fileName, &timeBuf) == ERROR)	    {	    retVal->status = nfsdErrToNfs (errno);	    return (retVal);	    }        /* Get the status information for the file to return */        if (nfsdFattrGet ((NFS_FILE_HANDLE *) &attr->file,			 &retVal->attrstat_u.attributes) != OK)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    retVal->status = NFS_OK;    return (retVal);    }/******************************************************************************** nfsproc_root_2 - obsolete* * Obsolete.  This procedure is no longer used because finding the root* file handle of a filesystem requires moving pathnames between client* and server.  To do this right, we would have to define a network* standard representation of pathnames.  Instead, the function of* looking up the root file handle is done by the MNTPROC_MNT procedure.* * RETURNS:  A pointer to no information.** NOMANUAL*/void * nfsproc_root_2    (    void    )    {    nfsdServerStatus.setattrCalls++;    return ((void *) KHEAP_ALLOC(0));    }/******************************************************************************** nfsproc_lookup_2 -* * If the reply "status" is NFS_OK, then the reply "file" and reply* "attributes" are the file handle and attributes for the file "name"* in the directory given by "dir" in the argument.* * RETURNS:  A pointer to a diropres struct, or NULL.** NOMANUAL*/diropres * nfsproc_lookup_2    (    diropargs * dir		/* The direcory and file to look up */    )    {    diropres *  retVal = KHEAP_ALLOC(sizeof (diropres)); /* return status */    if (retVal == NULL)        return (NULL);        nfsdServerStatus.lookupCalls++;    nfsdFhNtoh ((NFS_FILE_HANDLE *) &dir->dir);        /* Build file handle for new file */    if (nfsdFhCreate ((NFS_FILE_HANDLE *) &dir->dir, dir->name,			 (NFS_FILE_HANDLE *) &retVal->diropres_u.diropres.file)	== ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    /* Get the attributes for the newly created file handle */    if (nfsdFattrGet ((NFS_FILE_HANDLE *) &retVal->diropres_u.diropres.file,			 &retVal->diropres_u.diropres.attributes) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    retVal->status = NFS_OK;    nfsdFhHton ((NFS_FILE_HANDLE *) &retVal->diropres_u.diropres.file);        return (retVal);    }/******************************************************************************** nfsproc_readlink_2 - read from a symbolic link* * VxWorks does not support symbolic links.* * RETURNS:  A pointer to an EOPNOTSUPP error.** NOMANUAL*/readlinkres * nfsproc_readlink_2    (    nfs_fh * fh			/* File handle to read */    )    {    readlinkres * retVal = KHEAP_ALLOC(sizeof (retVal->status));    if (retVal == NULL)        return (NULL);    /* Increment statistics */    nfsdServerStatus.readlinkCalls++;    /* symbolic links not supported */    retVal->status = EOPNOTSUPP;    return (retVal);    }/******************************************************************************** nfsproc_read_2 - read data from a file* * Returns up to "count" bytes of "data" from the file given by "file",* starting at "offset" bytes from the beginning of the file.  The first* byte of the file is at offset zero.  The file attributes after the* read takes place are returned in "attributes".* * Notes:  The argument "totalcount" is unused, and is removed in the* next protocol revision.** NOMANUAL*/readres * nfsproc_read_2    (    readargs * readFile		/* File, offset, and count information */    )    {    char *     fileName;        /* Name of the file being read */    readres *  retVal = KHEAP_ALLOC(sizeof (readres) + readFile->count);				/* Return information, including read data */    char *     readData;	/* Address of read data in retVal */    int        fd;		/* File descriptor for file being read */    int	       nBytes;		/* Number of bytes actually read */    if (retVal == NULL)        return (NULL);    if ((fileName = (char *) alloca (nfsMaxPath)) == NULL)	return (NULL);    /* Increment statistics */    nfsdServerStatus.readCalls++;    /* set readData to point to the correct position in the return value */    readData = (char *) retVal + sizeof (readres);        nfsdFhNtoh ((NFS_FILE_HANDLE *) &readFile->file);        if (nfsdFhToName ((NFS_FILE_HANDLE *) &readFile->file, fileName)	== ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    if ((fd = open (fileName, O_RDONLY, 0)) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    if (lseek (fd, readFile->offset, SEEK_SET) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	close (fd);	return (retVal);	}    if ((nBytes = read (fd, readData, readFile->count)) == ERROR)    	{	retVal->status = nfsdErrToNfs (errno);	close (fd);	return (retVal);	}    else	{        retVal->readres_u.reply.data.data_val = readData;	retVal->readres_u.reply.data.data_len = nBytes;	}    if (close (fd) == ERROR)	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    if (nfsdFattrGet ((NFS_FILE_HANDLE *) &readFile->file,			 &retVal->readres_u.reply.attributes) == ERROR)    	{	retVal->status = nfsdErrToNfs (errno);	return (retVal);	}    retVal->status = NFS_OK;    return (retVal);    }/******************************************************************************** nfsproc_writecache_2 - unused*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影在线一区二区| 久久奇米777| 亚洲黄色性网站| 91成人看片片| 天堂在线一区二区| 日韩手机在线导航| 国产资源在线一区| 日韩欧美国产一区在线观看| 午夜精品福利一区二区三区av| 欧美日韩精品一区二区在线播放| 亚洲一区av在线| 欧美性生活影院| 视频在线观看一区二区三区| 7777女厕盗摄久久久| 日韩 欧美一区二区三区| 欧美猛男男办公室激情| 日韩电影在线免费看| 91麻豆精品久久久久蜜臀| 亚洲成av人片一区二区| 欧美男生操女生| 美女视频网站黄色亚洲| 欧美精品一区在线观看| 国产在线视视频有精品| 国产喂奶挤奶一区二区三区| 99在线精品免费| 国产亚洲精久久久久久| 成人爱爱电影网址| 国产精品原创巨作av| 国产亚洲欧美中文| 成人app在线| 亚洲欧美日韩国产手机在线| 777亚洲妇女| 国产一区二区三区日韩| 亚洲欧洲另类国产综合| 欧美日韩久久久| 日韩精品三区四区| 国产人妖乱国产精品人妖| av一本久道久久综合久久鬼色| 亚洲黄色小说网站| 日韩一区二区三区视频| 成人一区二区三区中文字幕| 亚洲精品一二三区| 欧美精品一区男女天堂| 99国产精品99久久久久久| 五月天中文字幕一区二区| 337p日本欧洲亚洲大胆精品| 色悠悠久久综合| 麻豆91精品视频| 成人免费视频在线观看| 91 com成人网| 99久久精品国产毛片| 日本欧美加勒比视频| 国产精品乱码人人做人人爱 | 久久久亚洲精华液精华液精华液| 99在线热播精品免费| 美女免费视频一区二区| 亚洲激情网站免费观看| 精品国产一区二区三区四区四 | 91久久一区二区| 久久狠狠亚洲综合| **性色生活片久久毛片| 日韩一区二区三区在线观看| 99re成人在线| 国产酒店精品激情| 亚洲激情图片小说视频| 日韩一区二区三区视频| 国产成人在线视频网址| 亚洲精品一二三区| 久久香蕉国产线看观看99| 在线一区二区观看| 国产乱国产乱300精品| 九九视频精品免费| 天天爽夜夜爽夜夜爽精品视频| 国产精品欧美精品| 精品99999| 欧美一区二区视频在线观看2022 | 欧美电视剧免费观看| 91成人看片片| 在线亚洲免费视频| 成人av在线观| 国产精品一区一区三区| 日本大胆欧美人术艺术动态| 亚洲六月丁香色婷婷综合久久 | 成a人片亚洲日本久久| 美女www一区二区| 丝袜美腿成人在线| 亚洲国产精品久久久男人的天堂| 最新中文字幕一区二区三区| 国产亚洲精久久久久久| 久久精品无码一区二区三区| 精品国产不卡一区二区三区| 日韩亚洲欧美中文三级| 欧美精品一卡两卡| 欧美日韩亚洲综合| 欧美日韩一区三区四区| 欧美日韩久久久一区| 欧洲一区在线电影| 在线观看欧美黄色| 一本久道中文字幕精品亚洲嫩| 97久久超碰精品国产| 91影院在线观看| 色美美综合视频| 欧美午夜在线观看| 7777精品伊人久久久大香线蕉的 | 狠狠色狠狠色合久久伊人| 日韩中文字幕亚洲一区二区va在线| 亚洲欧美日韩中文字幕一区二区三区| 亚洲三级在线看| 玉足女爽爽91| 日韩国产精品久久| 日韩高清欧美激情| 久久99精品视频| 国产原创一区二区三区| 狠狠狠色丁香婷婷综合激情| 粉嫩一区二区三区在线看| 99综合影院在线| 97成人超碰视| 欧美高清一级片在线| 日韩精品一区在线观看| 久久精品视频一区| 亚洲欧美另类图片小说| 亚洲日本一区二区| 亚洲美女免费视频| 亚洲国产精品精华液网站| 午夜一区二区三区在线观看| 亚洲国产精品人人做人人爽| 在线观看视频一区二区欧美日韩| 88在线观看91蜜桃国自产| 久久夜色精品国产噜噜av| 自拍偷拍国产亚洲| 日韩不卡手机在线v区| 国产一区二区精品久久91| jiyouzz国产精品久久| 欧美在线不卡视频| 久久一区二区三区国产精品| 国产片一区二区| 亚洲成av人片在线观看| 国产一区二区主播在线| 色偷偷一区二区三区| 精品美女被调教视频大全网站| 欧美激情一区二区三区蜜桃视频| 一区二区三区蜜桃| 国产一区二区三区在线观看精品| 懂色av中文字幕一区二区三区| 欧美另类变人与禽xxxxx| 国产视频一区在线播放| 亚洲综合激情网| 国产成人a级片| 欧美日本一道本在线视频| 国产精品人妖ts系列视频| 美国三级日本三级久久99| 在线视频欧美区| 精品999在线播放| 午夜视频久久久久久| 9人人澡人人爽人人精品| 欧美精品一区二区三区视频| 五月婷婷激情综合| 日本高清视频一区二区| 精品国产1区二区| 亚洲丝袜美腿综合| 精品无人码麻豆乱码1区2区| 欧美日本在线观看| 国产精品高潮呻吟| 国产麻豆午夜三级精品| 欧美精品在线一区二区三区| 亚洲精品视频免费观看| 成人丝袜18视频在线观看| 欧美哺乳videos| 肉色丝袜一区二区| 欧美图片一区二区三区| 亚洲欧美色一区| 99久久夜色精品国产网站| 久久蜜桃av一区二区天堂| 美女视频黄频大全不卡视频在线播放| 精品视频在线看| 亚洲品质自拍视频| 国产在线国偷精品产拍免费yy| 91精品国产乱码| 日日骚欧美日韩| 欧美一区二区三区四区在线观看| 一区二区三区四区在线播放| 色综合久久中文综合久久97| 国产欧美日韩麻豆91| 国产精品一区二区91| 久久久三级国产网站| 久久精品国产精品亚洲综合| 欧美一级二级在线观看| 亚洲成av人片一区二区| 欧美日本在线观看| 三级不卡在线观看| 欧美一级久久久久久久大片| 日本欧美一区二区三区乱码| 欧美日韩国产精品自在自线| 天堂va蜜桃一区二区三区| 欧美精品乱码久久久久久按摩| 日韩精品亚洲一区| 日韩欧美第一区| 国产美女精品在线| 国产精品每日更新| 日本精品一区二区三区四区的功能|