add: TRACE(("get_next_port_info(team = %ld)\n", team));
context: _get_next_port_info(team_id team, int32 *_cookie, struct port_info *info, size_t size){	cpu_status state;	int slot;	if (info == NULL || size != sizeof(port_info) || _cookie == NULL || team < B_OK)		return B_BAD_VALUE;	if (!sPortsActive)		return B_BAD_PORT_ID;	slot = *_cookie;	if (slot >= sMaxPorts)		return B_BAD_PORT_ID;	if (team == B_CURRENT_TEAM)		team = team_get_current_team_id();	info->port = -1; // used as found flag	// spinlock	state = disable_interrupts();	GRAB_PORT_LIST_LOCK();	while (slot < sMaxPorts) {		GRAB_PORT_LOCK(sPorts[slot]);		if (sPorts[slot].id != -1 && sPorts[slot].capacity != 0 && sPorts[slot].owner == team) {			// found one!			fill_port_info(&sPorts[slot], info, size);			RELEASE_PORT_LOCK(sPorts[slot]);			slot++;			break;		}		RELEASE_PORT_LOCK(sPorts[slot]);		slot++;	}	RELEASE_PORT_LIST_LOCK();	restore_interrupts(state);	if (info->port == -1)		return B_BAD_PORT_ID;	*_cookie = slot;	return B_NO_ERROR;}