From 2ab10a107f0f488ac64df683e6409cb082e39aca Mon Sep 17 00:00:00 2001
From: patacongo
Gregory Nutt
-Last Update: December 10, 2007
+Last Update: Februrary 2, 2008
OK, or ERROR if the task cannot be initialized. This function can only failure is it is unable to assign
- a new, unique task ID to the TCB (errno is not set).1.0 Introduction
@@ -62,9 +62,15 @@ Gregory Nutt
Section 3.0, OS Data Structures:
This section documents the data structures that are used at the NuttX
interface.
+
+
errno
Variableerrno
is not set).
errno
is not set).
Assumptions/Limitations: @@ -348,7 +354,7 @@ task_init argument).
Returned Values:
errno
is not set).
@@ -399,7 +405,7 @@ zero signifies the calling task. Returned Values:
errno
is not set)
@@ -613,7 +619,7 @@ Compatible with the POSIX interface of the same name.
Returned Values:
On success, sched_setparam() returns 0 (OK).
- On error, -1 (ERROR) is returned, anderrno
is set appropriately.
+ On error, -1 (ERROR) is returned, and errno
is set appropriately.
Returned Values:
On success, sched_setscheduler() returns OK (zero). On
- error, ERROR (-1) is returned, anderrno
is set appropriately:
+ error, ERROR (-1) is returned, and errno
is set appropriately:
errno
is set appropriately:
+ On error, ERROR (-1) is returned, and errno
is set appropriately:
errno
.
Returned Values:
On success, sched_rr_get_interval() returns OK (0). On
- error, ERROR (-1) is returned, anderrno
is set to:
+ error, ERROR (-1) is returned, and errno
is set to:
Returned Values:
On success, mq_send()
returns 0 (OK
);
- on error, -1 (ERROR
) is returned, with errno
set
+ on error, -1 (ERROR
) is returned, with errno
set
to indicate the error:
Returned Values:
On success, mq_send()
returns 0 (OK
);
- on error, -1 (ERROR
) is returned, with errno
set
+ on error, -1 (ERROR
) is returned, with errno
set
to indicate the error:
Returned Values:.
One success, the length of the selected message in bytes is returned.
- On failure, -1 (ERROR
) is returned and the errno
is set appropriately:
+ On failure, -1 (ERROR
) is returned and the errno
is set appropriately:
Returned Values:.
One success, the length of the selected message in bytes is returned.
- On failure, -1 (ERROR
) is returned and the errno
is set appropriately:
+ On failure, -1 (ERROR
) is returned and the errno
is set appropriately:
If sem_wait returns -1 (ERROR) then the cause of the failure
-will be indicated by the thread-specific errno value (a pointer
-to this value can be obtained using get_errno_ptr()). The following
-lists the possible values for errno:
+will be indicated by the thread-specific errno
.
+The following lists the possible values for errno
:
errno
.
+The following lists the possible values for errno
:
timer_create()
will return 0 (OK
) and update the
location referenced by timerid
to a timer_t
, which can be passed to the
other per-thread timer calls. If an error occurs, the function will return
- a value of -1 (ERROR
) and seterrno
to indicate the error.
+ a value of -1 (ERROR
) and set errno
to indicate the error.
EAGAIN
. The system lacks sufficient signal queuing resources to honor the
@@ -2570,7 +2574,8 @@ VxWorks provides the following comparable interface:
If successful, the timer_delete() function will return zero (OK).
- Otherwise, the function will return a value of -1 (ERROR) and seterrno
to indicate the error:
+ Otherwise, the function will return a value of -1 (ERROR) and set
+ errno
to indicate the error:
EINVAL
. The timer specified timerid is not valid.
If the timer_gettime() succeeds, a value of 0 (OK) will be returned.
- If an error occurs, the value -1 (ERROR) will be returned, anderrno
set to indicate the error.
+ If an error occurs, the value -1 (ERROR) will be returned, and
+ errno
set to indicate the error.
EINVAL
. The timerid argument does not correspond to an ID returned by timer_create() but not yet deleted by timer_delete().errno
is set appropriately.
+ On error, -1 (ERROR) is returned, and errno
is set appropriately.
EGAIN
. The limit of signals which may be queued has been reached.EINVAL
. signo was invalid.
Returned Values:
- 0 on success; -1 on error witherrno
set appropriately:
+ 0 on success; -1 on error with errno
set appropriately:
EACCES
.
@@ -5906,7 +5912,7 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
- 0 on success; -1 on error witherrno
set appropriately:
+ 0 on success; -1 on error with errno
set appropriately:
EACCES
@@ -5961,7 +5967,7 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
- 0 on success; -1 on error witherrno
set appropriately:
+ 0 on success; -1 on error with errno
set appropriately:
EACCES
or EPERM:
The user tried to connect to a broadcast address without having the
@@ -6028,7 +6034,8 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
- On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
+ On success, zero is returned. On error, -1 is returned, and
+ errno
is set appropriately.
EADDRINUSE
: Another socket is already listening on the same port.
Returned Values:
- On success, returns the number of characters sent. On error, -1 is returned, anderrno
is set appropriately:
+ On success, returns the number of characters sent. On error, -1 is returned,
+ and errno
is set appropriately:
EAGAIN
or EWOULDBLOCK
.
@@ -6284,7 +6292,7 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
On success, returns the number of characters sent.
- On error, -1 is returned, and errno is set appropriately:
+ On error, -1 is returned, and errno
is set appropriately:
EAGAIN
.
@@ -6348,7 +6356,7 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
On success, returns the number of characters sent.
- On error, -1 is returned, and errno is set appropriately:
+ On error, -1 is returned, and errno
is set appropriately:
BADF
.
@@ -6411,7 +6419,7 @@ Those socket APIs are discussed in the following paragraphs.
Returned Values:
On success, returns the number of characters sent.
- On error, -1 is returned, and errno is set appropriately:
+ On error, -1 is returned, and errno
is set appropriately:
BADF
.
@@ -6428,8 +6436,8 @@ Those socket APIs are discussed in the following paragraphs.
Many of the types used to communicate with NuttX are simple scalar types. These types are used to provide architecture independence @@ -6443,7 +6451,7 @@ interface include:
Several of the types used to interface with NuttX are structures that are intended to be hidden from the application. @@ -6458,37 +6466,47 @@ OS resources. These hidden structures include:
-In order to maintain portability, applications should not reference -specific elements within these hidden structures. These hidden -structures will not be described further in this user's manual. + In order to maintain portability, applications should not reference + specific elements within these hidden structures. These hidden + structures will not be described further in this user's manual. +
-
errno
Variable
-A pointer to the thread-specific errno. value is available through a
-function call:
+ A pointer to the thread-specific errno
value is available through a
+ function call:
+
-Function Prototype: + Function Prototype:
-
int *get_errno_ptr( void )+
#include+ #define errno *get_errno_ptr() + int *get_errno_ptr( void )
-Description: osGetErrnorPtr() returns a pointer to
-the thread-specific errno value.
+ Description:
+ get_errno_ptr()
returns a pointer to the thread-specific errno
value.
+ Note that the symbol errno
is defined to be get_errno_ptr()
so that the usual
+ access by referencing the symbol errno
will work as expected.
+
-This differs somewhat from the use forerrno
in a multi-threaded process environment:
-Each pthread will have its own private copy oferrno
and theerrno
will not be shared
-between pthreads.
+ There is a unique, private errno
value for each NuttX task.
+ However, the implementation of errno
differs somewhat from the use of
+ errno
in most multi-threaded process environments:
+ In NuttX, each pthread will also have its own private copy of errno
and the
+ errno
will not be shared between pthreads.
+ This is, perhaps, non-standard but promotes better thread independence.
Input Parameters: None
Returned Values:
errno
value.
-