src/libruntime/mailbox.c
/**
 * @todo TODO: provide a detailed description for this function.
 */
@todo TODO: provide a detailed description for this function.
@todo TODO : provide a detailed description for this function .
int nanvix_mailbox_unlink(int mbxid)
{
	if (!nanvix_mailbox_is_valid(mbxid))
		return (-EINVAL);
	if (!nanvix_mailbox_is_used(mbxid))
		return (-EINVAL);
	if (mailboxes[mbxid].owner != knode_get_num())
		return (-EPERM);
	if (nanvix_mailbox_is_wronly(mbxid))
		return (-EINVAL);
	if (name_unlink(mailboxes[mbxid].name) != 0)
		return (-EAGAIN);
	nanvix_mailbox_free(mbxid);
	return (0);
}
int nanvix_mailbox_unlink ( int mbxid ) { if ( ! nanvix_mailbox_is_valid ( mbxid ) ) return ( - EINVAL ) ; if ( ! nanvix_mailbox_is_used ( mbxid ) ) return ( - EINVAL ) ; if ( mailboxes [ mbxid ] . owner != knode_get_num ( ) ) return ( - EPERM ) ; if ( nanvix_mailbox_is_wronly ( mbxid ) ) return ( - EINVAL ) ; if ( name_unlink ( mailboxes [ mbxid ] . name ) != 0 ) return ( - EAGAIN ) ; nanvix_mailbox_free ( mbxid ) ; return ( 0 ) ; }
@todo TODO: provide a detailed description for this function.
@todo TODO : provide a detailed description for this function .
/* Invalid mailbox ID.*/ /* Bad mailbox. */ /* Not the owner. */ /*  Invalid mailbox. */ /* Unlink name. */