change log for rtems (2011-01-10)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon Jan 10 17:12:00 UTC 2011


 *joel*:
2011-01-10	Danila Bespalov <danila DOT bespalov AT gmail DOT com>

	* posix_users/posix_users.texi, posix_users/signal.t: Review and
	improve as part of Google Code-In 2010.

M  1.295  doc/ChangeLog
M   1.19  doc/posix_users/posix_users.texi
M    1.8  doc/posix_users/signal.t

diff -u rtems/doc/ChangeLog:1.294 rtems/doc/ChangeLog:1.295
--- rtems/doc/ChangeLog:1.294	Sun Jan  2 10:12:02 2011
+++ rtems/doc/ChangeLog	Mon Jan 10 10:14:07 2011
@@ -1,3 +1,8 @@
+2011-01-10	Danila Bespalov <danila DOT bespalov AT gmail DOT com>
+
+	* posix_users/posix_users.texi, posix_users/signal.t: Review and
+	improve as part of Google Code-In 2010.
+
 2011-01-02	Danila Bespalov <danila DOT bespalov AT gmail DOT com>
 
 	* started/buildc.t, started/buildrt.t, started/nt.t, started/require.t,

diff -u rtems/doc/posix_users/posix_users.texi:1.18 rtems/doc/posix_users/posix_users.texi:1.19
--- rtems/doc/posix_users/posix_users.texi:1.18	Thu Jun 21 13:53:00 2007
+++ rtems/doc/posix_users/posix_users.texi	Mon Jan 10 10:14:07 2011
@@ -16,7 +16,7 @@
 @c
 
 @c
- at c   Master file for the C User's Guide
+ at c   Master file for the POSIX API User's Guide
 @c
 
 @c Joel's Questions
@@ -43,7 +43,7 @@
 @c       in the infrastructure Florist support should be simple to add.
 @set is-C
 @clear is-Ada
- at set LANGUAGE C 
+ at set LANGUAGE C
 @set STRUCTURE structure
 @set ROUTINE function
 @set OR |
@@ -63,7 +63,7 @@
 @c @shorttitlepage RTEMS POSIX API User's Guide
 
 @setchapternewpage odd
- at settitle RTEMS POSIX API User's Guide 
+ at settitle RTEMS POSIX API User's Guide
 @titlepage
 @finalout
 
@@ -139,8 +139,8 @@
 @end menu
 
 @end ifinfo
- at c 
- at c 
+ at c
+ at c
 @c Need to copy the emacs stuff and "trailer stuff" (index, toc) into here
 @c
 

diff -u rtems/doc/posix_users/signal.t:1.7 rtems/doc/posix_users/signal.t:1.8
--- rtems/doc/posix_users/signal.t:1.7	Fri Jan  9 17:39:14 2004
+++ rtems/doc/posix_users/signal.t	Mon Jan 10 10:14:07 2011
@@ -56,8 +56,9 @@
 the signal or explicitly checks for it.
 Traditional, non-real-time POSIX signals do not queue.  Thus
 if a process or thread has blocked a particular signal, then
-multiple occurrences of that signal are recorded as a 
-single occurrence of that signal.  
+multiple occurrences of that signal are recorded as a
+single occurrence of that signal.
+ at c TODO: SIGRTMIN and SIGRTMAX ?
 
 One can check for the set of outstanding signals that have been
 blocked.   Services are provided to check for outstanding process
@@ -102,22 +103,22 @@
 Each process and each thread within that process has a set of
 individual signals and handlers associated with it.   Services
 are provided to construct signal sets for the purposes of building
-signal sets -- type @code{sigset_t} -- that are used to 
-provide arguments to the services that mask, unmask, and 
+signal sets -- type @code{sigset_t} -- that are used to
+provide arguments to the services that mask, unmask, and
 check on pending signals.
 
 @subsection Blocking Until Signal Generation
 
 A thread may block until receipt of a signal.  The "sigwait"
-and "pause" families of services block until the requested
-signal is received or if using @code{sigtimedwait()} until the specified 
+and "pause" families of functions block until the requested
+signal is received or if using @code{sigtimedwait()} until the specified
 timeout period has elapsed.
 
 @subsection Sending a Signal
 
 This is accomplished
-via one of a number of services that sends a signal to either a 
-process or thread.  Signals may be directed at a process by 
+via one of a number of services that sends a signal to either a
+process or thread.  Signals may be directed at a process by
 the service @code{kill()} or at a thread by the service
 @code{pthread_kill()}
 
@@ -150,6 +151,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 @item EINVAL
 Invalid argument passed.
@@ -158,11 +162,12 @@
 
 @subheading DESCRIPTION:
 
-This function adds the @code{signo} to the specified signal @code{set}.
+This function adds the signal @code{signo} to the specified signal @code{set}.
 
 @subheading NOTES:
 
-NONE
+The set must be initialized using either @code{sigemptyset} or @code{sigfillset}
+before using this function.
 
 @c
 @c
@@ -186,6 +191,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 @item EINVAL
 Invalid argument passed.
@@ -194,11 +202,13 @@
 
 @subheading DESCRIPTION:
 
-This function deletes the @code{signo} to the specified signal @code{set}.
+This function deletes the signal specified by @code{signo} from the specified
+signal @code{set}.
 
 @subheading NOTES:
 
-NONE
+The set must be initialized using either @code{sigemptyset} or @code{sigfillset}
+before using this function.
 
 @c
 @c
@@ -221,8 +231,10 @@
 
 @subheading STATUS CODES:
 
- at table @b
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
 
+ at table @b
 @item EINVAL
 Invalid argument passed.
 
@@ -233,10 +245,6 @@
 This function fills the specified signal @code{set} such that all
 signals are set.
 
- at subheading NOTES:
-
-NONE
-
 @c
 @c
 @c
@@ -259,6 +267,10 @@
 
 @subheading STATUS CODES:
 
+The function returns either 1 or 0 if completed successfully, otherwise it
+returns -1 and sets @code{errno} to indicate the error. @code{errno} may be set
+to:
+
 @table @b
 
 @item EINVAL
@@ -273,7 +285,8 @@
 
 @subheading NOTES:
 
-NONE
+The set must be initialized using either @code{sigemptyset} or @code{sigfillset}
+before using this function.
 
 @c
 @c
@@ -296,8 +309,10 @@
 
 @subheading STATUS CODES:
 
- at table @b
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
 
+ at table @b
 @item EINVAL
 Invalid argument passed.
 
@@ -305,12 +320,7 @@
 
 @subheading DESCRIPTION:
 
-This function fills the specified signal @code{set} such that all
-signals are cleared.
-
- at subheading NOTES:
-
-NONE
+This function initializes an empty signal set pointed to by @code{set}.
 
 @c
 @c
@@ -335,6 +345,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 @item EINVAL
 Invalid argument passed.
@@ -346,10 +359,71 @@
 
 @subheading DESCRIPTION:
 
-This function is used to change the action taken by a process on
-receipt of the specfic signal @code{sig}. The new action is
-specified by @code{act} and the previous action is returned
-via @code{oact}.
+If the argument act is not a null pointer, it points to a structure specifying
+the action to be associated with the specified signal. If the argument oact is
+not a null pointer, the action previously associated with the signal is stored
+in the location pointed to by the argument oact. If the argument act is a null
+pointer, signal handling is unchanged; thus, the call can be used to enquire
+about the current handling of a given signal.
+
+The structure @code{sigaction} has the following members:
+
+ at table @code
+
+ at item void(*)(int) sa_handler
+Pointer to a signal-catching function or one of the macros SIG_IGN or SIG_DFL.
+
+ at item sigset_t sa_mask
+Additional set of signals to be blocked during execution of signal-catching function.
+
+ at item int sa_flags
+Special flags to affect behavior of signal.
+
+ at item void(*)(int, siginfo_t*, void*) sa_sigaction
+Alternative pointer to a signal-catching function.
+
+ at end table
+
+ at code{sa_handler} and @code{sa_sigaction} should never be used at the same time as their storage may overlap.
+
+If the @code{SA_SIGINFO} flag (see below) is set in @code{sa_flags}, the
+ at code{sa_sigaction} field specifies a signal-catching function, otherwise
+ at code{sa_handler} specifies the action to be associated with the signal, which
+may be a signal-catching function or one of the macros @code{SIG_IGN} or
+ at code{SIG_DFN}.
+
+The following flags can be set in the @code{sa_flags} field:
+
+ at table @code
+
+ at c I found no evidence that other flags are used in the source code.
+ at c I did a fulltext search in cpukit/posix/, maybe I looked in the wrong place?
+ at item SA_SIGINFO
+If not set, the signal-catching function should be declared as @code{void
+func(int signo)} and the address of the function should be set in
+ at code{sa_handler}.  If set, the signal-catching function should be declared as
+ at code{void func(int signo, siginfo_t* info, void* context)} and the address of
+the function should be set in @code{sa_sigaction}.
+
+ at end table
+
+The prototype of the @code{siginfo_t} structure is the following:
+ at example
+typedef struct
+@{
+  int si_signo; /* Signal number */
+  int si_code; /* Cause of the signal */
+  pid_t si_pid; /* Sending process ID */
+  uid_t si_uid; /* Real user ID of sending process */
+  void* si_addr; /* Address of faulting instruction */
+  int si_status; /* Exit value or signal */
+  union sigval
+  @{
+      int sival_int; /* Integer signal value */
+      void* sival_ptr; /* Pointer signal value */
+  @} si_value; /* Signal value */
+@}
+ at end example
 
 @subheading NOTES:
 
@@ -377,6 +451,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 
 @item ESRCH
@@ -389,11 +466,11 @@
 
 @subheading DESCRIPTION:
 
-This functions sends the specified signal @code{sig} to @code{thread}.
+This functions sends the specified signal @code{sig} to a thread referenced
+to by @code{thread}.
 
- at subheading NOTES:
+If the signal code is @code{0}, arguments are validated and no signal is sent.
 
-NONE
 
 @c
 @c
@@ -418,6 +495,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 
 @item EINVAL
@@ -447,13 +527,17 @@
 
 @end table
 
-If @code{oset} is not @code{NULL}, then the set of blocked signals
-prior to this call is returned in @code{oset}.
+If @code{oset} is not @code{NULL}, then the set of blocked signals prior to
+this call is returned in @code{oset}. If @code{set} is @b{NULL}, no change is
+done, allowing to examine the set of currently blocked signals.
 
 @subheading NOTES:
 
 It is not an error to unblock a signal which is not blocked.
 
+In the current implementation of RTEMS POSIX API sigprocmask() is technically
+mapped to pthread_sigmask().
+
 @c
 @c
 @c
@@ -476,7 +560,12 @@
 @end example
 
 @subheading STATUS CODES:
+
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
+
 @item EINVAL
 Invalid argument passed.
 
@@ -503,8 +592,9 @@
 
 @end table
 
-If @code{oset} is not @code{NULL}, then the set of blocked signals
-prior to this call is returned in @code{oset}.
+If @code{oset} is not @code{NULL}, then the set of blocked signals prior to
+this call is returned in @code{oset}. If @code{set} is @b{NULL}, no change is
+done, allowing to examine the set of currently blocked signals.
 
 @subheading NOTES:
 
@@ -533,6 +623,10 @@
 @end example
 
 @subheading STATUS CODES:
+
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 @item EINVAL
 Invalid argument passed.
@@ -551,7 +645,8 @@
 
 @subheading NOTES:
 
-NONE
+Since RTEMS is a single-process system, a signal can only be sent to the calling
+process (i.e. the current node).
 
 @c
 @c
@@ -574,8 +669,8 @@
 
 @subheading STATUS CODES:
 
-On error, this routine returns -1 and sets @code{errno} to one of
-the following:
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
 
 @table @b
 
@@ -590,10 +685,6 @@
 signals. A pending signal is one which has been raised but is currently
 blocked. The set of pending signals is returned in @code{set}.
 
- at subheading NOTES:
-
-NONE
-
 @c
 @c
 @c
@@ -615,8 +706,8 @@
 
 @subheading STATUS CODES:
 
-On error, this routine returns -1 and sets @code{errno} to one of
-the following:
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
 
 @table @b
 
@@ -629,11 +720,7 @@
 
 This function temporarily replaces the signal mask for the process
 with that specified by @code{sigmask} and blocks the calling thread
-until the signal is raised.
-
- at subheading NOTES:
-
-NONE
+until a signal is raised.
 
 @c
 @c
@@ -654,8 +741,8 @@
 
 @subheading STATUS CODES:
 
-On error, this routine returns -1 and sets @code{errno} to one of
-the following:
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
 
 @table @b
 
@@ -669,10 +756,6 @@
 This function causes the calling thread to be blocked until an
 unblocked signal is received.
 
- at subheading NOTES:
-
-NONE
-
 @c
 @c
 @c
@@ -694,7 +777,12 @@
 @end example
 
 @subheading STATUS CODES:
+
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
+
 @item EINVAL
 Invalid argument passed.
 
@@ -709,11 +797,6 @@
 @code{set}, atomically clears it from the set of pending signals, and
 returns the signal number for that signal in @code{sig}.
 
-
- at subheading NOTES:
-
-NONE
-
 @c
 @c
 @c
@@ -735,7 +818,12 @@
 @end example
 
 @subheading STATUS CODES:
+
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
+
 @item EINTR
 Signal interrupted this function.
 
@@ -747,9 +835,23 @@
 @code{set}, atomically clears it from the set of pending signals, and
 returns information about that signal in @code{info}.
 
- at subheading NOTES:
-
-NONE
+The prototype of the @code{siginfo_t} structure is the following:
+ at example
+typedef struct
+@{
+  int si_signo; /* Signal number */
+  int si_code; /* Cause of the signal */
+  pid_t si_pid; /* Sending process ID */
+  uid_t si_uid; /* Real user ID of sending process */
+  void* si_addr; /* Address of faulting instruction */
+  int si_status; /* Exit value or signal */
+  union sigval
+  @{
+      int sival_int; /* Integer signal value */
+      void* sival_ptr; /* Pointer signal value */
+  @} si_value; /* Signal value */
+@}
+ at end example
 
 @c
 @c
@@ -773,7 +875,12 @@
 @end example
 
 @subheading STATUS CODES:
+
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
+
 @item EAGAIN
 Timed out while waiting for the specified signal set.
 
@@ -792,6 +899,15 @@
 returns information about that signal in @code{info}. The calling thread
 will block up to @code{timeout} waiting for the signal to arrive.
 
+The @code{timespec} structure is defined as follows:
+ at example
+struct timespec
+@{
+  time_t tv_sec; /* Seconds */
+  long tv_nsec; /* Nanoseconds */
+@}
+ at end example
+
 @subheading NOTES:
 
 If @code{timeout} is NULL, then the calling thread will wait forever for
@@ -820,6 +936,9 @@
 
 @subheading STATUS CODES:
 
+The function returns 0 on success, otherwise it returns -1 and sets
+ at code{errno} to indicate the error. @code{errno} may be set to:
+
 @table @b
 
 @item EAGAIN
@@ -845,9 +964,19 @@
 This function sends the signal specified by @code{signo} to the
 process @code{pid}
 
+The @code{sigval} union is specified as:
+ at example
+union sigval
+@{
+  int sival_int; /* Integer signal value */
+  void* sival_ptr; /* Pointer signal value */
+@}
+ at end example
+
 @subheading NOTES:
 
-NONE
+Since RTEMS is a single-process system, a signal can only be sent to the calling
+process (i.e. the current node).
 
 @c
 @c
@@ -886,7 +1015,7 @@
 @subheading NOTES:
 
 Alarm requests do not queue.  If @code{alarm} is called while
-a previous request is outstanding, the call will result in 
+a previous request is outstanding, the call will result in
 rescheduling the time at which the @code{SIGALRM} signal
 will be generated.
 
@@ -936,7 +1065,7 @@
 @subheading NOTES:
 
 Alarm requests do not queue.  If @code{alarm} is called while
-a previous request is outstanding, the call will result in 
+a previous request is outstanding, the call will result in
 rescheduling the time at which the @code{SIGALRM} signal
 will be generated.
 



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110110/fc970973/attachment.html>


More information about the vc mailing list