Sponsored Content
Full Discussion: select vs poll
Special Forums IP Networking select vs poll Post 302115858 by porter on Saturday 28th of April 2007 05:06:15 PM
Old 04-28-2007
Quote:
Originally Posted by smanu
But could you tell me what are those other number of ways in which we can check if our system is BSD derived or V derived?
Off the top of my head the three main differences for a programmer are:

1. STREAMS

if has #include <sys/stream.h> it's SYS V

2. signals

if it has sigblock & sigsetmask it's BSD, if sighold & sigrelse it's SYS V

3. terminal handling

check prototype for "setpgrp()", if takes two args it's BSD


But as systems have all adopted BSD sockets and merging to standardisation on posix compatibility it is more important to check the actual feature you are trying to use.
 

7 More Discussions You Might Find Interesting

1. Programming

How to convert the "select" function into a "poll" function

i have a program using the select function but i want to convert it to poll... how can i do this? thanks in advance... :) (1 Reply)
Discussion started by: rbolante
1 Replies

2. UNIX for Dummies Questions & Answers

Replace select/poll with kqueue/kevent

Hi, As far as I known, kqueue/kevent model can be used to improve the efficiency of systems event dispatching. I m wondering whether kqueue/kevent is same as the real-time OS event model. I also want to know when writing multiplexing app in real-time OS, what APIs need to be used for... (1 Reply)
Discussion started by: bsderss
1 Replies

3. Programming

select/poll and Signal Safety

Hi I am struggling to understand why one should use pselect()/ppoll() instead of wrapping an ordinary select() or poll() call around sigprocmask(). The linux man page talks about “race conditions”, but how would such dangers occur? I plan to use poll() for an application (since ppoll() isn't... (0 Replies)
Discussion started by: nopcoder
0 Replies

4. UNIX for Dummies Questions & Answers

Poll data from a file

I have to write a script where I poll a txt file for data (30 min interval) Dependent on the data read, the script should return a message. It should look something like the "code" below: -- do while <data recived> sleep 30m read data from file Done If <data> x return "A" If... (1 Reply)
Discussion started by: ioniCoder
1 Replies

5. Shell Programming and Scripting

how to poll for new files?

Hi , i have a requirement in which i have to ftp files to unix from windows and vice versa. I have to encrypt files in windows which will then be decrypted in unix and vice versa. Now the process needs to be automated ..therefore when windows server or unix server recieves the files a shell... (5 Replies)
Discussion started by: lifzgud
5 Replies

6. Shell Programming and Scripting

How to use poll() for I/O multiplex

Hi, guys: I want to write my own shell using C. I am confused about the usage of I/O multiplex. Does anyone know some examples or explain it to me ? Thanks so much (1 Reply)
Discussion started by: tomlee
1 Replies

7. What is on Your Mind?

Powerhouses and mainstream poll

This not a joke but a quite serious question to maybe have your point of view about this very topic of content on the net. So I start this poll to ask the users if they can imagine that the so called content industry of former times sooner or later or anyway will regain lost ground or not? Do you... (1 Reply)
Discussion started by: 1in10
1 Replies
sigblock(3UCB)					     SunOS/BSD Compatibility Library Functions					    sigblock(3UCB)

NAME
sigblock, sigmask, sigpause, sigsetmask - block signals SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... #include <signal.h> int sigblock(mask); intmask; int sigmask( signum); int signum; int sigpause(int mask); int mask; int sigsetmask( mask); int mask; DESCRIPTION
sigblock, sigmask, sigpause, sigsetmask - block signals sigblock() adds the signals specified in mask to the set of signals currently being blocked from delivery. Signals are blocked if the appropriate bit in mask is a 1; the macro sigmask is provided to construct the mask for a given signum. sigblock() returns the previous mask. The previous mask may be restored using sigsetmask(). sigpause() assigns mask to the set of masked signals and then waits for a signal to arrive; on return the set of masked signals is restored. mask is usually 0 to indicate that no signals are now to be blocked. sigpause() always terminates by being interrupted, returning -1 and setting errno to EINTR. sigsetmask() sets the current signal mask (those signals that are blocked from delivery). Signals are blocked if the corresponding bit in mask is a 1; the macro sigmask is provided to construct the mask for a given signum. In normal usage, a signal is blocked using sigblock(). To begin a critical section, variables modified on the occurrence of the signal are examined to determine that there is no work to be done, and the process pauses awaiting work by using sigpause() with the mask returned by sigblock(). It is not possible to block SIGKILL, SIGSTOP, or SIGCONT, this restriction is silently imposed by the system. RETURN VALUES
sigblock() and sigsetmask() return the previous set of masked signals. sigpause() returns -1 and sets errno to EINTR. SEE ALSO
kill(2), sigaction(2), signal(3UCB), sigvec(3UCB) NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-thread applications is unsupported. SunOS 5.10 19 Feb 1993 sigblock(3UCB)
All times are GMT -4. The time now is 04:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy