Sponsored Content
Full Discussion: C Shell RPC help
Top Forums Programming C Shell RPC help Post 302311981 by pludi on Thursday 30th of April 2009 05:36:53 AM
Old 04-30-2009
Where does it echo anything to the shell??
Code:
$ cat process.c
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    FILE *proc, *out;
    char buffer[1024];

    proc = popen("/bin/ls /", "r");
    out = fopen("output.txt", "w");

    while (!feof(proc)) {
        fgets(buffer, 1024, proc);
        fprintf(out, "%s", buffer);
    }
    fclose(out);
    pclose(proc);

    return 0;
}
$ ./process
$ cat output.txt
bin
boot
dev
etc
home
lib
lost+found
media
mnt
opt
proc
root
sbin
srv
sys
tmp
usr
var
var

I still fail to understand what you're trying to accomplish, could you clarify that a bit more?
 

10 More Discussions You Might Find Interesting

1. Programming

Rpc

Hello, I would like to do a program (in C) on which I would have to call 3 or more executables using execl command. But if the executables are situated on another machine say Y and I do a programe on the machine X, is it possible to invoke those executables (binaries) from the other machine... (1 Reply)
Discussion started by: driki
1 Replies

2. UNIX for Dummies Questions & Answers

RPC service

Hi All, How can I add RPC service in SCO 5.0.7. I did not find in the sco cd please help me Alice (0 Replies)
Discussion started by: alisevA3
0 Replies

3. Solaris

rpc.ttdbserverd

Recently,one of my Sun Box found this messages in the /var/adm/messages/ inetd: /usr/dt/bin/rpc.ttdbserverd: Hangup It had quite a number of the same message. If it related to any network issue? What is the purpose of rpc.ttdbserverd? Thanks (1 Reply)
Discussion started by: AirWalker83
1 Replies

4. Red Hat

RPC Timeout

I have a RHEL 2.1 machine that I am trying to get to mount a remote nfs filesystem. Both servers have 2 network interfaces. My linux machine can mount the filesystem through one interface with no problems but if I switch over and try to mount it through the other interface using a totally... (1 Reply)
Discussion started by: darren.wyatt
1 Replies

5. Linux

RPC Problem

:confused:Hi guys, The RPC problem is appearing on the screen while starting the portmap service,take a look of the real.. # service portmap restart Stopping portmap: Starting portmap: Cannot register... (1 Reply)
Discussion started by: daya.pandit
1 Replies

6. Solaris

RPC: Rpcbind failure - RPC: Timed out

while i trying to mount from NAS i have this messages mount -F nfs -o rw 172.16.110.13:/tremabkup /tremabkup nfs mount: 172.16.110.13: : RPC: Rpcbind failure - RPC: Timed out nfs mount: retrying: /tremabkup nfs mount: 172.16.110.13: : RPC: Rpcbind failure - RPC: Timed out nfs mount:... (2 Replies)
Discussion started by: thecobra151
2 Replies

7. Solaris

Error : "RPC: Rpcbind failure - RPC: Timed out"

Hello I am having an issue with a server SUN FIRE T2000 (Solaris 10). First of all the server didn't boot normaly so I did a full restoration of the file systems. Now the server boot, most of the services are available (not all the services), but I keep on seeing RPC: Rpcbind failure -... (4 Replies)
Discussion started by: feg
4 Replies

8. Solaris

RPC: Rpcbind failure - RPC: Timed out error (solaris)

C: Rpcbind failure - RPC: Timed out error (solaris) hello an nfs server on my sun fire v440 is not responding , i get the error bellow and lots of my networking services are not reponding, please helppppp its an emergency RPC: Rpcbind failure - RPC: Timed out i also get NFS server... (2 Replies)
Discussion started by: feg
2 Replies

9. Solaris

nfs mount: RPC: Rpcbind failure - RPC: Timed out

Fails to mount the server (10.125.224.22) during installation of a software on client, throwing the below error: nfs mount: 10.125.224.22: : RPC: Rpcbind failure - RPC: Timed out nfs mount: retrying: /cdrom This happened after complete shutdown of the lab. The server came up fine but most... (1 Reply)
Discussion started by: frintocf
1 Replies

10. HP-UX

RPC Error

Hi All, I am receiving RPC-Error 5 and sometimes RPC-Error 2 in my Hp-Ux servers. I have tried to kill and restart again.. Again same errors. Sometimes RPC process going down. Due to this other applications are not working in Hp ux servers. Kindly share some ideas for root cause... Or... (2 Replies)
Discussion started by: jakmani
2 Replies
ptree(1)																  ptree(1)

NAME
ptree - print process trees SYNOPSIS
/usr/bin/ptree [-a] [-c] [-z zone] [pid | user] ... ptree prints the process trees containing the specified pids or users, with child processes indented from their respective parent pro- cesses. An argument of all digits is taken to be a process-id, otherwise it is assumed to be a user login name. The default is all pro- cesses. The following options are supported: -a All. Print all processes, including children of process 0. -c Contracts. Print process contract memberships in addition to parent-child relationships. See process(4). This option implies the -a option. -z zone Zones. Print only processes in the specified zone. Each zone ID can be specified as either a zone name or a numerical zone ID. This option is only useful when executed in the global zone. The following operands are supported: pid Process-id or a list of process-ids. ptree also accepts /proc/nnn as a process-id, so the shell expansion /proc/* can be used to specify all processes in the system. user Username or list of usernames. Processes whose effective user IDs match those given are displayed. Example 1: Using ptree The following example prints the process tree (including children of process 0) for processes which match the command name ssh: $ ptree -a `pgrep ssh` 1 /sbin/init 100909 /usr/lib/ssh/sshd 569150 /usr/lib/ssh/sshd 569157 /usr/lib/ssh/sshd 569159 -ksh 569171 bash 569173 /bin/ksh 569193 bash The following exit values are returned: 0 Successful operation. non-zero An error has occurred. /proc/* process files See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The human readable output is Unstable. The options are Evolving. gcore(1), ldd(1), pargs(1), pgrep(1), pkill(1), plimit(1), pmap(1), preap(1), proc(1), ps(1), ppgsz(1), pwd(1), rlogin(1), time(1), truss(1), wait(1), fcntl(2), fstat(2), setuid(2), dlopen(3C), signal.h(3HEAD), core(4), proc(4), process(4), attributes(5), zones(5) 11 Oct 2005 ptree(1)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy