1

Simple program:

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netdb.h>

int main(int argc, char **argv)
{
    int ret = rexec((char**) 0, "", "", "", 0);

    return 0;
}

Compile:

$ g++ -o rexec -D_XOPEN_SOURCE_EXTENDED rexec.cpp

rexec.cpp: In function 'int main(int, char**)':
rexec.cpp:10:49: error: 'rexec' was not declared in this scope
Fred Foo
  • 355,277
  • 75
  • 744
  • 836
chila
  • 2,372
  • 1
  • 16
  • 33

2 Answers2

0

These functions are not in POSIX.1-2001. The rexec() function first appeared in 4.2BSD, and is present on the BSDs, Solaris, and many other systems. The rexec_af() function is more recent, and less widespread.

Source: "man rexec"

LtWorf
  • 7,286
  • 6
  • 31
  • 45
0
find /usr/local -type f -print -exec grep rexec {} \; # no rgrep/grep -R on HP-UX

There clearly is no rexec function in any header on my HP-UX system.

HP-UX doesn't have it. You'll have to implement it yourself by just doing a popen on the rexec(1) application, I guess (not too hard). Or, stop using rexec!

Nicholas Wilson
  • 9,435
  • 1
  • 41
  • 80