Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!emory!gatech!purdue!haven!adm!cmcl2!lanl!beta.lanl.gov!jsj From: jsj@acl.lanl.gov (John Stephen Junkins) Newsgroups: comp.lang.c Subject: Attention Rexec() users!!! Message-ID: Date: 17 Jan 91 22:33:07 GMT Sender: news@lanl.gov Distribution: comp.lang.c Organization: Advanced Computing Lab, LANL, NM Lines: 37 Hey there! I have been trying to write an incredibly simple code using rexec to fire off another process. However the little code below core dumps. Dbx says that it is bombing in a call to getservbyname() which I assume means that I have a problem with the way I have defined hostname[][]. Can anyone please tell me what I am doing wrong or send me a piece of code which uses rexec() and works()? Please send solutions directly to me as this newsgroup is too big! Thanks in advance!! Stephen. main() { char hostname [2][50]; struct servent *s; int fd2p = 0; gethostname (hostname[0], 50); sprintf (hostname[1], "%s", ""); s = getservbyname ("exec", "tcp"); rexec (hostname, s->s_port, "jsj", "xxxxxxxx", "xlock", &fd2p); printf ("Mission accomplished!"); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !! whoami: J. Stephen. Junkins !! !! whereami: jsj@emu.lanl.gov !! !! whereireallyam: POB 1032 Los Alamos NM 87544 ph: 505-665-2479 !! !! home: 505-662-1478 !! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~