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

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

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

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

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

示例1: bgp_keepalive_timer

/* BGP keepalive fire ! */static intbgp_keepalive_timer (struct thread *thread){  struct peer *peer;  peer = THREAD_ARG (thread);  peer->t_keepalive = NULL;  if (BGP_DEBUG (fsm, FSM))    zlog (peer->log, LOG_DEBUG,	  "%s [FSM] Timer (keepalive timer expire)",	  peer->host__item);  THREAD_VAL (thread) = KeepAlive_timer_expired;  bgp_event (thread); /* bgp_event unlocks peer */  return 0;}
开发者ID:inet-framework,项目名称:inet-quagga,代码行数:19,


示例2: bgp_holdtime_timer

/* BGP holdtime timer. */static intbgp_holdtime_timer (struct thread *thread){  struct peer *peer;  peer = THREAD_ARG (thread);  peer->t_holdtime = NULL;  if (BGP_DEBUG (fsm, FSM))    zlog (peer->log, LOG_DEBUG,	  "%s [FSM] Timer (holdtime timer expire)",	  peer->host);  THREAD_VAL (thread) = Hold_Timer_expired;  bgp_event (thread);  return 0;}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:19,


示例3: sockunion_bind

/* Bind socket to specified address. */intsockunion_bind (int sock, union sockunion *su, unsigned short port, 		union sockunion *su_addr){  int size = 0;  int ret;  if (su->sa.sa_family == AF_INET)    {      size = sizeof (struct sockaddr_in);      su->sin.sin_port = htons (port);#ifdef HAVE_SIN_LEN      su->sin.sin_len = size;#endif /* HAVE_SIN_LEN */      if (su_addr == NULL)	su->sin.sin_addr.s_addr = htonl (INADDR_ANY);    }#ifdef HAVE_IPV6  else if (su->sa.sa_family == AF_INET6)    {      size = sizeof (struct sockaddr_in6);      su->sin6.sin6_port = htons (port);#ifdef SIN6_LEN      su->sin6.sin6_len = size;#endif /* SIN6_LEN */      if (su_addr == NULL)	{#if defined(LINUX_IPV6) || defined(NRL)	  memset (&su->sin6.sin6_addr, 0, sizeof (struct in6_addr));#else	  su->sin6.sin6_addr = in6addr_any;#endif /* LINUX_IPV6 */	}    }#endif /* HAVE_IPV6 */    ret = bind (sock, (struct sockaddr *)su, size);#ifdef FOX_RIP_DEBUG  if (ret < 0)    zlog (NULL, LOG_WARNING, "can't bind socket : %s", strerror (errno));#endif /* FOX_RIP_DEBUG */  return ret;}
开发者ID:hajuuk,项目名称:R7000,代码行数:45,


示例4: MakeLowerString

bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {	BootingUp = false;		const char* zn = MakeLowerString(database.GetZoneName(iZoneID));	char*	longname;	if (iZoneID)		zlog(WORLD__ZONE,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, 			iStaticZone ? " (Static)" : "");	zoneID = iZoneID;	instanceID = iInstanceID;	if(iZoneID!=0)		oldZoneID = iZoneID;	if (zoneID == 0) {		client_list.CLERemoveZSRef(this);		pNumPlayers = 0;		LSSleepUpdate(GetPrevZoneID());	}	staticzone = iStaticZone;	if (zn)	{		strn0cpy(zone_name, zn, sizeof(zone_name));		if( database.GetZoneLongName( (char*)zone_name, &longname, NULL, NULL, NULL, NULL, NULL, NULL ) )		{			strn0cpy(long_name, longname, sizeof(long_name));			safe_delete_array( longname );		}		else			strcpy(long_name, "");	}	else	{		strcpy(zone_name, "");		strcpy(long_name, "");	}		client_list.ZoneBootup(this);	ls_zboot.Start();	return true;}
开发者ID:Vaion,项目名称:Server,代码行数:44,


示例5: ipv4_multicast_join

/* Join to the RIP version 2 multicast group. */static intipv4_multicast_join (int sock, 		     struct in_addr group, 		     struct in_addr ifa,		     unsigned int ifindex){  int ret;  ret = setsockopt_ipv4_multicast (sock,				   IP_ADD_MEMBERSHIP, 				   group.s_addr, 				   ifindex);   if (ret < 0)     zlog (NULL, LOG_INFO, "can't setsockopt IP_ADD_MEMBERSHIP %s",	  safe_strerror (errno));  return ret;}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:20,


示例6: fpm_request_finished

void fpm_request_finished() /* {{{ */{	struct fpm_scoreboard_proc_s *proc;	struct timeval now;	fpm_clock_get(&now);	proc = fpm_scoreboard_proc_acquire(NULL, -1, 0);	if (proc == NULL) {		zlog(ZLOG_WARNING, "failed to acquire proc scoreboard");		return;	}	proc->request_stage = FPM_REQUEST_FINISHED;	proc->tv = now;	memset(&proc->accepted, 0, sizeof(proc->accepted));	proc->accepted_epoch = 0;	fpm_scoreboard_proc_release(proc);}
开发者ID:mdesign83,项目名称:php-src,代码行数:19,


示例7: fpm_trace_ready

int fpm_trace_ready(pid_t pid){	kern_return_t kr;	kr = task_for_pid(mach_task_self(), pid, &target);	if (kr != KERN_SUCCESS) {		char *msg = "";		if (kr == KERN_FAILURE) {			msg = " It seems that master process does not have enough privileges to trace processes.";		}		zlog(ZLOG_STUFF, ZLOG_ERROR, "task_for_pid() failed: %s (%d)%s", mach_error_string(kr), kr, msg);		return -1;	}	return 0;}
开发者ID:CoolCloud,项目名称:php-fpm,代码行数:19,


示例8: sockunion_getpeername

/* After TCP connection is established.  Get remote address and port. */union sockunion *sockunion_getpeername (int fd){  int ret;  socklen_t len;  union  {    struct sockaddr sa;    struct sockaddr_in sin;#ifdef HAVE_IPV6    struct sockaddr_in6 sin6;#endif /* HAVE_IPV6 */    char tmp_buffer[128];  } name;  union sockunion *su;  memset (&name, 0, sizeof name);  len = sizeof name;  ret = getpeername (fd, (struct sockaddr *)&name, &len);  if (ret < 0)    {      zlog (NULL, LOG_WARNING, "Can't get remote address and port: %s",	    safe_strerror (errno));      return NULL;    }  if (name.sa.sa_family == AF_INET)    {      su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));      memcpy (su, &name, sizeof (struct sockaddr_in));      return su;    }#ifdef HAVE_IPV6  if (name.sa.sa_family == AF_INET6)    {      su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));      memcpy (su, &name, sizeof (struct sockaddr_in6));      sockunion_normalise_mapped (su);      return su;    }#endif /* HAVE_IPV6 */  return NULL;}
开发者ID:Einheri,项目名称:wl500g,代码行数:44,


示例9: ospf_hello_timer

int ospf_hello_timer(struct thread *thread){	struct ospf_interface *oi;	oi = THREAD_ARG(thread);	oi->t_hello = NULL;	if (IS_DEBUG_OSPF(ism, ISM_TIMERS))		zlog(NULL, LOG_DEBUG, "ISM[%s]: Timer (Hello timer expire)",		     IF_NAME(oi));	/* Sending hello packet. */	ospf_hello_send(oi);	/* Hello timer set. */	OSPF_HELLO_TIMER_ON(oi);	return 0;}
开发者ID:yubo,项目名称:quagga,代码行数:19,


示例10: fpm_event_poll_remove

/* * Remove a FD from the fd set */static int fpm_event_poll_remove(struct fpm_event_s *ev) /* {{{ */{	int i;	/* do we have a direct access */	if (ev->index >= 0 && ev->index < npollfds && pollfds[ev->index].fd == ev->fd) {		/* remember this slot as free */		next_free_slot = ev->index;		/* clear event in pollfds */		pollfds[ev->index].fd = -1;		pollfds[ev->index].events = 0;		/* mark the event as not registered */		ev->index = -1;		return 0;	}	/* let's search */	for (i = 0; i < npollfds; i++) {		if (pollfds[i].fd != ev->fd) {			/* not found */			continue;		}		/* remember this slot as free */		next_free_slot = i;		/* clear event in pollfds */		pollfds[i].fd = -1;		pollfds[i].events = 0;		/* mark the event as not registered */		ev->index = -1;		return 0;	}	zlog(ZLOG_ERROR, "poll: unable to remove event: not found (fd=%d, index=%d)", ev->fd, ev->index);	return -1;}
开发者ID:AxiosCros,项目名称:php-src,代码行数:46,


示例11: bgp_md5_set_socket

/* * Set MD5 key for the socket, for the given IPv4 peer address. * If the password is NULL or zero-length, the option will be disabled. */static intbgp_md5_set_socket (int socket, union sockunion *su, const char *password){  int ret = -1;  int en = ENOSYS;    assert (socket >= 0);  #if HAVE_DECL_TCP_MD5SIG    ret = sockopt_tcp_signature (socket, su, password);  en  = errno;#endif /* HAVE_TCP_MD5SIG */    if (ret < 0)    zlog (NULL, LOG_WARNING, "can't set TCP_MD5SIG option on socket %d: %s",          socket, safe_strerror (en));  return ret;}
开发者ID:FujitsuNetworkCommunications,项目名称:Quagga-Graceful-Restart,代码行数:23,


示例12: bgp_fsm_holdtime_expire

/* Hold timer expire.  This is error of BGP connection. So cut the   peer and change to Idle status. */static intbgp_fsm_holdtime_expire (struct peer *peer){  if (BGP_DEBUG (fsm, FSM))    zlog (peer->log, LOG_DEBUG, "%s [FSM] Hold timer expire", peer->host);  /* Send notify to remote peer. */  bgp_notify_send (peer, BGP_NOTIFY_HOLD_ERR, 0);  /* Sweep if it is temporary peer. */  if (CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))    {      zlog_info ("%s [Event] Accepting BGP peer is deleted", peer->host);      peer_delete (peer);      return -1;    }  return 0;}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:21,


示例13: bgp_start_timer

/* BGP start timer.  This function set BGP_Start event to thread value   and process event. */static intbgp_start_timer (struct thread *thread){  struct peer *peer;  peer = THREAD_ARG (thread);  peer->t_start = NULL;  UNSET_FLAG (peer->sflags, PEER_STATUS_CREATE_INIT);  if (BGP_DEBUG (fsm, FSM))    zlog (peer->log, LOG_DEBUG,	  "%s [FSM] Timer (start timer expire).", peer->host);  THREAD_VAL (thread) = BGP_Start;  bgp_event (thread);  return 0;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:21,


示例14: fpm_status_handle_status

/* return 0 if it's not the request page * return 1 if ouput has been set) * *output unchanged: error (return 500) * *output changed: no error (return 200) */int fpm_status_handle_status(char *uri, char *query_string, char **output, char **content_type) /* {{{ */{	struct fpm_status_s status;	if (!fpm_status_uri || !uri) {		return 0;	}	/* It's not the status page */	if (strcmp(fpm_status_uri, uri)) {		return 0;	}	if (!output || !content_type || !fpm_status_shm) {		return 1;	}	if (!fpm_status_shm->mem) {		return 1;	}	/* one shot operation */	status = *(struct fpm_status_s *)fpm_status_shm->mem;	if (status.idle < 0 || status.active < 0 || status.total < 0) {		return 1;	}	if (query_string && strstr(query_string, "html")) {		fpm_status_handle_status_html(&status, output, content_type);	} else if (query_string && strstr(query_string, "json")) {		fpm_status_handle_status_json(&status, output, content_type);	} else {		fpm_status_handle_status_txt(&status, output, content_type);	}	if (!*output || !content_type) {		zlog(ZLOG_ERROR, "[pool %s] unable to allocate status ouput buffer", fpm_status_pool);		return 1;	}	return 1;}
开发者ID:hholzgra,项目名称:glob-period,代码行数:48,


示例15: fpm_request_reading_headers

void fpm_request_reading_headers() /* {{{ */{	struct fpm_scoreboard_proc_s *proc;	struct timeval now;	clock_t now_epoch;#ifdef HAVE_TIMES	struct tms cpu;#endif	fpm_clock_get(&now);	now_epoch = time(NULL);#ifdef HAVE_TIMES	times(&cpu);#endif	proc = fpm_scoreboard_proc_acquire(NULL, -1, 0);	if (proc == NULL) {		zlog(ZLOG_WARNING, "failed to acquire proc scoreboard");		return;	}	proc->request_stage = FPM_REQUEST_READING_HEADERS;	proc->tv = now;	proc->accepted = now;	proc->accepted_epoch = now_epoch;#ifdef HAVE_TIMES	proc->cpu_accepted = cpu;#endif	proc->requests++;	proc->request_uri[0] = '/0';	proc->request_method[0] = '/0';	proc->script_filename[0] = '/0';	proc->query_string[0] = '/0';	proc->query_string[0] = '/0';	proc->auth_user[0] = '/0';	proc->content_length = 0;	fpm_scoreboard_proc_release(proc);	/* idle--, active++, request++ */	fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL);}
开发者ID:mdesign83,项目名称:php-src,代码行数:42,


示例16: fpm_request_accepting

void fpm_request_accepting() /* {{{ */{	struct fpm_scoreboard_proc_s *proc;	struct timeval now;	fpm_clock_get(&now);	proc = fpm_scoreboard_proc_acquire(NULL, -1, 0);	if (proc == NULL) {		zlog(ZLOG_WARNING, "failed to acquire proc scoreboard");		return;	}	proc->request_stage = FPM_REQUEST_ACCEPTING;	proc->tv = now;	fpm_scoreboard_proc_release(proc);	/* idle++, active-- */	fpm_scoreboard_update(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL);}
开发者ID:13572293130,项目名称:php-src,代码行数:20,


示例17: fpm_children_create_initial

int fpm_children_create_initial(struct fpm_worker_pool_s *wp) /* {{{ */{	if (wp->config->pm == PM_STYLE_ONDEMAND) {		wp->ondemand_event = (struct fpm_event_s *)malloc(sizeof(struct fpm_event_s));		if (!wp->ondemand_event) {			zlog(ZLOG_ERROR, "[pool %s] unable to malloc the ondemand socket event", wp->config->name);			// FIXME handle crash			return 1;		}		memset(wp->ondemand_event, 0, sizeof(struct fpm_event_s));		fpm_event_set(wp->ondemand_event, wp->listening_socket, FPM_EV_READ | FPM_EV_EDGE, fpm_pctl_on_socket_accept, wp);		wp->socket_event_set = 1;		fpm_event_add(wp->ondemand_event, 0);		return 1;	}	return fpm_children_make(wp, 0 /* not in event loop yet */, 0, 1);}
开发者ID:AllenJB,项目名称:php-src,代码行数:20,


示例18: fpm_event_devpoll_remove

/* * Remove a FD from the fd set */static int fpm_event_devpoll_remove(struct fpm_event_s *ev) /* {{{ */{	struct pollfd pollfd;	/* fill pollfd with the same informations as fpm_event_devpoll_add */	pollfd.fd = ev->fd;	pollfd.events = POLLIN | POLLREMOVE;	pollfd.revents = 0;	/* add the event to the internal queue */	if (write(dpfd, &pollfd, sizeof(struct pollfd)) != sizeof(struct pollfd)) {		zlog(ZLOG_ERROR, "/dev/poll: Unable to remove the event in the internal queue");		return -1;	}	/* mark the event as registered */	ev->index = -1;	return 0;}
开发者ID:AxiosCros,项目名称:php-src,代码行数:23,


示例19: fpm_event_kqueue_remove

/* * Remove a FD from the kevent queue */static int fpm_event_kqueue_remove(struct fpm_event_s *ev) /* {{{ */{	struct kevent k;	int flags = EV_DELETE;	if (ev->flags & FPM_EV_EDGE) {			flags = flags | EV_CLEAR;	}	EV_SET(&k, ev->fd, EVFILT_READ, flags, 0, 0, (void *)ev);	if (kevent(kfd, &k, 1, NULL, 0, NULL) < 0) {		zlog(ZLOG_ERROR, "kevent: unable to add event");		return -1;	}	/* mark the vent as not registered */	ev->index = -1;	return 0;}
开发者ID:SamuelDeal,项目名称:php-src,代码行数:23,


示例20: prefix_copy

/* Copy prefix from src to dest. */void prefix_copy(struct prefix *dest, const struct prefix *src){	dest->family = src->family;	dest->prefixlen = src->prefixlen;	if (src->family == AF_INET)		dest->u.prefix4 = src->u.prefix4;#ifdef HAVE_IPV6	else if (src->family == AF_INET6)		dest->u.prefix6 = src->u.prefix6;#endif /* HAVE_IPV6 */	else if (src->family == AF_UNSPEC) {		dest->u.lp.id = src->u.lp.id;		dest->u.lp.adv_router = src->u.lp.adv_router;	} else {		zlog(NULL, LOG_ERR, "prefix_copy(): Unknown address family %d",		     src->family);		assert(0);	}}
开发者ID:yubo,项目名称:quagga,代码行数:21,


示例21: fpm_sockets_resolve_af_inet

static int fpm_sockets_resolve_af_inet(char *node, char *service, struct sockaddr_in *addr) /* {{{ */{	struct addrinfo *res;	struct addrinfo hints;	int ret;	memset(&hints, 0, sizeof(hints));	hints.ai_family = AF_INET;	ret = getaddrinfo(node, service, &hints, &res);	if (ret != 0) {		zlog(ZLOG_ERROR, "can't resolve hostname '%s%s%s': getaddrinfo said: %s%s%s/n",					node, service ? ":" : "", service ? service : "",					gai_strerror(ret), ret == EAI_SYSTEM ? ", system error: " : "", ret == EAI_SYSTEM ? strerror(errno) : "");		return -1;	}	*addr = *(struct sockaddr_in *) res->ai_addr;	freeaddrinfo(res);	return 0;}
开发者ID:360weboy,项目名称:php-src,代码行数:21,


示例22: ospf_db_desc_timer

static intospf_db_desc_timer (struct thread *thread){  struct ospf_neighbor *nbr;  nbr = THREAD_ARG (thread);  nbr->t_db_desc = NULL;  if (IS_DEBUG_OSPF (nsm, NSM_TIMERS))    zlog (NULL, LOG_DEBUG, "NSM[%s:%s]: Timer (DD Retransmit timer expire)",	  IF_NAME (nbr->oi), inet_ntoa (nbr->src));  /* resent last send DD packet. */  assert (nbr->last_send);  ospf_db_desc_resend (nbr);  /* DD Retransmit timer set. */  OSPF_NSM_TIMER_ON (nbr->t_db_desc, ospf_db_desc_timer, nbr->v_db_desc);  return 0;}
开发者ID:AsherBond,项目名称:quagga,代码行数:21,


示例23: fpm_event_poll_add

/* * Add a FD to the fd set */static int fpm_event_poll_add(struct fpm_event_s *ev) /* {{{ */{	int i;	/* do we have a direct free slot */	if (pollfds[next_free_slot].fd == -1) {		/* register the event */		pollfds[next_free_slot].fd = ev->fd;		pollfds[next_free_slot].events = POLLIN;		/* remember the event place in the fd list and suppose next slot is free */		ev->index = next_free_slot++;		if (next_free_slot >= npollfds) {			next_free_slot = 0;		}		return 0;	}	/* let's search */	for (i = 0; i < npollfds; i++) {		if (pollfds[i].fd != -1) {			/* not free */			continue;		}		/* register the event */		pollfds[i].fd = ev->fd;		pollfds[i].events = POLLIN;		/* remember the event place in the fd list and suppose next slot is free */		ev->index = next_free_slot++;		if (next_free_slot >= npollfds) {			next_free_slot = 0;		}		return 0;	}	zlog(ZLOG_ERROR, "poll: not enought space to add event (fd=%d)", ev->fd);	return -1;}
开发者ID:AxiosCros,项目名称:php-src,代码行数:43,


示例24: netlink_talk

/* sendmsg() to netlink socket then recvmsg(). */static intnetlink_talk (struct nlmsghdr *n, struct nlsock *nl){  int status;  struct sockaddr_nl snl;  struct iovec iov = { (void *) n, n->nlmsg_len };  struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };  int save_errno;  memset (&snl, 0, sizeof snl);  snl.nl_family = AF_NETLINK;  n->nlmsg_seq = ++nl->seq;  /* Request an acknowledgement by setting NLM_F_ACK */  n->nlmsg_flags |= NLM_F_ACK;  if (IS_DEBUG_HA(kroute, KROUTE))    zlog_debug ("netlink_talk: %s type %s(%u), seq=%u", nl->name,               lookup (nlmsg_str, n->nlmsg_type), n->nlmsg_type,               n->nlmsg_seq);  /* Send message to netlink interface. */  status = sendmsg (nl->sock, &msg, 0);  save_errno = errno;  if (status < 0)    {      zlog (NULL, LOG_ERR, "netlink_talk sendmsg() error: %s",            safe_strerror (save_errno));      return -1;    }  /*    * Get reply from netlink socket.    * The reply should either be an acknowlegement or an error.   */  return netlink_parse_info (netlink_talk_filter, nl);}
开发者ID:rgmabs19357,项目名称:HA,代码行数:41,


示例25: bgp_routeadv_timer

static intbgp_routeadv_timer (struct thread *thread){  struct peer *peer;  peer = THREAD_ARG (thread);  peer->t_routeadv = NULL;  if (BGP_DEBUG (fsm, FSM))    zlog (peer->log, LOG_DEBUG,	  "%s [FSM] Timer (routeadv timer expire)",	  peer->host);  peer->synctime = bgp_clock ();  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);  BGP_TIMER_ON (peer->t_routeadv, bgp_routeadv_timer,		peer->v_routeadv);  return 0;}
开发者ID:ahouston,项目名称:quagga-multiple,代码行数:22,


示例26: bgp_bind

/* BGP socket bind. */intbgp_bind (struct peer *peer){#ifdef SO_BINDTODEVICE  int ret;  struct ifreq ifreq;  if (! peer->ifname)    return 0;  strncpy ((char *)&ifreq.ifr_name, peer->ifname, sizeof (ifreq.ifr_name));  ret = setsockopt (peer->fd, SOL_SOCKET, SO_BINDTODEVICE, 		    &ifreq, sizeof (ifreq));  if (ret < 0)    {      zlog (peer->log, LOG_INFO, "bind to interface %s failed", peer->ifname);      return ret;    }#endif /* SO_BINDTODEVICE */  return 0;}
开发者ID:AllardJ,项目名称:Tomato,代码行数:23,


示例27: fpm_socket_get_listening_queue

int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq){	struct tcp_info info;	socklen_t len = sizeof(info);	if (0 > getsockopt(sock, IPPROTO_TCP, TCP_INFO, &info, &len)) {		zlog(ZLOG_SYSERROR, "failed to retrieve TCP_INFO for socket");		return -1;	}#if defined(__FreeBSD__)	if (info.__tcpi_sacked == 0) {		return -1;	}	if (cur_lq) {		*cur_lq = info.__tcpi_unacked;	}	if (max_lq) {		*max_lq = info.__tcpi_sacked;	}#else	/* kernel >= 2.6.24 return non-zero here, that means operation is supported */	if (info.tcpi_sacked == 0) {		return -1;	}	if (cur_lq) {		*cur_lq = info.tcpi_unacked;	}	if (max_lq) {		*max_lq = info.tcpi_sacked;	}#endif	return 0;}
开发者ID:360weboy,项目名称:php-src,代码行数:38,


示例28: fpm_event_port_wait

/* * wait for events or timeout */static int fpm_event_port_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */{	int ret, i, nget;	timespec_t t;	/* convert timeout into timespec_t */	t.tv_sec = (int)(timeout / 1000);	t.tv_nsec = (timeout % 1000) * 1000 * 1000;	/* wait for inconming event or timeout. We want at least one event or timeout */	nget = 1;	ret = port_getn(pfd, events, nevents, &nget, &t);	if (ret < 0) {		/* trigger error unless signal interrupt or timeout */		if (errno != EINTR && errno != ETIME) {			zlog(ZLOG_WARNING, "poll() returns %d", errno);			return -1;		}	}	for (i = 0; i < nget; i++) {		/* do we have a ptr to the event ? */		if (!events[i].portev_user) {			continue;		}		/* fire the event */		fpm_event_fire((struct fpm_event_s *)events[i].portev_user);		/* sanity check */		if (fpm_globals.parent_pid != getpid()) {			return -2;		}	}	return nget;}
开发者ID:AxiosCros,项目名称:php-src,代码行数:41,



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


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