Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Problems with statically linked OSF/1 and system()
@ 1997-05-15 20:56 Greg Galloway
  1997-05-16 13:39 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Galloway @ 1997-05-15 20:56 UTC (permalink / raw)


The following trivial C program does not run correctly on a MicroWay
500MHz Alpha running Red Hat Linux 4.1 when compiled under DEC OSF/1 
3.2 and linked statically (-non_shared):

  #include <stdio.h>

  int main()
  {
    printf("before call to system\n");
    system("echo inside call to system");
    printf("after call to system\n");
    return 0;
  }

Compiled with "cc -non_shared -o systest systest.c" and run under DEC OSF/1
it produces:

  before call to system
  inside call to system
  after call to system

When run under Red Hat 4.1 it produces:

  before call to system
  after call to system

Compiled with "gcc -o systest systest.c" and run under Red Hat 4.1 
it produces:

  before call to system
  inside call to system
  after call to system

Thanks,

Greg
----
Gregory L. Galloway
Research Scientist I

http://eoeml.gtri.gatech.edu/home/gregg/

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problems with statically linked OSF/1 and system()
  1997-05-15 20:56 Problems with statically linked OSF/1 and system() Greg Galloway
@ 1997-05-16 13:39 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 1997-05-16 13:39 UTC (permalink / raw)


> When run under Red Hat 4.1 it produces:
> 
>   before call to system
>   after call to system

If you check the return value of system, you'll find that it is failing.

The reason is that the program is looking for /usr/bin/sh or /sbin/sh
and no other, which seems inordinately strange to me since /bin/sh has
been _the_ place to look since time immemoriable.  Never mind the fact
that DU installs a link from /bin to /usr/bin.

r~

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-05-16 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-15 20:56 Problems with statically linked OSF/1 and system() Greg Galloway
1997-05-16 13:39 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox