mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
Documentation: Remove all tail spaces from *.rst and *.html
by the below command:
find . -type f -name '*.rst' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Brennan Ashton
parent
a066186127
commit
598e3eedb4
@@ -90,12 +90,12 @@ Non-standard task control interfaces inspired by ``posix_spawn``:
|
||||
- :c:func:`task_spawnattr_getstacksize`
|
||||
- :c:func:`task_spawnattr_setstacksize`
|
||||
- :c:func:`posix_spawn_file_actions_init`
|
||||
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. c:function:: int task_create(char *name, int priority, int stack_size, main_t entry, char * const argv[])
|
||||
|
||||
|
||||
This function creates and activates a new task with a
|
||||
specified priority and returns its system-assigned ID.
|
||||
|
||||
@@ -127,16 +127,16 @@ Functions
|
||||
:param argv: A pointer to an array of input parameters. The array should
|
||||
be terminated with a NULL argv[] value. If no parameters are
|
||||
required, argv may be NULL.
|
||||
|
||||
|
||||
:return: the non-zero task ID of the new task or ERROR if memory is
|
||||
insufficient or the task cannot be created
|
||||
(```errno`` <#ErrnoAccess>`__ is not set).
|
||||
|
||||
**Defined in:** ``sched.h``
|
||||
|
||||
|
||||
**POSIX Compatibility:** This is a NON-POSIX interface. VxWorks provides
|
||||
the following similar interface:
|
||||
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
int taskSpawn(char *name, int priority, int options, int stackSize, FUNCPTR entryPt,
|
||||
@@ -240,7 +240,7 @@ Functions
|
||||
- Restart of the currently running task is not supported by NuttX.
|
||||
- The VxWorks description says that the ID, priority, etc. take the
|
||||
value that they had when the task was *terminated*.
|
||||
|
||||
|
||||
.. c:function:: int task_setcancelstate(int state, int *oldstate)
|
||||
|
||||
This function atomically sets
|
||||
@@ -305,7 +305,7 @@ Functions
|
||||
the functionality of ``pthread_testcancel()`` to tasks and supports use
|
||||
of ``task_delete()``.
|
||||
|
||||
.. c:function:: void exit(int code)
|
||||
.. c:function:: void exit(int code)
|
||||
.. c:function:: void _exit(int code)
|
||||
|
||||
.. #include <sched.h>
|
||||
@@ -793,7 +793,7 @@ Functions
|
||||
FAR const posix_spawn_file_actions_t *file_actions, \
|
||||
FAR const posix_spawnattr_t *attr, \
|
||||
FAR char * const argv[], FAR char * const envp[])
|
||||
|
||||
|
||||
The ``task_spawn()`` function will create a new, child
|
||||
task, where the entry point to the task is an address in memory.
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ Functions
|
||||
name. Differences from the full POSIX implementation include:
|
||||
|
||||
- The range of priority values for the POSIX call is 0 to 255.
|
||||
|
||||
|
||||
.. note:: Setting a task's priority to the same value has the similar effect
|
||||
to ``sched_yield()``: The task will be moved to after all other tasks
|
||||
with the same priority.
|
||||
with the same priority.
|
||||
|
||||
.. c:function:: int sched_getparam(pid_t pid, FAR struct sched_param *param)
|
||||
|
||||
|
||||
This function gets the scheduling priority of the task
|
||||
specified by pid.
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ Task Control Interfaces
|
||||
within the task group. Members of a task group share certain
|
||||
resources such as environment variables, file descriptors, ``FILE``
|
||||
streams, sockets, pthread keys and open message queues.
|
||||
|
||||
|
||||
- :c:func:`atexit`
|
||||
- :c:func:`on_exit`
|
||||
|
||||
.. note::
|
||||
|
||||
.. note::
|
||||
Behavior of features related to task group's depend of
|
||||
NuttX configuration settings. See the discussion of "Parent and
|
||||
Child Tasks," below. See also the\ `NuttX
|
||||
@@ -132,9 +132,9 @@ Functions
|
||||
|
||||
**POSIX Compatibility:** This is a NON-POSIX interface. VxWorks provides
|
||||
the comparable interface:
|
||||
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
|
||||
STATUS taskLock(void);
|
||||
|
||||
.. c:function:: int sched_unlock(void)
|
||||
@@ -147,10 +147,10 @@ Functions
|
||||
task will execute.
|
||||
|
||||
:return: OK or ERROR.
|
||||
|
||||
|
||||
**POSIX Compatibility:** This is a NON-POSIX interface. VxWorks provides
|
||||
the comparable interface:
|
||||
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
STATUS taskUnlock(void);
|
||||
@@ -168,7 +168,7 @@ Functions
|
||||
|
||||
.. c:function:: ipid_t waitpid(pid_t pid, int *stat_loc, int options)
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
The following discussion is a general description of the
|
||||
``waitpid()`` interface. However, as of this writing, the
|
||||
implementation of ``waitpid()`` is incomplete (but usable). If
|
||||
@@ -363,7 +363,7 @@ Functions
|
||||
the structure pointed to by ``info`` will be filled in by the system
|
||||
with the status of the process. The ``si_signo`` member will always be
|
||||
equal to ``SIGCHLD``.
|
||||
|
||||
|
||||
:return: If ``waitid()`` returns due to the change of state
|
||||
of one of its children, 0 is returned. Otherwise, -1 is returned and
|
||||
``errno`` is set to indicate the error.
|
||||
|
||||
@@ -308,7 +308,7 @@ page <https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and
|
||||
|
||||
**POSIX Compatibility:** Comparable to the POSIX interface of the same
|
||||
name.
|
||||
|
||||
|
||||
.. c:function:: int sem_timedwait(sem_t *sem, const struct timespec *abstime)
|
||||
|
||||
This function will lock the semaphore referenced by sem
|
||||
|
||||
@@ -128,7 +128,7 @@ Clocks and Timers
|
||||
return the pointer, ``buf``, provided by the caller. Otherwise, a NULL
|
||||
will be returned to indicate the error.
|
||||
|
||||
.. c:function:: FAR char *ctime_r(FAR const time_t *timep, FAR char *buf)
|
||||
.. c:function:: FAR char *ctime_r(FAR const time_t *timep, FAR char *buf)
|
||||
|
||||
Converts the time provided in seconds
|
||||
since the epoch to a string representation. ``ctime()`` is re-entrant.
|
||||
|
||||
@@ -19,7 +19,7 @@ time* signals by default. If the configuration option
|
||||
default actions dependent upon addition configuration settings as
|
||||
summarized in the following table:
|
||||
|
||||
======= ==================== =========================
|
||||
======= ==================== =========================
|
||||
Signal Action Additional Configuration
|
||||
======= ==================== =========================
|
||||
SIGUSR1 Abnormal Termination CONFIG_SIG_SIGUSR1_ACTION
|
||||
@@ -236,7 +236,7 @@ provided by NuttX:
|
||||
|
||||
:param signo: The signal number to act on
|
||||
|
||||
:return:
|
||||
:return:
|
||||
- Zero is returned upon successful completion, otherwise -1 (``ERROR``)
|
||||
is returned with the errno set appropriately. The ``errno`` value of
|
||||
``EINVAL``, for example, would indicate that ``signo`` argument is
|
||||
@@ -259,7 +259,7 @@ provided by NuttX:
|
||||
:param signo: The signal number to operate on
|
||||
:param disp: The new disposition of the signal
|
||||
|
||||
:return:
|
||||
:return:
|
||||
- Upon successful completion, ``sigset()`` will the previous
|
||||
disposition of the signal. Otherwise, ``SIG_ERR`` will be returned
|
||||
and ``errno`` set to indicate the error.
|
||||
@@ -279,7 +279,7 @@ provided by NuttX:
|
||||
|
||||
:param how: How the signal mask will be changed.
|
||||
- ``SIG_BLOCK`` The resulting set is the union of the current set and the signal set pointed to by the ``set`` input parameter.
|
||||
- ``SIG_UNBLOCK`` The resulting set is the intersection of the current set and the complement of the signal set pointed to by the ``set`` input parameter.
|
||||
- ``SIG_UNBLOCK`` The resulting set is the intersection of the current set and the complement of the signal set pointed to by the ``set`` input parameter.
|
||||
- ``SIG_SETMASK`` The resulting set is the signal set pointed to by the ``set`` input parameter.
|
||||
|
||||
:param set: Location of the new signal mask
|
||||
|
||||
@@ -828,7 +828,7 @@ No support for the following pthread interfaces is provided by NuttX:
|
||||
|
||||
- ``pthread_setspecific()`` may be called from a thread-specific data
|
||||
destructor function.
|
||||
|
||||
|
||||
.. c:function:: void *pthread_getspecific(pthread_key_t key)
|
||||
|
||||
The ``pthread_getspecific()`` function returns the value currently bound
|
||||
|
||||
@@ -45,12 +45,12 @@ Functions
|
||||
=========
|
||||
|
||||
.. c:function:: FAR char *getenv(const char *name)
|
||||
|
||||
|
||||
Searches the environment list for a string that matches
|
||||
the string pointed to by ``name``.
|
||||
|
||||
:param name: The name of the variable to find.
|
||||
|
||||
|
||||
:return:
|
||||
The value of the variable (read-only) or NULL on failure.
|
||||
|
||||
@@ -64,7 +64,7 @@ Functions
|
||||
|
||||
:param string: ``name=value`` string describing the environment setting to
|
||||
add/modify.
|
||||
|
||||
|
||||
:return: Zero on success.
|
||||
|
||||
.. c:function:: int clearenv(void)
|
||||
|
||||
@@ -410,13 +410,13 @@ Pipes and FIFOs
|
||||
.. c:function:: int pipe(int fd[2])
|
||||
|
||||
Creates a pair of file descriptors, pointing to a pipe inode,
|
||||
and places them in the array pointed to by ``fd``.
|
||||
and places them in the array pointed to by ``fd``.
|
||||
|
||||
:param fd: The user provided array in which to catch the pipe file
|
||||
descriptors. ``fd[0]`` is for reading, ``fd[1]`` is for writing.
|
||||
|
||||
:return: 0 is returned on success; otherwise, -1 is returned with errno set appropriately.
|
||||
|
||||
:return: 0 is returned on success; otherwise, -1 is returned with errno set appropriately.
|
||||
|
||||
.. c:function:: int mkfifo(FAR const char *pathname, mode_t mode);
|
||||
|
||||
mkfifo() makes a FIFO device driver file with name pathname. Unlike Linux,
|
||||
@@ -426,7 +426,7 @@ Pipes and FIFOs
|
||||
Once the FIFO has been created by mkfifo(), any thread can open it for reading
|
||||
or writing, in the same way as an ordinary file. However, it must have been
|
||||
opened from both reading and writing before input or output can be performed.
|
||||
This FIFO implementation will block all attempts to open a FIFO read-only
|
||||
This FIFO implementation will block all attempts to open a FIFO read-only
|
||||
until at least one thread has opened the FIFO for writing.
|
||||
|
||||
If all threads that write to the FIFO have closed, subsequent calls to
|
||||
@@ -436,7 +436,7 @@ Pipes and FIFOs
|
||||
create (if not already created).
|
||||
:param mode: Ignored for now
|
||||
|
||||
:return: 0 is returned on success; otherwise, -1 is returned with errno set appropriately.
|
||||
:return: 0 is returned on success; otherwise, -1 is returned with errno set appropriately.
|
||||
|
||||
``mmap()`` and eXecute In Place (XIP)
|
||||
-------------------------------------
|
||||
@@ -524,7 +524,7 @@ are two conditions where ``mmap()`` can be supported:
|
||||
|
||||
.. c:function:: FAR void *mmap(FAR void *start, size_t length, int prot, int flags, int fd, off_t offset);
|
||||
|
||||
Provides minimal mmap() as needed to support eXecute In Place (XIP) operation (as described above).
|
||||
Provides minimal mmap() as needed to support eXecute In Place (XIP) operation (as described above).
|
||||
|
||||
:param start: A hint at where to map the memory -- ignored. The address
|
||||
of the underlying media is fixed and cannot be re-mapped without MMU
|
||||
|
||||
@@ -28,7 +28,7 @@ the following paragraphs.
|
||||
:param type: (see sys/socket.h)
|
||||
:param protocol: (see sys/socket.h)
|
||||
|
||||
:return:
|
||||
:return:
|
||||
0 on success; -1 on error with
|
||||
``errno`` set appropriately:
|
||||
|
||||
@@ -278,7 +278,7 @@ the following paragraphs.
|
||||
|
||||
|
||||
.. c:function:: ssize_t recv(int sockfd, void *buf, size_t len, int flags);
|
||||
|
||||
|
||||
The ``recv()`` call is identical to
|
||||
```recvfrom()`` <#recvfrom>`__ with a NULL ``from`` parameter.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ memory interfaces:
|
||||
- :c:func:`shmat`
|
||||
- :c:func:`shmctl`
|
||||
- :c:func:`shmdt`
|
||||
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
@@ -83,7 +83,7 @@ Functions
|
||||
because user and group IDs are not yet supported by NuttX.
|
||||
|
||||
.. c:function:: void *shmat(int shmid, FAR const void *shmaddr, int shmflg)
|
||||
|
||||
|
||||
Attaches the shared memory
|
||||
segment associated with the shared memory identifier specified by
|
||||
``shmid`` to the address space of the calling process. The segment is
|
||||
@@ -199,4 +199,4 @@ Functions
|
||||
|
||||
- ``EINVAL``. The value of ``shmaddr`` is not the data segment start
|
||||
address of a shared memory segment.
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ Porting Guide <NuttxPortingGuide.html#configandbuild>`__.
|
||||
:maxdepth: 1
|
||||
:caption: Contents
|
||||
:glob:
|
||||
|
||||
|
||||
*_*
|
||||
structures.rst
|
||||
|
||||
@@ -38,8 +38,8 @@ Access to the ``errno`` Variable
|
||||
A pointer to the thread-specific ``errno`` value is available through a
|
||||
function call:
|
||||
|
||||
.. c:function:: int *__errno(void)
|
||||
|
||||
.. c:function:: int *__errno(void)
|
||||
|
||||
``__errno()`` returns a pointer to the thread-specific
|
||||
``errno`` value. Note that the symbol ``errno`` is defined to be
|
||||
``__errno()`` so that the usual access by referencing the symbol
|
||||
@@ -66,7 +66,7 @@ User Interface Structures
|
||||
.. c:type:: int (*main_t)(int argc, char *argv[])
|
||||
|
||||
:c:type:`main_t` defines the type of a task entry point. :c:type:`main_t` is declared in
|
||||
``sys/types.h``.
|
||||
``sys/types.h``.
|
||||
|
||||
.. c:struct:: sched_param
|
||||
|
||||
|
||||
Reference in New Issue
Block a user