您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ svc_destroy函数代码示例

51自学网 2021-06-03 08:33:55
  C++
这篇教程C++ svc_destroy函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中svc_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ svc_destroy函数的具体用法?C++ svc_destroy怎么用?C++ svc_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了svc_destroy函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: daVarServUnSet

int daVarServUnSet(int prog, int version){  register SVCXPRT *transp;    if(prog==0) prog = last_program;  if(version==0) version = last_version;  (void) pmap_unset(prog,version);  if(prog==last_program && version == last_version){    if(udp_transp) svc_destroy(udp_transp);    if(tcp_transp) svc_destroy(tcp_transp);  }  return(0);}
开发者ID:JeffersonLab,项目名称:simc_gfortran,代码行数:13,


示例2: main

int main(int argn, char *argc[]){	//Program parameters : argc[1] : HostName or Host IP	//                                         argc[2] : Server Program Number	//                                         other arguments depend on test case	//run_mode can switch into stand alone program or program launch by shell script	//1 : stand alone, debug mode, more screen information	//0 : launch by shell script as test case, only one printf -> result status	int run_mode = 0;	int test_status = 1;	//Default test result set to FAILED	int sock = 600;	SVCXPRT *svcr = NULL;	//create a server	//	sock = socket(AF_UNIX, SOCK_SEQPACKET, IPPROTO_UDP);	svcr = svcudp_bufcreate(sock, 1500, 1500);	//check returned value	test_status = ((SVCXPRT *) svcr != NULL) ? 0 : 1;	//clean up	svc_destroy(svcr);	//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);	return test_status;}
开发者ID:1587,项目名称:ltp,代码行数:31,


示例3: main

int main(void){	//Program parameters : argc[1] : HostName or Host IP	//                                         argc[2] : Server Program Number	//                                         other arguments depend on test case	int test_status = 1;	//Default test result set to FAILED	int sock = 600;	SVCXPRT *svcr = NULL;	//create a server	sock = socket(AF_UNIX, SOCK_DGRAM, IPPROTO_TCP);	svcr = svctcp_create(sock, 0, 0);	test_status = (svcr != NULL) ? 0 : 1;	//clean up	svc_destroy(svcr);	//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);	return test_status;}
开发者ID:1587,项目名称:ltp,代码行数:25,


示例4: main

int main(int argn, char *argc[]){	//Program parameters : argc[1] : HostName or Host IP	//					   argc[2] : Server Program Number	//					   other arguments depend on test case	//run_mode can switch into stand alone program or program launch by shell script	//1 : stand alone, debug mode, more screen information	//0 : launch by shell script as test case, only one printf -> result status	int run_mode = 0;	int test_status = 1; //Default test result set to FAILED	SVCXPRT *svcr = NULL;	int fd = 0;	//create a server	svcr = svcfd_create(fd, 1024, 1024);	//call routine	xprt_register(svcr);	//If we are here, xprt_register returned : test has passed	test_status = 0;	//clean up	svc_destroy(svcr);	//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);	return test_status;}
开发者ID:Mellanox,项目名称:arc_ltp,代码行数:32,


示例5: cps_contains

int *is_alive_6_svc(        unsigned *id,        struct svc_req *rqstp){    static int alive;    SVCXPRT * const xprt = rqstp->rq_xprt;    int error = 0;    alive = cps_contains((pid_t) *id);    if (ulogIsDebug()) {        udebug("LDM %u is %s", *id, alive ? "alive" : "dead");    }    if (!svc_sendreply(xprt, (xdrproc_t) xdr_bool, (caddr_t) &alive)) {        svcerr_systemerr(xprt);        error = 1;    }    if (!svc_freeargs(xprt, xdr_u_int, (caddr_t)id)) {        uerror("Couldn't free arguments");        error = 1;    }    svc_destroy(xprt);    exit(error);    /*NOTREACHED*/    return NULL ;}
开发者ID:khallock,项目名称:LDM,代码行数:33,


示例6: nfs_callback_up

/* * Bring up the callback thread if it is not already up. */int nfs_callback_up(void){	struct svc_serv *serv = NULL;	int ret = 0;	mutex_lock(&nfs_callback_mutex);	if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)		goto out;	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,				nfs_callback_family, NULL);	ret = -ENOMEM;	if (!serv)		goto out_err;	ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,			      SVC_SOCK_ANONYMOUS);	if (ret <= 0)		goto out_err;	nfs_callback_tcpport = ret;	dprintk("NFS: Callback listener port = %u (af %u)/n",			nfs_callback_tcpport, nfs_callback_family);	nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);	if (IS_ERR(nfs_callback_info.rqst)) {		ret = PTR_ERR(nfs_callback_info.rqst);		nfs_callback_info.rqst = NULL;		goto out_err;	}	svc_sock_update_bufs(serv);	nfs_callback_info.task = kthread_run(nfs_callback_svc,					     nfs_callback_info.rqst,					     "nfsv4-svc");	if (IS_ERR(nfs_callback_info.task)) {		ret = PTR_ERR(nfs_callback_info.task);		svc_exit_thread(nfs_callback_info.rqst);		nfs_callback_info.rqst = NULL;		nfs_callback_info.task = NULL;		goto out_err;	}out:	/*	 * svc_create creates the svc_serv with sv_nrthreads == 1, and then	 * svc_prepare_thread increments that. So we need to call svc_destroy	 * on both success and failure so that the refcount is 1 when the	 * thread exits.	 */	if (serv)		svc_destroy(serv);	mutex_unlock(&nfs_callback_mutex);	return ret;out_err:	dprintk("NFS: Couldn't create callback socket or server thread; "		"err = %d/n", ret);	nfs_callback_info.users--;	goto out;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:61,


示例7: lockd_up

/* * Bring up the lockd process if it's not already up. */intlockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */{	struct svc_serv *	serv;	int			error = 0;	mutex_lock(&nlmsvc_mutex);	/*	 * Check whether we're already up and running.	 */	if (nlmsvc_pid) {		if (proto)			error = make_socks(nlmsvc_serv, proto);		goto out;	}	/*	 * Sanity check: if there's no pid,	 * we should be the first user ...	 */	if (nlmsvc_users)		printk(KERN_WARNING			"lockd_up: no pid, %d users??/n", nlmsvc_users);	error = -ENOMEM;	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);	if (!serv) {		printk(KERN_WARNING "lockd_up: create service failed/n");		goto out;	}	if ((error = make_socks(serv, proto)) < 0)		goto destroy_and_out;	/*	 * Create the kernel thread and wait for it to start.	 */	error = svc_create_thread(lockd, serv);	if (error) {		printk(KERN_WARNING			"lockd_up: create thread failed, error=%d/n", error);		goto destroy_and_out;	}	wait_for_completion(&lockd_start_done);	/*	 * Note: svc_serv structures have an initial use count of 1,	 * so we exit through here on both success and failure.	 */destroy_and_out:	svc_destroy(serv);out:	if (!error)		nlmsvc_users++;	mutex_unlock(&nlmsvc_mutex);	return error;}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:60,


示例8: up7_destroy

static voidup7_destroy(    Up7* const up7){    svc_unregister(LDMPROG, SEVEN);    if (up7->xprt)        svc_destroy(up7->xprt);    up7->xprt = NULL;}
开发者ID:dgaer,项目名称:LDM,代码行数:9,


示例9: create_nfs_service

/* * Create the nfs service for amd * return 0 (TRUE) if OK, 1 (FALSE) if failed. */intcreate_nfs_service(int *soNFSp, u_short *nfs_portp, SVCXPRT **nfs_xprtp, void (*dispatch_fxn)(struct svc_req *rqstp, SVCXPRT *transp), u_long nfs_version){  char *nettype = "ticlts";  nfsncp = getnetconfigent(nettype);  if (nfsncp == NULL) {    plog(XLOG_ERROR, "cannot getnetconfigent for %s", nettype);    /* failed with ticlts, try plain udp (hpux11) */    nettype = "udp";    nfsncp = getnetconfigent(nettype);    if (nfsncp == NULL) {      plog(XLOG_ERROR, "cannot getnetconfigent for %s", nettype);      return 1;    }  }  *nfs_xprtp = svc_tli_create(RPC_ANYFD, nfsncp, NULL, 0, 0);  if (*nfs_xprtp == NULL) {    plog(XLOG_ERROR, "cannot create nfs tli service for amd");    return 1;  }  /*   * Get the service file descriptor and check its number to see if   * the t_open failed.  If it succeeded, then go on to binding to a   * reserved nfs port.   */  *soNFSp = (*nfs_xprtp)->xp_fd;  if (*soNFSp < 0 || bind_nfs_port(*soNFSp, nfs_portp) < 0) {    plog(XLOG_ERROR, "Can't create privileged nfs port (TLI)");    svc_destroy(*nfs_xprtp);    return 1;  }  if (svc_reg(*nfs_xprtp, NFS_PROGRAM, nfs_version, dispatch_fxn, NULL) != 1) {    plog(XLOG_ERROR, "could not register amd NFS service");    svc_destroy(*nfs_xprtp);    return 1;  }  return 0;			/* all is well */}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:45,


示例10: loc_apicb_app_deinit

void loc_apicb_app_deinit(void){   if (svrPort == NULL)   {      return;   }   svc_unregister(svrPort, LOC_APICBPROG, LOC_APICBVERS_0001);   xprt_unregister(svrPort);   svc_destroy(svrPort);   svrPort = NULL;}
开发者ID:Bauuuuu,项目名称:android_device_zte_nx512j,代码行数:12,


示例11: down6_blkdata

/*ARGSUSED1*/void *blkdata_6_svc(        datapkt *argp,        struct svc_req *rqstp){    int error = down6_blkdata(argp);    if (error && DOWN6_UNWANTED != error && DOWN6_PQ_BIG != error) {        (void) svcerr_systemerr(rqstp->rq_xprt);        svc_destroy(rqstp->rq_xprt);        exit(error);    }    return NULL ; /* don't reply */}
开发者ID:khallock,项目名称:LDM,代码行数:15,


示例12: ipgwin_unregister_msg

/*************************************************************************									**  Unregister all receiver message ports.				**									*/voidipgwin_unregister_msg(void){   Svcmsg *temp;   while (svchead)   {      svc_unregister(svchead->prognum, svchead->versnum);      svc_destroy(svchead->xprt);      temp = svchead->next;      (void)free((char *)svchead);      svchead = temp;   }}
开发者ID:timburrow,项目名称:ovj3,代码行数:18,


示例13: main

int main(int argn, char *argc[]){	//Program parameters : argc[1] : HostName or Host IP	//					   argc[2] : Server Program Number	//					   other arguments depend on test case		//run_mode can switch into stand alone program or program launch by shell script	//1 : stand alone, debug mode, more screen information	//0 : launch by shell script as test case, only one printf -> result status	int run_mode = 0;	int test_status = 1; //Default test result set to FAILED	int progNum = atoi(argc[2]);	char nettype[16] = "visible";	SVCXPRT *svcr;        struct netconfig *nconf;        //Test initialization        if ((nconf = getnetconfigent("tcp")) == (struct netconfig *)NULL){        	fprintf(stderr, "Cannot get netconfig entry for TCP/n");		exit(1);        }		if (run_mode == 1)	{		printf("Server : %s/n", argc[1]);		printf("Server # %d/n", progNum);	}			//First create server	svcr = svc_tp_create(exm_proc, progNum, VERSNUM, nconf);		//Prepare destruction	svc_unreg(progNum, VERSNUM);		//then destroy it	svc_destroy(svcr);		svc_unreg(progNum, VERSNUM);		//If we are here, test has passed	test_status = 0;		//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);		return test_status;}
开发者ID:ystk,项目名称:debian-ltp,代码行数:49,


示例14: on_stop

static void on_stop() {    DEBUG_FUNCTION;    svc_exit();    svc_unregister(STORAGE_PROGRAM, STORAGE_VERSION);    pmap_unset(STORAGE_PROGRAM, STORAGE_VERSION);    if (storaged_svc) {        svc_destroy(storaged_svc);        storaged_svc = NULL;    }    storaged_release();    rozofs_release();    info("stopped.");    closelog();}
开发者ID:bparrein,项目名称:rozofs,代码行数:15,


示例15: feed_or_notify

/** * Notifies a downstream LDM of subscribed-to data-products. * <p> * This function will not normally return unless the request necessitates a * reply (e.g., RECLASS). */fornme_reply_t *notifyme_6_svc(        prod_class_t* want,        struct svc_req* rqstp){    SVCXPRT* const xprt = rqstp->rq_xprt;    fornme_reply_t* reply = feed_or_notify(xprt, want, 1, 0);    if (!svc_freeargs(xprt, xdr_prod_class, (caddr_t)want)) {        uerror("Couldn't free arguments");        svc_destroy(xprt);        exit(1);    }    return reply;}
开发者ID:khallock,项目名称:LDM,代码行数:21,


示例16: main

int main(int argn, char *argc[]){	//Program parameters : argc[1] : HostName or Host IP	//					   argc[2] : Server Program Number	//					   argc[3] : Number of testes function calls	//					   other arguments depend on test case		//run_mode can switch into stand alone program or program launch by shell script	//1 : stand alone, debug mode, more screen information	//0 : launch by shell script as test case, only one printf -> result status	int run_mode = 0;	int test_status = 1; //Default test result set to FAILED	int sock = 600;	SVCXPRT *svcr = NULL;    int nbCall = atoi(argc[3]);	int nbOk = 0;	int i;		//create a server	//	sock = socket(AF_UNIX, SOCK_SEQPACKET, IPPROTO_UDP);	for (i = 0; i < nbCall; i++)	{		svcr = svcudp_create(sock);		if (svcr != (SVCXPRT *)NULL)			nbOk++;	}		//If we are here, macro call was successful	if (run_mode == 1)	{		printf("Aimed : %d/n", nbCall);		printf("Got : %d/n", nbOk);	}		test_status = (nbOk == nbCall) ? 0 : 1;		//clean up	svc_destroy(svcr);		//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);		return test_status;}
开发者ID:ystk,项目名称:debian-ltp,代码行数:46,


示例17: svc_exit_thread

voidsvc_exit_thread(struct svc_rqst *rqstp){	struct svc_serv	*serv = rqstp->rq_server;	struct svc_pool	*pool = rqstp->rq_pool;	spin_lock_bh(&pool->sp_lock);	pool->sp_nrthreads--;	if (!test_and_set_bit(RQ_VICTIM, &rqstp->rq_flags))		list_del_rcu(&rqstp->rq_all);	spin_unlock_bh(&pool->sp_lock);	svc_rqst_free(rqstp);	/* Release the server */	if (serv)		svc_destroy(serv);}
开发者ID:BWhitten,项目名称:linux-stable,代码行数:18,


示例18: down6_comingsoon

/*ARGSUSED1*/comingsoon_reply_t *comingsoon_6_svc(        comingsoon_args *comingPar,        struct svc_req *rqstp){    static comingsoon_reply_t reply;    int error = down6_comingsoon(comingPar);    if (error == 0) {        reply = OK;    }    else if (DOWN6_UNWANTED == error || DOWN6_PQ_BIG == error) {        reply = DONT_SEND;    }    else {        (void) svcerr_systemerr(rqstp->rq_xprt);        svc_destroy(rqstp->rq_xprt);        exit(error);    }    return &reply;}
开发者ID:khallock,项目名称:LDM,代码行数:22,


示例19: down6_hereis

void *hereis_6_svc(        product *prod,        struct svc_req *rqstp){    if (dp_isNil(prod)) {        /*         * The upstream LDM sent a nil data-product to flush the connection.         */    }    else {        int error = down6_hereis(prod);        if (error && DOWN6_UNWANTED != error && DOWN6_PQ_BIG != error) {            (void) svcerr_systemerr(rqstp->rq_xprt);            svc_destroy(rqstp->rq_xprt);            exit(error);        }    }    return NULL ; /* don't reply */}
开发者ID:khallock,项目名称:LDM,代码行数:21,


示例20: main

int main(int argn, char *argc[]){    //Program parameters : argc[1] : HostName or Host IP    //					   argc[2] : Server Program Number    //					   other arguments depend on test case    //run_mode can switch into stand alone program or program launch by shell script    //1 : stand alone, debug mode, more screen information    //0 : launch by shell script as test case, only one printf -> result status    int run_mode = 0;    int test_status = 1; //Default test result set to FAILED    int progNum = atoi(argc[2]);    SVCXPRT *svcr = NULL;    int rslt;    //Initialisation    pmap_unset(progNum, VERSNUM);    //create a server    svcr = svcudp_create(RPC_ANYSOCK);    //call routine    rslt = registerrpc(progNum, VERSNUM, PROCNUM, simplePing, xdr_int, xdr_int);    if (run_mode)    {        printf("SVC : %d/n", svcr);        printf("rslt : %d/n", rslt);    }    test_status = (rslt == 0) ? 0 : 1;    //clean up    svc_destroy(svcr);    //This last printf gives the result status to the tests suite    //normally should be 0: test has passed or 1: test has failed    printf("%d/n", test_status);    return test_status;}
开发者ID:shubmit,项目名称:shub-ltp,代码行数:40,


示例21: __write_ports_addxprt

/* * A transport listener is added by writing it's transport name and * a port number. */static ssize_t __write_ports_addxprt(char *buf){	char transport[16];	struct svc_xprt *xprt;	int port, err;	if (sscanf(buf, "%15s %4u", transport, &port) != 2)		return -EINVAL;	if (port < 1 || port > USHRT_MAX)		return -EINVAL;	err = nfsd_create_serv();	if (err != 0)		return err;	err = svc_create_xprt(nfsd_serv, transport, &init_net,				PF_INET, port, SVC_SOCK_ANONYMOUS);	if (err < 0)		goto out_err;	err = svc_create_xprt(nfsd_serv, transport, &init_net,				PF_INET6, port, SVC_SOCK_ANONYMOUS);	if (err < 0 && err != -EAFNOSUPPORT)		goto out_close;	/* Decrease the count, but don't shut down the service */	nfsd_serv->sv_nrthreads--;	return 0;out_close:	xprt = svc_find_xprt(nfsd_serv, transport, PF_INET, port);	if (xprt != NULL) {		svc_close_xprt(xprt);		svc_xprt_put(xprt);	}out_err:	svc_destroy(nfsd_serv);	return err;}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:43,


示例22: main

int main(int argn, char *argc[]){	//Program parameters : argc[1] : HostName or Host IP	//                                         argc[2] : Server Program Number	//                                         other arguments depend on test case	//run_mode can switch into stand alone program or program launch by shell script	//1 : stand alone, debug mode, more screen information	//0 : launch by shell script as test case, only one printf -> result status	int run_mode = 0;	int test_status = 1;	//Default test result set to FAILED	int progNum = atoi(argc[2]);	SVCXPRT *svcr = NULL;	//Initialisation	pmap_unset(progNum, VERSNUM);	//create a server	svcr = svctcp_create(RPC_ANYSOCK, 0, 0);	svc_register(svcr, progNum, VERSNUM, dispatch, IPPROTO_TCP);	if (run_mode) {		printf("SVC : %p/n", svcr);	}	//call routine	svc_unregister(progNum, VERSNUM);	//If we are here, test has passed	test_status = 0;	//clean up	svc_destroy(svcr);	//This last printf gives the result status to the tests suite	//normally should be 0: test has passed or 1: test has failed	printf("%d/n", test_status);	return test_status;}
开发者ID:1587,项目名称:ltp,代码行数:39,


示例23: __write_ports_addfd

/* * A single 'fd' number was written, in which case it must be for * a socket of a supported family/protocol, and we use it as an * nfsd listener. */static ssize_t __write_ports_addfd(char *buf){	char *mesg = buf;	int fd, err;	err = get_int(&mesg, &fd);	if (err != 0 || fd < 0)		return -EINVAL;	err = nfsd_create_serv();	if (err != 0)		return err;	err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT);	if (err < 0) {		svc_destroy(nfsd_serv);		return err;	}	/* Decrease the count, but don't shut down the service */	nfsd_serv->sv_nrthreads--;	return err;}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:28,


示例24: main

int main(void){	int test_status = 1;	SVCXPRT *transp = NULL;	int sock;	sock = bound_socket(AF_INET, SOCK_DGRAM);	if (sock < 0) {		perror("bound_socket() failed");		return 1;	}	transp = svc_dg_create(sock, 0, 0);	test_status = ((SVCXPRT *) transp != NULL) ? 0 : 1;	if (transp != NULL)		svc_destroy(transp);	close(sock);	printf("%d/n", test_status);	return test_status;}
开发者ID:1587,项目名称:ltp,代码行数:24,


示例25: lockd_up

/* * Bring up the lockd process if it's not already up. */int lockd_up(struct net *net){	struct svc_serv *serv;	int error;	mutex_lock(&nlmsvc_mutex);	serv = lockd_create_svc();	if (IS_ERR(serv)) {		error = PTR_ERR(serv);		goto err_create;	}	error = lockd_up_net(serv, net);	if (error < 0)		goto err_net;	error = lockd_start_svc(serv);	if (error < 0)		goto err_start;	nlmsvc_users++;	/*	 * Note: svc_serv structures have an initial use count of 1,	 * so we exit through here on both success and failure.	 */err_net:	svc_destroy(serv);err_create:	mutex_unlock(&nlmsvc_mutex);	return error;err_start:	lockd_down_net(serv, net);	goto err_net;}
开发者ID:sagark,项目名称:linux-pf-profile,代码行数:39,


示例26: ipgwin_register_msg_receive

/*************************************************************************									**  This routine is used to register a specific function which will be	**  called when there is a message.					**  User function to be called can be NULL, indicating unregistering     **  message, or user-func address, which takes a form of                 **  func(u_long proc_id,  where proc_id is ID number.                    **       Ipgmsg *msg)       where msg is a message.                        **									**  Return program number for success and 0 for failure.			**  									**  In RPC term, SERVER registers/unregisters program and version number	**									*/u_longipgwin_register_msg_receive(      u_long prognum,		/* program ID */      u_long versnum,		/* program version */      void (*userfunc)(u_long, Ipgmsg*)){   Svcmsg *current, *prev;	/* ptrs used for message item */   Svcmsg *newitem;		/* new created item */   SVCXPRT *transp;		/* transport info */   int protocol;		/* protocol */   /* Check if the msgid has been registered or not.  If the message  */   /* has been registered, only change the user function.  If the user */   /* function is NULL, delete the message item from the list.  If the */   /* message has not been registered, add the new message item at the */   /* first of the list.					       */   for (current=prev=svchead; current; prev=current, current=current->next)   {      if ((current->prognum == prognum) &&          (current->versnum == versnum))   /* Found */      {         svc_unregister(current->prognum, current->versnum);	 svc_destroy(current->xprt);         if (current == prev)  /* Only one item on the list */	    svchead = NULL;         else            prev->next = current->next;         (void)free((char *)current);	 if (userfunc == NULL) 	    return(prognum) ;	 else	    break;      }   }   /* Create an RPC with TCP socket */   if ((transp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL)   {      STDERR("Can't create RPC");      return(0);   }   /* Get the "transient" program number if prognum is zero */   if (prognum == 0)   {      /* The "transient" program number starts at 0x40000000 */      /* Get the unused number.				     */      prognum = 0x40000000;      while (!pmap_set(prognum, versnum, IPPROTO_TCP, transp->xp_port))	 prognum++;      /* We don't need to register it at svc_register since pmap_set */      /* has done it.						     */      protocol = 0;   }   else   {      /* Erase the pormapper's table */      pmap_unset(prognum, versnum);      protocol = IPPROTO_TCP;   }   /* Register the portmapper. */   /* Note that Sun suggests that the program number ranges from */   /* 0x20000000 to 0x5fffffff.  However, our routine doesn't    */   /* check for this limit.		        */#ifdef SOLARIS   if (!svc_register(transp, prognum, versnum,		     ipgwin_priv_msg_receive, protocol))#elif LINUX    if (!svc_register(transp, prognum, versnum,		     ipgwin_priv_msg_receive, protocol))#else   if (!svc_register(transp, prognum, versnum,        (void (*)(DOTDOTDOT))ipgwin_priv_msg_receive, protocol))#endif   {      STDERR("ipgwin_register_msg_receive:Can't register RPC");      svc_destroy(transp);      return(0);   }   /* Create new item */   if ((newitem = (Svcmsg *)malloc(sizeof(Svcmsg))) == NULL)//.........这里部分代码省略.........
开发者ID:timburrow,项目名称:ovj3,代码行数:101,


示例27: lockd_up

/* * Bring up the lockd process if it's not already up. */int lockd_up(void){	struct svc_serv *serv;	int		error = 0;	mutex_lock(&nlmsvc_mutex);	/*	 * Check whether we're already up and running.	 */	if (nlmsvc_rqst)		goto out;	/*	 * Sanity check: if there's no pid,	 * we should be the first user ...	 */	if (nlmsvc_users)		printk(KERN_WARNING			"lockd_up: no pid, %d users??/n", nlmsvc_users);	error = -ENOMEM;	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);	if (!serv) {		printk(KERN_WARNING "lockd_up: create service failed/n");		goto out;	}	error = make_socks(serv);	if (error < 0)		goto destroy_and_out;	/*	 * Create the kernel thread and wait for it to start.	 */	nlmsvc_rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);	if (IS_ERR(nlmsvc_rqst)) {		error = PTR_ERR(nlmsvc_rqst);		nlmsvc_rqst = NULL;		printk(KERN_WARNING			"lockd_up: svc_rqst allocation failed, error=%d/n",			error);		goto destroy_and_out;	}	svc_sock_update_bufs(serv);	serv->sv_maxconn = nlm_max_connections;	nlmsvc_task = kthread_run(lockd, nlmsvc_rqst, serv->sv_name);	if (IS_ERR(nlmsvc_task)) {		error = PTR_ERR(nlmsvc_task);		svc_exit_thread(nlmsvc_rqst);		nlmsvc_task = NULL;		nlmsvc_rqst = NULL;		printk(KERN_WARNING			"lockd_up: kthread_run failed, error=%d/n", error);		goto destroy_and_out;	}	/*	 * Note: svc_serv structures have an initial use count of 1,	 * so we exit through here on both success and failure.	 */destroy_and_out:	svc_destroy(serv);out:	if (!error)		nlmsvc_users++;	mutex_unlock(&nlmsvc_mutex);	return error;}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:73,



注:本文中的svc_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ svc_freeargs函数代码示例
C++ svcSendSyncRequest函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。