Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/bionic/bionic/tests/headers/posix/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 5 kB image not shown  

Quelle  signal_h.c

  Sprache: C
 

// Copyright (C) 2017 The Android Open Source Project
// SPDX-License-Identifier: BSD-2-Clause

#include <signal.h>

#include "header_checks.h"

static void signal_h() {
  void (*h)(int);
  h = SIG_DFL;
  h = SIG_ERR;
  h = SIG_HOLD;
  h = SIG_IGN;

  TYPE(pthread_t);
  TYPE(size_t);
  TYPE(uid_t);

  TYPE(struct timespec);

  TYPE(sig_atomic_t);
  TYPE(pid_t);

  TYPE(pthread_attr_t);

  TYPE(struct sigevent);
  STRUCT_MEMBER(struct sigevent, int, sigev_notify);
  STRUCT_MEMBER(struct sigevent, int, sigev_signo);
  STRUCT_MEMBER(struct sigevent, union sigval, sigev_value);
  STRUCT_MEMBER_FUNCTION_POINTER(struct sigevent, void (*f)(union sigval), sigev_notify_function);
#if defined(__BIONIC__)
  STRUCT_MEMBER(struct sigevent, void*, sigev_notify_attributes);
#else
  STRUCT_MEMBER(struct sigevent, pthread_attr_t*, sigev_notify_attributes);
#endif

  MACRO(SIGEV_NONE);
  MACRO(SIGEV_SIGNAL);
  MACRO(SIGEV_THREAD);

#if !defined(__GLIBC__)  // Our glibc is too old.
  MACRO(SIG2STR_MAX);
#endif

  TYPE(union sigval);
  STRUCT_MEMBER(union sigval, int, sival_int);
  STRUCT_MEMBER(union sigval, void*, sival_ptr);

  int i;
  i = SIGRTMIN;
  i = SIGRTMAX;

#if !defined(__GLIBC__)  // Our glibc is too old.
  MACRO(SIG2STR_MAX);
#endif

  MACRO(SIGABRT);
  MACRO(SIGALRM);
  MACRO(SIGBUS);
  MACRO(SIGCHLD);
  MACRO(SIGCONT);
  MACRO(SIGFPE);
  MACRO(SIGHUP);
  MACRO(SIGILL);
  MACRO(SIGINT);
  MACRO(SIGKILL);
  MACRO(SIGPIPE);
  MACRO(SIGQUIT);
  MACRO(SIGSEGV);
  MACRO(SIGSTOP);
  MACRO(SIGTERM);
  MACRO(SIGTSTP);
  MACRO(SIGTTIN);
  MACRO(SIGTTOU);
  MACRO(SIGUSR1);
  MACRO(SIGUSR2);
  MACRO(SIGPOLL);
  MACRO(SIGPROF);
  MACRO(SIGSYS);
  MACRO(SIGTRAP);
  MACRO(SIGURG);
  MACRO(SIGVTALRM);
  MACRO(SIGXCPU);
  MACRO(SIGXFSZ);

  TYPE(struct sigaction);
  STRUCT_MEMBER_FUNCTION_POINTER(struct sigaction, void (*f)(int), sa_handler);
  STRUCT_MEMBER(struct sigaction, sigset_t, sa_mask);
  STRUCT_MEMBER(struct sigaction, int, sa_flags);
  STRUCT_MEMBER_FUNCTION_POINTER(struct sigaction, void (*f)(int, siginfo_t*, void*), sa_sigaction);

  i = SIG_BLOCK;
  i = SIG_UNBLOCK;
  i = SIG_SETMASK;

  MACRO(SA_NOCLDSTOP);
  MACRO(SA_ONSTACK);
  MACRO(SA_RESETHAND);
  MACRO(SA_RESTART);
  MACRO(SA_SIGINFO);
  MACRO(SA_NOCLDWAIT);
  MACRO(SA_NODEFER);

  MACRO(SS_ONSTACK);
  MACRO(SS_DISABLE);

  MACRO(MINSIGSTKSZ);
  MACRO(SIGSTKSZ);

  TYPE(mcontext_t);

  TYPE(ucontext_t);
  STRUCT_MEMBER(ucontext_t, ucontext_t*, uc_link);
  STRUCT_MEMBER(ucontext_t, sigset_t, uc_sigmask);
  STRUCT_MEMBER(ucontext_t, stack_t, uc_stack);
  STRUCT_MEMBER(ucontext_t, mcontext_t, uc_mcontext);

  TYPE(stack_t);
  STRUCT_MEMBER(stack_t, void*, ss_sp);
  STRUCT_MEMBER(stack_t, size_t, ss_size);
  STRUCT_MEMBER(stack_t, int, ss_flags);

  TYPE(siginfo_t);
  STRUCT_MEMBER(siginfo_t, int, si_signo);
  STRUCT_MEMBER(siginfo_t, int, si_code);
  STRUCT_MEMBER(siginfo_t, int, si_errno);
  STRUCT_MEMBER(siginfo_t, pid_t, si_pid);
  STRUCT_MEMBER(siginfo_t, uid_t, si_uid);
  STRUCT_MEMBER(siginfo_t, void*, si_addr);
  STRUCT_MEMBER(siginfo_t, int, si_status);
  STRUCT_MEMBER(siginfo_t, long, si_band);
  STRUCT_MEMBER(siginfo_t, union sigval, si_value);

  i = ILL_ILLOPC;
  i = ILL_ILLOPN;
  i = ILL_ILLADR;
  i = ILL_ILLTRP;
  i = ILL_PRVOPC;
  i = ILL_PRVREG;
  i = ILL_COPROC;
  i = ILL_BADSTK;

  i = FPE_INTDIV;
  i = FPE_INTOVF;
  i = FPE_FLTDIV;
  i = FPE_FLTOVF;
  i = FPE_FLTUND;
  i = FPE_FLTRES;
  i = FPE_FLTINV;
  i = FPE_FLTSUB;

  i = SEGV_MAPERR;
  i = SEGV_ACCERR;

  i = BUS_ADRALN;
  i = BUS_ADRERR;
  i = BUS_OBJERR;

  i = TRAP_BRKPT;
  i = TRAP_TRACE;

  i = CLD_EXITED;
  i = CLD_KILLED;
  i = CLD_DUMPED;
  i = CLD_TRAPPED;
  i = CLD_STOPPED;
  i = CLD_CONTINUED;

  i = POLL_IN;
  i = POLL_OUT;
  i = POLL_MSG;
  i = POLL_ERR;
  i = POLL_PRI;
  i = POLL_HUP;

  i = SI_USER;
  i = SI_QUEUE;
  i = SI_TIMER;
  i = SI_ASYNCIO;
  i = SI_MESGQ;

  typedef void (*signal_handler_type)(int);

  FUNCTION(kill, int (*f)(pid_t, int));
  FUNCTION(killpg, int (*f)(pid_t, int));
  FUNCTION(psiginfo, void (*f)(const siginfo_t*, const char*));
  FUNCTION(psignal, void (*f)(intconst char*));
  FUNCTION(pthread_kill, int (*f)(pthread_t, int));
  FUNCTION(pthread_sigmask, int (*f)(intconst sigset_t*, sigset_t*));
  FUNCTION(raise, int (*f)(int));
#if !defined(__GLIBC__)  // Our glibc is too old.
  FUNCTION(sig2str, int (*f)(intchar*));
#endif
  FUNCTION(sigaction, int (*f)(intconst struct sigaction*, struct sigaction*));
  FUNCTION(sigaddset, int (*f)(sigset_t*, int));
  FUNCTION(sigaltstack, int (*f)(const stack_t*, stack_t*));
  FUNCTION(sigdelset, int (*f)(sigset_t*, int));
  FUNCTION(sigemptyset, int (*f)(sigset_t*));
  FUNCTION(sigfillset, int (*f)(sigset_t*));
  FUNCTION(sighold, int (*f)(int));
  FUNCTION(sigignore, int (*f)(int));
  FUNCTION(siginterrupt, int (*f)(intint));
  FUNCTION(sigismember, int (*f)(const sigset_t*, int));
  FUNCTION(signal, signal_handler_type (*f)(int, signal_handler_type));
  FUNCTION(sigpause, int (*f)(int));
  FUNCTION(sigpending, int (*f)(sigset_t*));
  FUNCTION(sigprocmask, int (*f)(intconst sigset_t*, sigset_t*));
  FUNCTION(sigqueue, int (*f)(pid_t, intunion sigval));
  FUNCTION(sigrelse, int (*f)(int));
  FUNCTION(sigset, signal_handler_type (*f)(int, signal_handler_type));
  FUNCTION(sigsuspend, int (*f)(const sigset_t*));
  FUNCTION(sigtimedwait, int (*f)(const sigset_t*, siginfo_t*, const struct timespec*));
  FUNCTION(sigwait, int (*f)(const sigset_t*, int*));
  FUNCTION(sigwaitinfo, int (*f)(const sigset_t*, siginfo_t*));
#if !defined(__GLIBC__)  // Our glibc is too old.
  FUNCTION(str2sig, int (*f)(const char*, int*));
#endif
}

Messung V0.5 in Prozent
C=85 H=96 G=90

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-28) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.