~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/signal.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
 
158
158
   The old values are returned as a tuple: (delay, interval).
159
159
 
160
 
   Attempting to pass an invalid interval timer will cause a
161
 
   :exc:`ItimerError`.
 
160
   Attempting to pass an invalid interval timer will cause an
 
161
   :exc:`ItimerError`.  Availability: Unix.
162
162
 
163
163
   .. versionadded:: 2.6
164
164
 
166
166
.. function:: getitimer(which)
167
167
 
168
168
   Returns current value of a given interval timer specified by *which*.
 
169
   Availability: Unix.
169
170
 
170
171
   .. versionadded:: 2.6
171
172
 
186
187
 
187
188
.. function:: siginterrupt(signalnum, flag)
188
189
 
189
 
   Change system call restart behaviour: if *flag* is :const:`False`, system calls
190
 
   will be restarted when interrupted by signal *signalnum*, otherwise system calls will
191
 
   be interrupted. Returns nothing. Availability: Unix (see the man page
192
 
   :manpage:`siginterrupt(3)` for further information).
 
190
   Change system call restart behaviour: if *flag* is :const:`False`, system
 
191
   calls will be restarted when interrupted by signal *signalnum*, otherwise
 
192
   system calls will be interrupted.  Returns nothing.  Availability: Unix (see
 
193
   the man page :manpage:`siginterrupt(3)` for further information).
193
194
 
194
 
   Note that installing a signal handler with :func:`signal` will reset the restart
195
 
   behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag*
196
 
   value for the given signal.
 
195
   Note that installing a signal handler with :func:`signal` will reset the
 
196
   restart behaviour to interruptible by implicitly calling
 
197
   :cfunc:`siginterrupt` with a true *flag* value for the given signal.
197
198
 
198
199
   .. versionadded:: 2.6
199
200
 
211
212
   exception to be raised.
212
213
 
213
214
   The *handler* is called with two arguments: the signal number and the current
214
 
   stack frame (``None`` or a frame object; for a description of frame objects, see
215
 
   the reference manual section on the standard type hierarchy or see the attribute
216
 
   descriptions in the :mod:`inspect` module).
 
215
   stack frame (``None`` or a frame object; for a description of frame objects,
 
216
   see the :ref:`description in the type hierarchy <frame-objects>` or see the
 
217
   attribute descriptions in the :mod:`inspect` module).
217
218
 
218
219
 
219
220
.. _signal-example:
232
233
 
233
234
   def handler(signum, frame):
234
235
       print 'Signal handler called with signal', signum
235
 
       raise IOError, "Couldn't open device!"
 
236
       raise IOError("Couldn't open device!")
236
237
 
237
238
   # Set the signal handler and a 5-second alarm
238
239
   signal.signal(signal.SIGALRM, handler)