home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!darwin.sura.net!mips!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!serval!phys1.physics.wsu.edu!hlu
- From: hlu@phys1.physics.wsu.edu (Hongjiu Lu)
- Newsgroups: comp.os.linux
- Subject: Re: sigblock, sigpause...
- Message-ID: <1992Jul27.232246.29715@serval.net.wsu.edu>
- Date: 27 Jul 92 23:22:46 GMT
- References: <14p8neINNpr0@matt.ksu.ksu.edu> <1992Jul27.210933.29135@htsa.aha.nl>
- Sender: news@serval.net.wsu.edu (USENET News System)
- Organization: Washington State University
- Lines: 50
-
- In article <1992Jul27.210933.29135@htsa.aha.nl>, miquels@htsa.aha.nl (Miquel van Smoorenburg) writes:
- |> In article <14p8neINNpr0@matt.ksu.ksu.edu> kxb@matt.ksu.ksu.edu (Karl Buck) writes:
- |> >Are sigblock and sigpause implemented in the latest version of the
- |> >compiler and/or kernel?
- |> >--
- |> >Karl Buck O, Freddled Gruntbuggly
- |> >Grain Marketing Thy Nicturations are to me
- |> >Research Lab As Plurdled Gabbleblotchits
- |> >(913)776-2745 On a lurgid bee. -- Chief Prostetnic Vogon Jeltz
- |>
- |> #define sigblock(what) sigsetmask(siggetmask()|(what))
- |> #define sigpause(what) sigsuspend(&what)
-
- They are wrong. How about
-
- sigpause (sigmask(SIGUSER1));
-
- |>
- |> That's all.. (Could someone put this in the official <signal.h> ? )
-
- sigblock/sigpause are from BSD. Linux uses POSIX, which can do the equivalent
- thing. You just have to use POSIX signals. THERE ARE NO ONE TO ONE CONVERSIONS.
- I take this out of zsh port.
-
- -----------------
- #ifdef _POSIX_SOURCE
- #define blockchld() { sigset_t set; \
- sigemptyset (&set); \
- sigaddset (&set, SIGCHLD); \
- sigprocmask (SIG_BLOCK, &set, (sigset_t *)NULL); }
- #define unblockchld() { sigset_t set; \
- sigemptyset (&set); \
- sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL); }
- #define chldsuspend() { sigset_t set; \
- sigemptyset (&set); \
- sigsuspend (&set);}
- #else
- #define blockchld() sigblock(sigmask(SIGCHLD))
- #define unblockchld() sigsetmask(0)
- #define chldsuspend() sigpause(0)
- #endif
- -----------------
-
- Please get a book on POSIX (any suggestions?) That is a simple one. Sometimes,
- you need more than that. Again POSIX can do most but not all BSD signals with
- very different signal functions.
-
- --
- H.J.
- Gcc/libc maintainer for Linux.
-