Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   compiling elog 2.6.1 on solaris platform, posted by Angus Au on Thu Feb 2 03:19:44 2006 
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Willem Koster on Fri Feb 3 13:10:14 2006 
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 08:27:40 2006 
       icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 6 16:44:46 2006 
          icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 16:48:17 2006 
             icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:19:02 2006 
                icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:34:43 2006 
                   icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 13:58:17 2006 
                      icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 17:22:36 2006 
                         icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 17:29:03 2006 
                            icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 20:24:56 2006 
                               icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 20:29:12 2006 
                                  icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 21:52:35 2006 
                                     icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Fri Feb 10 22:31:38 2006 
                                        icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Fri Feb 10 22:35:20 2006 
                                           icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 13 18:22:08 2006 
                                              icon7.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 20 17:52:06 2006 
Message ID: 1666     Entry time: Wed Feb 8 18:34:43 2006     In reply to: 1664     Reply to this: 1676
Icon: Reply  Author: Steve Jones  Author Email: steve.jones@freescale.com 
Category: Question  OS: Other  ELOG Version: 2.6.1 
Subject: Re: compiling elog 2.6.1 on solaris platform 

Steve Jones wrote:

Stefan Ritt wrote:

Steve Jones wrote:
I have checked and can find no reference within Sun documents regarding the support of the forkpty() function. I have not been following elog development lately -- what is shell substitution supposed to buy us?


See the config manual and look for $shell



Steve Jones wrote:
Yep, I saw it. Thanks



Steve Jones wrote:

Stefan, I found the following "forkpty()" replacement for running under Solaris. The URL is http://www.developerweb.net/forum/showthread.php?t=2990.

Perhaps this can be used unless someone comes up with a Solaris "util" library.


#ifdef SOLARIS /* Use the code in my_forkpty.c */
int my_forkpty (int *amaster, char *name, void *unused1, void *unused2);
#define forkpty my_forkpty
#endif
-----------------------
my_forkpty.c
-----------------------
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stream.h>
#include <sys/stropts.h>

/* fork_pty() remplacement for Solaris.
* This ignore the last two arguments
* for the moment
*/
int
my_forkpty (int *amaster,
char *name,
void *unused1,
void *unused2)
{
int master, slave;
char *slave_name;
pid_t pid;

master = open("/dev/ptmx", O_RDWR);
if (master &lt; 0)
return -1;

if (grantpt (master) &lt; 0)
{
close (master);
return -1;
}

if (unlockpt (master) &lt; 0)
{
close (master);
return -1;
}

slave_name = ptsname (master);
if (slave_name == NULL)
{
close (master);
return -1;
}

slave = open (slave_name, O_RDWR);
if (slave &lt; 0)
{
close (master);
return -1;
}

if (ioctl (slave, I_PUSH, "ptem") &lt; 0
|| ioctl (slave, I_PUSH, "ldterm") &lt; 0)
{
close (slave);
close (master);
return -1;
}

if (amaster)
*amaster = master;

if (name)
strcpy (name, slave_name);

pid = fork ();
switch (pid)
{
case -1: /* Error */
return -1;
case 0: /* Child */
close (master);
dup2 (slave, STDIN_FILENO);
dup2 (slave, STDOUT_FILENO);
dup2 (slave, STDERR_FILENO);
return 0;
default: /* Parent */
close (slave);
return pid;
}

return -1;
}
ELOG V3.1.5-fe60aaf