04-23-2019
You have to use an IPC (interprocess communication) mechanism, some listed here:
1. use a file
2. use pipes
3. use shared memory
4. semaphores / mutexes
tldp.org link for IPC
6 Linux Interprocess Communications Documentation
Unless you are using shared memory, there is normally no direct access to memory-only objects by the parent into a child process memory. Debuggers may use kernel mode memory access to get around this restriction -- a security issue otherwise.
Last edited by jim mcnamara; 04-23-2019 at 12:39 PM..
These 2 Users Gave Thanks to jim mcnamara For This Post:
10 More Discussions You Might Find Interesting
1. Programming
Hi@all,
I try to compile c code on hpux 11.11 pa-risc 2 with gcc (32bit). I compile with the option -g, so that I get the symbol table, but it is not available. Does someone knows something on this?
thx (2 Replies)
Discussion started by: Dom_Cyrus
2 Replies
2. Programming
hi ,
How to view the contents of a "c" program symbol table information in unix. (1 Reply)
Discussion started by: saravanan_nitt
1 Replies
3. Linux
Folks,
I have some program(Test.cpp) as follows,
#include<iostream>
class Abc
{
private:
int _theVar;
public :
int printVar();
};
int Abc :: printVar()
{
_theVar=10;
}
main()
{
Abc _t; (0 Replies)
Discussion started by: vinod_chitrali
0 Replies
4. Programming
Folks,
I have some program(Test.cpp) as follows,
#include<iostream>
class Abc
{
private:
int _theVar;
public :
int printVar();
};
int Abc :: printVar()
{
_theVar=10;
}
main()
{
Abc _t; (2 Replies)
Discussion started by: vinod_chitrali
2 Replies
5. Shell Programming and Scripting
Hi All,
I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program.
I want 1st script to wait until the 'C' program completes.
I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies
6. Programming
Hi,
is there any command to see symbol table info.
will it show where its allocating memory for varibales golbals & locals and code.(i mean the segments).
i read there is a section called read only data segment and this is where initialized data such as strings stores.
i have wriiten the... (7 Replies)
Discussion started by: MrUser
7 Replies
7. Shell Programming and Scripting
Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know.
More detail.
ScriptA (bash), ScriptB (ksh), ScriptC (bash)
ScriptA, launches ScriptB
ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies
8. Shell Programming and Scripting
!/bin/sh
pid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $1}')
sid=$(ps -Aj | grep MSTRSvr | grep -v grep | awk '{print $3}')
ps -s "$sid"
I am not able to get the desired output it says process list error
if i use watch ps -s "$sid" it considers only the first session id (5 Replies)
Discussion started by: schippada
5 Replies
9. Emergency UNIX and Linux Support
Hello, everyone.
Here's a program:
pid_t pid = fork();
if (0 == pid) // child process
{
execvp ...;
}
I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process.
However I don't want to child process to receive the... (7 Replies)
Discussion started by: jackliang
7 Replies
10. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
SHMDT(P) POSIX Programmer's Manual SHMDT(P)
NAME
shmdt - XSI shared memory detach operation
SYNOPSIS
#include <sys/shm.h>
int shmdt(const void *shmaddr);
DESCRIPTION
The shmdt() function operates on XSI shared memory (see the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.340, Shared Memory
Object). It is unspecified whether this function interoperates with the realtime interprocess communication facilities defined in Realtime
.
The shmdt() function detaches the shared memory segment located at the address specified by shmaddr from the address space of the calling
process.
RETURN VALUE
Upon successful completion, shmdt() shall decrement the value of shm_nattch in the data structure associated with the shared memory ID of
the attached shared memory segment and return 0.
Otherwise, the shared memory segment shall not be detached, shmdt() shall return -1, and errno shall be set to indicate the error.
ERRORS
The shmdt() function shall fail if:
EINVAL The value of shmaddr is not the data segment start address of a shared memory segment.
The following sections are informative.
EXAMPLES
None.
APPLICATION USAGE
The POSIX Realtime Extension defines alternative interfaces for interprocess communication. Application developers who need to use IPC
should design their applications so that modules using the IPC routines described in XSI Interprocess Communication can be easily modified
to use the alternative interfaces.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
XSI Interprocess Communication , Realtime , exec() , exit() , fork() , shmat() , shmctl() , shmget() , shm_open() , shm_unlink() , the Base
Definitions volume of IEEE Std 1003.1-2001, <sys/shm.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE
and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained
online at http://www.opengroup.org/unix/online.html .
IEEE
/The Open Group 2003 SHMDT(P)