bproc_rexec¶
Name¶
bproc_rexec – exec a program on a remote node
Synopsis¶
#include <sys/bproc.h>
int _bproc_rexec_io (int node, int port, const char * cmd, \
                     char * const argv[], char * const envp[]);
int bproc_rexec (int node, const char * cmd, \
                     char * const argv[], char * const envp[]);
Arguments¶
nodeThe node the child should be on.
portThe port to
BProcshould connect back to for I/O forwarding.cmdThe program to execute
argvThe argument list
envpThe environment
Description¶
This call has semantics similar to execve. It replaces the current
process with a new one. The new process is created on node and the
local process becomes the ghost representing it. All arguments are
interpreted on the remote machine. The binary and all libraries it needs
must be present on the remote machine. Currently, if remote process
creation is successful but exec fails, the process will just exit with
status 1. If remote process creation fails, the function will return -1
and errno is set 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.
Errors¶
- EPERM
 The filesystem where
cmdresides is mounted nosuid and the program is suid or sgid- ENOMEM
 Out of memory
- EBUSY
 No Master
- EFAULT
 cmd,envp, orargvpoints to memory that is not accessible by the program.- EACCES
 The program does not have execute permission on
cmd- E2BIG
 Argument list is too big
- ENOEXEC
 cmdis not in a recognized executable format or is for the wrong architecture- ENAMETOOLONG
 cmdis too long- ENOENT
 cmddoes not exist.- ENOTDIR
 Part of the path to
cmdis not a directory.- ELOOP
 Too many symbolic links were encountered when resolving
cmd.- ETXTBSY
 cmdis 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_INTERPsegment.