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

📄 servaccept.c

📁 UNIX环境高级编程第二版(英文版)配书的源代码
💻 C
字号:
#include "apue.h"#include <stropts.h>/* * Wait for a client connection to arrive, and accept it. * We also obtain the client's user ID. * Returns new fd if all OK, <0 on error. */intserv_accept(int listenfd, uid_t *uidptr){	struct strrecvfd	recvfd;	if (ioctl(listenfd, I_RECVFD, &recvfd) < 0)		return(-1);		/* could be EINTR if signal caught */	if (uidptr != NULL)		*uidptr = recvfd.uid;	/* effective uid of caller */	return(recvfd.fd);	/* return the new descriptor */}

⌨️ 快捷键说明

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