Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  eintr_wrapper.h   Sprache: C

 
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This provides a wrapper around system calls which may be interrupted by a
// signal and return EINTR. See man 7 signal.
//
// On Windows, this wrapper macro does nothing because there are no
// signals.
//
// Don't wrap close calls in HANDLE_EINTR. Use IGNORE_EINTR if the return
// value of close is significant. See http://crbug.com/269623.

#ifndef BASE_EINTR_WRAPPER_H_
#define BASE_EINTR_WRAPPER_H_

#if defined(XP_UNIX)

#  include <errno.h>

#  define HANDLE_EINTR(x)                                     \
    ({                                                        \
      decltype(x) eintr_wrapper_result;                       \
      do {                                                    \
        eintr_wrapper_result = (x);                           \
      } while (eintr_wrapper_result == -1 && errno == EINTR); \
      eintr_wrapper_result;                                   \
    })

#  define IGNORE_EINTR(x)                                   \
    ({                                                      \
      decltype(x) eintr_wrapper_result;                     \
      do {                                                  \
        eintr_wrapper_result = (x);                         \
        if (eintr_wrapper_result == -1 && errno == EINTR) { \
          eintr_wrapper_result = 0;                         \
        }                                                   \
      } while (0);                                          \
      eintr_wrapper_result;                                 \
    })

#  define HANDLE_RV_EINTR(x)                   \
    ({                                         \
      decltype(x) eintr_wrapper_result;        \
      do {                                     \
        eintr_wrapper_result = (x);            \
      } while (eintr_wrapper_result == EINTR); \
      eintr_wrapper_result;                    \
    })

#else

#  define HANDLE_EINTR(x) (x)
#  define IGNORE_EINTR(x) (x)
#  define HANDLE_RV_EINTR(x) (x)

#endif  // XP_UNIX

#endif  // !BASE_EINTR_WRAPPER_H_

Messung V0.5
C=91 H=92 G=91

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge