03-20-2010
No, you cannot modify the FD set while it's waiting on it.
10 More Discussions You Might Find Interesting
1. Programming
Hi !
I had a verry simple question to ask...
In unix when we create pipes.. the unnamed pipes that is...
is there any way to access those pipes outside the code ?
Another thing.. do sockets have an entry in the inode table ?
TIA,
Devyani. (1 Reply)
Discussion started by: devy8
1 Replies
2. Programming
I am looking for a way to have a program listen on a port (example: 8000) for communication I will be sending via that port to it(Linux Kernel machine). Once it recieves an appropiate command I need it to run a .bat file in linux.
I know what I need to do but I am running into a few problems:... (8 Replies)
Discussion started by: bigB8210
8 Replies
3. Programming
I'm new to sockets programming and I have a few questions:
Is the a maximum limit that you can use for the send and receive buffers via a call to setsockopt()? Does it differ on different OSs? If it does, how do I find out the max limit?
What is the advantage to setting the buffers to be... (1 Reply)
Discussion started by: jalburger
1 Replies
4. Programming
I apologize if this seems like a repeat post, but I never got a clear answer (this isn't a criticism, it's possible I'm not being clear enough)....I'm attempting to enlarge the socket buffers for a udg socket, but it seems that no matter how large I attempt to set the buffer with
setsockopt( )
... (3 Replies)
Discussion started by: jalburger
3 Replies
5. UNIX for Dummies Questions & Answers
how do i mointor how many sockets are opened from a particular foriegn address? (2 Replies)
Discussion started by: kirpond
2 Replies
6. Solaris
Is there a way to see what sockets are in use? The developers here are getting some defunct processes and they would like to get a socket list.
This is on a Solaris 8 machine.
Thanks! (1 Reply)
Discussion started by: kjbaumann
1 Replies
7. Programming
anyone and teach me how to save standard output to a file in a client/server socket. I know how to read them to the screen but i'm not quite sure how to save them to a file.
my read to screen file code:
memset(line, 0x0, LINE_ARRAY_SIZE);
while (recv(connectSocket, line, MAX_MSG, 0) >... (1 Reply)
Discussion started by: crunchyuser
1 Replies
8. Programming
Hey guys,
Is it possible to have a worker thread send data out a TCP connection while another thread is waiting using using select() on that same connection?
If not, then what is the correct way to maintain a connection, react to incoming data, and send data over a TCP connection?
Thanks... (16 Replies)
Discussion started by: scubanarc
16 Replies
9. Shell Programming and Scripting
I am creating a Select menu with a few options and I would like to create a "better" looking interface than just this:
1) Option 1
2) Option 2
3) Option 3
Instead, I would like something like this:
***********
* Cool Script *
* 1) Option 1 *
* 2) Option 2 *
* 3) Option 3 *... (2 Replies)
Discussion started by: chipblah84
2 Replies
10. IP Networking
Hi -
I've written an app that, among other things, accepts a telnet connection (made via the "telnet" command from a terminal) and converses with it. I'd like to make this work so that only one client at a time can connect. Currently, when a second user tries to connect, the incoming messages... (2 Replies)
Discussion started by: mzimmers
2 Replies
LEARN ABOUT OPENSOLARIS
sem_post
sem_post(3C) Standard C Library Functions sem_post(3C)
NAME
sem_post - increment the count of a semaphore
SYNOPSIS
#include <semaphore.h>
int sem_post(sem_t *sem);
DESCRIPTION
The sem_post() function unlocks the semaphore referenced by sem by performing a semaphore unlock operation on that semaphore.
If the semaphore value resulting from this operation is positive, then no threads were blocked waiting for the semaphore to become
unlocked; the semaphore value is simply incremented.
If the value of the semaphore resulting from this operation is 0, then one of the threads blocked waiting for the semaphore will be
allowed to return successfully from its call to sem_wait(3C). If the symbol _POSIX_PRIORITY_SCHEDULING is defined, the thread to be
unblocked will be chosen in a manner appropriate to the scheduling policies and parameters in effect for the blocked threads. In the case
of the schedulers SCHED_FIFO and SCHED_RR, the highest priority waiting thread will be unblocked, and if there is more than one highest
priority thread blocked waiting for the semaphore, then the highest priority thread that has been waiting the longest will be unblocked.
If the symbol _POSIX_PRIORITY_SCHEDULING is not defined, the choice of a thread to unblock is unspecified.
RETURN VALUES
If successful, sem_post() returns 0; otherwise it returns -1 and sets errno to indicate the error.
ERRORS
The sem_post() function will fail if:
EINVAL The sem argument does not refer to a valid semaphore.
ENOSYS The sem_post() function is not supported by the system.
EOVERFLOW The semaphore value exceeds SEM_VALUE_MAX.
USAGE
The sem_post() function is reentrant with respect to signals and may be invoked from a signal-catching function. The semaphore functional-
ity described on this manual page is for the POSIX (see standards(5)) threads implementation. For the documentation of the Solaris threads
interface, see semaphore(3C)).
EXAMPLES
See sem_wait(3C).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO
sched_setscheduler(3C), sem_wait(3C), semaphore(3C), attributes(5), standards(5)
SunOS 5.11 5 Feb 2008 sem_post(3C)