* tcb - TCB of task
*
* Return:
- * OK on success; ERROR on failure (errno is not set)
+ * OK on success; ERROR on failure.
+ * errno is set as EBUSY, if already CONFIG_MAX_TASKS are running in system
*
****************************************************************************/
*/
(void)sched_unlock();
+ set_errno(EBUSY);
trace_end(TTRACE_TAG_TASK);
return ERROR;
}
* Return Value:
* OK on success; ERROR on failure.
*
- * This function can only failure is it is unable to assign a new, unique
- * task ID to the TCB (errno is not set).
+ * This function can fail for two reasons.
+ * 1) If requested priority is beyond the allowed range, errno = EINVAL
+ * 2) If it is unable to assign a new, unique task ID to the TCB. errno = EBUSY
+ * errno is set accodingly.
*
****************************************************************************/
* Return Value:
* OK on success; ERROR on failure.
*
- * This function can only failure is it is unable to assign a new, unique
- * task ID to the TCB (errno is not set).
+ * This function can fail for two reasons.
+ * 1) If requested priority is beyond the allowed range, errno = EINVAL
+ * 2) If it is unable to assign a new, unique task ID to the TCB. errno = EBUSY
+ * errno is set accodingly.
*
****************************************************************************/
* Return Value:
* OK on success; ERROR on failure.
*
- * This function can only failure is it is unable to assign a new, unique
- * task ID to the TCB (errno is not set).
+ * This function can fail for two reasons.
+ * 1) If requested priority is beyond the allowed range, errno = EINVAL
+ * 2) If it is unable to assign a new, unique task ID to the TCB. errno = EBUSY
+ * errno is set accodingly.
*
****************************************************************************/