signal.h in C

signal.h in C

The header file named signal.h in Library C defines a type of variable sig_atomic_t, two function calls, and a number of macros to handle the different signals reported during execution of a program.

The variables are defined in signal.h

The following is the type of variable defined in signal.h:

sig_atomic_t : This is an int and is used as a variable in the signal handler. This is an integer type of an object that can be accessed as an atomic entity, even if there are asynchronous signals present.

The macros are defined in signal.h

The following are the macros defined in signal.h and these macros will be used in the two functions listed below. SIG_ macro is used with signal function to define signal functions.

TMTM & Description1 SIG_DFL

This is the default Signal Handler

2 SIG_ERR

Performing a Signal Error

3 SIG_IGN

Ignore the signal

The SIG macro is used to represent a digital signal under the following conditions:

STTMacro & Description1 SIGABRT

End the program abnormally

2 SIGFPE

Error floating point number as divided by 0

3 SIGILL

Invalid operation

4 SIGINT

Interrupt signal, such as Ctrl-C

5 SIGSEGV

Invalid access to the repository

6 SIGTERM

Request to end

Functions defined in signal.h

Here are some functions defined in signal.h in Library C:

STD & Description1

Void function (* signal (int sig, void (* func) (int))) (int)

This function sets a function to handle the signal (eg a signal handler)

2

Function int raise (int sig)

This function generates a sig signal. The sig parameter is compatible with the SIG macro

According to Tutorialspoint

Previous article: Library C:

Next lesson: stdarg.h in C

5 ★ | 1 Vote

May be interested

  • Check out the 'buffalo' Pokémon in Pokémon GoCheck out the 'buffalo' Pokémon in Pokémon Go
    each type of pokemon has hp, cp, ability to attack and endure differently. based on these indicators, players can determine as well as choosing the most powerful pokemon for their offensive tactics.
  • Sitting home can also locate Pokemon around, do you believe it?Sitting home can also locate Pokemon around, do you believe it?
    the tightening of the niantic developers' rules to prevent players from abusing the support tools also brings annoyance, such as those who have no conditions to move much, go away, it is hard to know. get the location of the pokemon around the area they live in
  • 5 undeniable benefits when playing Pokemon Go5 undeniable benefits when playing Pokemon Go
    get to know many new people, breathe fresh air, relieve stress, increase concentration thanks to going out for a walk .... are compelling reasons to force you to try pokemon go now .
  • Want to earn the fastest Pokécoins in Pokémon Go? So don't miss this article!Want to earn the fastest Pokécoins in Pokémon Go?  So don't miss this article!
    pokécoins in pokémon go play the role of buying items in the store. the more coins you earn, the more likely you are to buy more items. to earn pokécoins, players will have to complete certain tasks or buy real money.
  • Pokémon systems when fighting in Pokémon GoPokémon systems when fighting in Pokémon Go
    each pokémon system in pokémon go has different strengths, along with a specific weakness. this type of pokémon will have the power to attack the other pokémon, but can defeat the other pokémon. if you know the characteristics of each type, it will be easier to choose which pokémon to battle.
  • The terms you need to know when playing Pokémon GoThe terms you need to know when playing Pokémon Go
    pokémon go is the most prominent name in recent days. this game of capturing and training virtual animals has created a relatively new way of playing, as players have to constantly move to catch pokémon. during the process of joining pokémon go, you will encounter and use a lot of important terms. so what do they mean?
  • How to play Pokemon GO on Windows computersHow to play Pokemon GO on Windows computers
    recently, pokemon go has become a popular game, attracting thousands of gamers around the world. in previous posts network administrator has guided you on how to play pokemon go on android devices and ios devices. in the article below, network administrator will guide you how to play pokemon go on windows computers using bluestacks emulator software.
  • How to become a good Pokémon Go hunter?How to become a good Pokémon Go hunter?
    with a new way of playing, pokémon go has created a new phenomenon in the game village around the world. players will have to go around and find pokémon for themselves. so how to quickly catch pokémon and in large numbers?
  • Things to know to upgrade Pokémon in Pokémon GoThings to know to upgrade Pokémon in Pokémon Go
    the whirlwind pokémon go has spread its power right on the first day of its release. everyone rushed to the street to find a pokémon for themselves. therefore, in order to become a pokémon hunter, you need to master the basics of participating in pokémon go battlefield.
  • List of medals received in Pokemon GoList of medals received in Pokemon Go
    in addition to getting items when leveling up, gamers who join pokemon go also have the opportunity to receive their proud achievements.