05-09-2009
Just a guess, but: a thread isn't a "new" part of a program, but a part of the code that executes in parallel. A call to system() is, basically, a fork(), exec(), and wait(). And with fork() the complete context of the process is copied, including your socket.
One option that I can think of would be to do the fork() in the thread, clean up the environment, and then call system().
10 More Discussions You Might Find Interesting
1. AIX
I have what appears to be a unique socket problem, although admittedly my tcp/ip programming experience is relatively limited.
I have a AIX server process using TCP/IP berkely sockets, and a Windows (C#) process. The windows process takes input from a user and sends a message to the Unix... (1 Reply)
Discussion started by: adiaconou
1 Replies
2. UNIX and Linux Applications
hi,
I have
* an IBM P550 machine,
* an AIX 5.3 running on it and
* an oracle database, already installed on it.
The problem (or question of my own) is:
Oracle tns listener, "CT_LISTENER", and the enterprise manager (EM) of the instance, which is uniq instance and called... (0 Replies)
Discussion started by: talipk
0 Replies
3. UNIX for Advanced & Expert Users
hi,
I have a problem about the Oracle related components. I'm not able to find any answer yet, and waiting for your responses...
Here is the configuration of my system:
* an IBM P550 machine,
* an AIX 5.3 running on it and
* an oracle database, already installed on it.
The problem (or... (1 Reply)
Discussion started by: talipk
1 Replies
4. IP Networking
Hello ;
This what i want to do :
I know that in the system call
#include <sys/socket.h>
int bind(int socket, const struct sockaddr *address,
socklen_t address_len);
you can specify the local port for your socket, but im using a private library , and im sure that in that library... (0 Replies)
Discussion started by: trutoman
0 Replies
5. Programming
I'm trying to add a custom ("Hello world" :o) system call.
In /usr/src/linux/hello/ I put simple hello.c ...#include "linux/linkage.h" // for linking a system call
#include "linux/kernel.h" // for "printk"
asmlinkage int sys_hello()
{
printk(KERN_ALERT "Hello!");
return 1;
}... and in... (5 Replies)
Discussion started by: courteous
5 Replies
6. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
7. Shell Programming and Scripting
Hello!!!
I'm trying to pass the output from bash command to perl variable in a perl script, and I used the "system" command to execute the bash statment and pass the result to perl string variable, in this perl script I used a variable $file that store data for using it as a regular expression.... (2 Replies)
Discussion started by: evolabo
2 Replies
8. AIX
I have once experienced this problem without understanding what caused it but now learned thatn there is even a PMR dealing with it. Sometimes it happens that you encounter the following (rather cryptical) error message when trying to install an rpm-package:
package <rpm_package_name> is for a... (1 Reply)
Discussion started by: bakunin
1 Replies
9. Shell Programming and Scripting
Hello experts!
I need your help please
I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.:
2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well.
So I want to execute
date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies
10. UNIX for Beginners Questions & Answers
Cannot present unpresented disks back again. On a test server tried this as a solution "multipath -r" and it worked. Too worried to try it in production before I know all the information.
Any info would be appreciated!
Also some links to the documentation on this specific issue could help a... (1 Reply)
Discussion started by: jsteppe
1 Replies
listen(2) System Calls Manual listen(2)
NAME
listen - listen for connections on a socket
SYNOPSIS
DESCRIPTION
To accept connections, a socket is first created using a queue for incoming connections is activated using and then connections are
accepted using applies only to unconnected sockets of type SOCK_STREAM. Except for AF_VME_LINK, if the socket has not been bound to a
local port before is invoked, the system automatically binds a local port for the socket to listen on (see inet(7F)). For sockets in the
address family AF_CCITT and AF_VME_LINK, the socket be bound to an address by using before connection establishment can continue, otherwise
an error is returned.
A listen queue is established for the socket specified by the s parameter, which is a socket descriptor.
backlog defines the desirable queue length for pending connections. The actual queue length may be greater than the specified backlog. If
a connection request arrives when the queue is full, the client will receive an error.
backlog is limited to the range of 0 to which is defined in is currently set to 4096. If any other value is specified, the system automat-
ically assigns the closest value within the range. Note that for a backlog of 0 specifies only 1 pending connection is allowed at any
given time. For a backlog of 0 specifies no further connection is allowed.
X/Open Sockets Compilation Environment
See xopen_networking(7).
DEPENDENCIES
AF_CCITT
Call-acceptance can be controlled by the call described in Upon successful completion, returns 0; otherwise, it returns -1 and sets to
indicate the error.
ERRORS
fails if any of the following conditions are encountered:
s is not a valid file descriptor.
The socket s has not been bound to an address by using
s is a valid file descriptor but it is not a socket.
The socket referenced by
s does not support
The socket has been shut down or is already connected.
WARNINGS
Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex-
pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy.
FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati-
ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network-
ing(7)).
AUTHOR
was developed by HP and the University of California, Berkeley.
SEE ALSO
accept(2), connect(2), socket(2), thread_safety(5), xopen_networking(7), inet(7F).
STANDARDS CONFORMANCE
listen(2)