07-24-2011
communication between shell and and a demon 'c' program
Hello,
i have a demon 'c' program that have a dynamic table of logic registers ( 2000 variables ).
exemple of registers:
I1.34.5
M23.4.1
I want from shell acess to this table of registers.
How can i do this?
with something like for read I1.34.5:
#cat /sys/class/mySoftware/mapping/I/1/34/5
#echo 98 > /sys/class/mySoftware/mapping/I/1/34/5
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I have the following problem. I have 2 programs, a java program and a c++ program. These 2 programs have to communicate with each other in full duplex mode. I want to use pipes for this communication. So when the c++ program pust something on the stdout the java program must be able to read... (4 Replies)
Discussion started by: lmnt22
4 Replies
2. Shell Programming and Scripting
Hello
im kinda new to perl programming in unix
i need to make some kind of perl demon that sites and waits to see if there is files in the dir
if there is complete file ( not part of it ) , I need to mv it to different dir
ok so the easy parts to cp files and perl I know , but how the hell... (1 Reply)
Discussion started by: umen
1 Replies
3. Shell Programming and Scripting
I want to print the value of variables a1, a2, a3 in for loop in the following program:
a1=this
a2=is
a3=printed
for((i=1;i<4;i++))
do
var=a$i
#w=`echo $var`
e=${var}
echo $e
done
But actually I get a1,a2,a3 as the output not the "this is printed"
So the main question is if I... (3 Replies)
Discussion started by: adgarg
3 Replies
4. OS X (Apple)
Hi again,
I spoke with Keyspan and they assured me the USB to Serial device was working if I could use the Screen tool.
I asked why I was unable to redirect stdin/stdout to and from the /dev/tty. device and was told there was no reason I shouldn't be able to do so.
I have tried:
... (1 Reply)
Discussion started by: cpfogarty
1 Replies
5. Programming
i want to write a C chat program that communicates over IPC(inter process communication), that could be run using 2 seperate terminal windows within the same computer. so that wat u type in one terminal window , should appear on the other and vice versa...
could some one please help me with the... (2 Replies)
Discussion started by: localp
2 Replies
6. Shell Programming and Scripting
Hello all
i need to implement demon that needs to extract data from db load the data to memory and according to this data
to perform actions like sending emails or write/update files this action needs to be preformed each 30 min's
now i really don't know what to decide or to compile c++... (5 Replies)
Discussion started by: umen
5 Replies
7. OS X (Apple)
If I open two bash shells and telnet from Shell 2 to a remote server (on the Net), is there a way to direct input from Shell 1 to the telnet shell?
The telnet shell is a limited environment with a specific command set.
I want to direct commands from Shell 1 and, if possible, put 1-second... (2 Replies)
Discussion started by: xinUoG
2 Replies
8. Homework & Coursework Questions
Hi all,
I have an assignment from school to write a shell program in linux. the idea is to exercise fork() and execv() functions.. the shell program is supposed to be the master and every command that the user prints will run in a new process. we also need to try running the command in every... (1 Reply)
Discussion started by: r3vive
1 Replies
9. UNIX and Linux Applications
My understanding of the gnus-demon is that it should run its handlers each gnus-demon timestep. I have my gnus demon timestep set to the default 60 seconds. I have registered one handler that prints something out every time it is called (and is supposed to update the group buffer). However, the... (0 Replies)
Discussion started by: making
0 Replies
10. Shell Programming and Scripting
1) I have two scripts named as a.sh,b.sh running two different hosts host1 and host2
2) So now how to execute b.sh on host2 from a.sh on host1
3) Also I have few queries regarding the same as I want to execute few commands with sudo and with different user in script b.sh so how this can be... (2 Replies)
Discussion started by: RSC1985
2 Replies
LEARN ABOUT OPENSOLARIS
td_thr_getgregs
td_thr_getgregs(3C_DB) Threads Debugging Library Functions td_thr_getgregs(3C_DB)
NAME
td_thr_getgregs, td_thr_setgregs, td_thr_getfpregs, td_thr_setfpregs, td_thr_getxregsize, td_thr_getxregs, td_thr_setxregs - reading and
writing thread registers in libc_db
SYNOPSIS
cc [ flag... ] file... -lc_db [ library... ]
#include <proc_service.h>
#include <thread_db.h>
td_err_e td_thr_getgregs(const td_thrhandle_t *th_p, prgregset_tgregset);
td_err_e td_thr_setgregs(const td_thrhandle_t *th_p, prgregset_tgregset);
td_err_e td_thr_getfpregs(const td_thrhandle_t *th_p, prfpregset_t *fpregset);
td_err_e td_thr_setfpregs(const td_thrhandle_t *th_p, prfpregset_t *fpregset);
td_err_e td_thr_getxregsize(const td_thrhandle_t *th_p, int *xregsize);
td_err_e td_thr_getxregs(const td_thrhandle_t *th_p, prxregset_t *xregset);
td_err_e td_thr_setxregs(const td_thrhandle_t *th_p, prxregset_t *xregset);
DESCRIPTION
These functions read and write the register sets associated with thread th_p. The td_thr_getgregs() and td_thr_setgregs() functions get and
set, respectively, the general registers of thread th_p. The td_thr_getfpregs() and td_thr_setfpregs() functions get and set, respectively,
the thread's floating point register set. The td_thr_getxregsize(), td_thr_getxregs(), and td_thr_setxregs() functions are SPARC-specific.
The td_thr_getxregsize() function returns in *xregsize the size of the architecture-dependent extra state registers. The td_thr_getxregs()
and td_thr_setxregs() functions get and set, respectively, those extra state registers. On non-SPARC architectures, these functions return
TD_NOXREGS.
If the thread specified by th_p is currently executing on a lightweight process ( LWP), these functions read or write, respectively, the
appropriate register set to the LWP using the imported interface. If the thread is not currently executing on an LWP, the floating point
and extra state registers may cannot be read or written. Some of the general registers might also not be readable or writable, depending on
the architecture, in which case td_thr_getfpregs() and td_thr_setfpregs() return TD_NOFPREGS and td_thr_getxregs() and td_thr_setxregs()
will TD_NOXREGS. Calls to td_thr_getgregs() and td_thr_setgregs() succeed, but values returned for unreadable registers are undefined, val-
ues specified for unwritable registers are ignored. In this instance, and TD_PARTIALREGS is returned. See the architecture-specific notes
that follow regarding the registers that may be read and written for a thread not currently executing on an LWP.
SPARC
On a thread not currently assigned to an LWP, only %i0-%i7, %l0-%l7, %g7, %pc, and %sp (%o6) can be read or written. %pc and %sp refer to
the program counter and stack pointer that the thread will have when it resumes execution.
x86 Architecture
On a thread not currently assigned to an LWP, only %pc, %sp, %ebp, %edi, %edi, and %ebx can be read.
RETURN VALUES
TD_OK The call completed successfully.
TD_BADTH An invalid thread handle was passed in.
TD_DBERR A call to one of the imported interface routines failed.
TD_PARTIALREGS Because the thread is not currently assigned to a LWP, not all registers were read or written. See DESCRIPTION for a dis-
cussion about which registers are not saved when a thread is not assigned to an LWP.
TD_NOFPREGS Floating point registers could not be read or written, either because the thread is not currently assigned to an LWP, or
because the architecture does not have such registers.
TD_NOXREGS Architecture-dependent extra state registers could not be read or written, either because the thread is not currently
assigned to an LWP, or because the architecture does not have such registers, or because the architecture is not a SPARC
architecture.
TD_ERR A libc_db internal error occurred.
ATTRIBUTES
See attributes(5) for description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
libc_db(3LIB), attributes(5)
SunOS 5.11 20 Oct 1998 td_thr_getgregs(3C_DB)