rem: if (status == B_TIMED_OUT || status == B_WOULD_BLOCK)
add: if (status != B_OK)
context: port_buffer_size_etc(port_id id, uint32 flags, bigtime_t timeout){	cpu_status state;	sem_id cachedSem;	status_t status;	port_msg *msg;	ssize_t size;	int slot;	if (!sPortsActive || id < 0)		return B_BAD_PORT_ID;	slot = id % sMaxPorts;	state = disable_interrupts();	GRAB_PORT_LOCK(sPorts[slot]);	if (sPorts[slot].id != id) {		RELEASE_PORT_LOCK(sPorts[slot]);		restore_interrupts(state);		TRACE(("get_buffer_size_etc: invalid port_id %ld\n", id));		return B_BAD_PORT_ID;	}		cachedSem = sPorts[slot].read_sem;	RELEASE_PORT_LOCK(sPorts[slot]);	restore_interrupts(state);	// block if no message, or, if B_TIMEOUT flag set, block with timeout	status = acquire_sem_etc(cachedSem, 1, flags, timeout);	if (status == B_BAD_SEM_ID) {		// somebody deleted the port		return B_BAD_PORT_ID;	}	if (status == B_TIMED_OUT || status == B_WOULD_BLOCK)		return status;	state = disable_interrupts();	GRAB_PORT_LOCK(sPorts[slot]);	if (sPorts[slot].id != id) {		// the port is no longer there		RELEASE_PORT_LOCK(sPorts[slot]);		restore_interrupts(state);		return B_BAD_PORT_ID;	}	// determine tail & get the length of the message	msg = list_get_first_item(&sPorts[slot].msg_queue);	if (msg == NULL)		panic("port %ld: no messages found", sPorts[slot].id);	size = msg->size;	RELEASE_PORT_LOCK(sPorts[slot]);	restore_interrupts(state);	// restore read_sem, as we haven't read from the port	release_sem(cachedSem);	// return length of item at end of queue	return size;}