bproc_execmove

Name

bproc_execmove – Exec a local binary on a remote node

Synopsis

#include <sys/bproc.h>
int _bproc_execmove_io (int node, int port, const char * cmd, \
                        char * const argv[], char * const envp[]);
int bproc_execmove (int node, const char * cmd, \
                        char * const argv[], char * const envp[]);

Arguments

node

The destination node for the child process.

port

The IP port BProc should connect back to for I/O forwarding.

cmd

The program to execute

argv

The argument list

envp

The environment

Description

This function allows execution of local binaries on remote nodes. BProc will load the binary image on the current node and then move it to a remote node, prior to executing the binary image.

NOTE: This migration mechanism will move the binary image but not any dynamically loaded libraries that the application might need. Therefore any libraries that the application uses must be present on the remote system. Function does not return on success. On failure, it returns -1 and sets errno appropriately.

port is the TCP port BProc should connect back to to handle I/O forwarding. A port value of 0 means it assumes I/O forwarding is being done on the existing socket for stdout and stderr only. Any other value and it will try to connect back to that port and open three connections, one for stdout, one for stderr, and one for stdin.

If you use bproc_execmove, port has a default value of 0.

Return Value

Does not return on success.

Returns on error, and sets errno.

Errors

EPERM

The filesystem where cmd resides is mounted nosuid and the program is suid or sgid

ENOMEM

Out of memory

EBUSY

No Master

EFAULT

cmd, envp, or argv points to memory that is not accessible the by the program.

EACCES

The program does not have execute permission on cmd

E2BIG

Argument list is too big

ENOEXEC

cmd is not in a recognized executable format or is for the wrong architecture

ENAMETOOLONG

cmd is too long

ENOENT

cmd does not exist.

ENOTDIR

Part of the path to cmd is not a directory.

ELOOP

Too many symbolic links were encountered when resolving cmd.

ETXTBSY

cmd is open for writing by another program.

EIO

An I/O error occurred.

ENFILE

The limit on open files has been reached.

EINVAL

An ELF executable had more than one PT_INTERP segment.