Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 220 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subjectdown
  800   Thu Nov 18 09:40:25 2004 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux2.5.4-6Re: compiling elog on AMD64
> When compiling elogd on AMD64 (in 64 bit mode) there are many 
> warnings like these:
> 
> src/regex.c:3769: warning: cast from pointer to integer of different size
> src/regex.c:3769: warning: cast from pointer to integer of different size
> src/regex.c:3775: warning: cast to pointer from integer of different size
> 
> The reason is the (int) cast, which (I think) is not necessary.

Unfortunately I don't have a 64-bit compiler to try. Can you please check if
elogd.c has similar warnings or only regex.c? The ones in elogd.c I can fix,
but regex.c is straight from the GNU C library, so we would have to wait intil
they fix it. Or can you get it from the 64-bit C library? The point is that I
need the source code, so that I can compile it under Windows as well. Can you
try to compile elogd without regex.c, like 

gcc -g -O -W -Wall -o elogd src/elogd.c

If that works fine, we don't have to compile regex.c under linux. But I guess
it's still needed fot Solaris and other non-GNU Unix brands.
  802   Sun Nov 21 00:46:28 2004 Reply Heiko Scheith.scheit@mpi-hd.mpg.deBug reportLinux2.5.4-6Re: compiling elog on AMD64
> > When compiling elogd on AMD64 (in 64 bit mode) there are many 
> > warnings like these:
> > 
> > src/regex.c:3769: warning: cast from pointer to integer of different size
> > src/regex.c:3769: warning: cast from pointer to integer of different size
> > src/regex.c:3775: warning: cast to pointer from integer of different size
> > 
> > The reason is the (int) cast, which (I think) is not necessary.
> 
> Unfortunately I don't have a 64-bit compiler to try. Can you please check if
> elogd.c has similar warnings or only regex.c? 

  elogd.c shows the same warnings.

> The ones in elogd.c I can fix,
> but regex.c is straight from the GNU C library, so we would have to wait intil
> they fix it. Or can you get it from the 64-bit C library? The point is that I
> need the source code, so that I can compile it under Windows as well. Can you
> try to compile elogd without regex.c, like 
> 
> gcc -g -O -W -Wall -o elogd src/elogd.c

  This works OK.
 
  1647   Fri Feb 3 13:10:14 2006 Reply Willem KosterW.Koster@rc.rug.nlQuestionOther2.6.1Re: compiling elog 2.6.1 on solaris platform
[quote="Angus Au"]I came across problem in compiling elog 2.6.1 on solaris platform.

Is there any fix ? I can compile elog 2.6.0 successfully on solaris.[/quote]

There is a fix, we have 2.6.1 running on Solaris.

A colleague of me installed it and did mention something about having to go through the source and adapting the 
makefile. I didn't hear him speak of missing libraries though, I will ask him next week.
  1650   Mon Feb 6 08:27:40 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionOther2.6.1Re: compiling elog 2.6.1 on solaris platform

Angus Au wrote:
ld: fatal: library -lutil: not found


The util library was added recently because of the new shell substitution functionaly, which requires the forkpty() function call. If you know in which library the forkpty is available on solaris, the makefile could be adjusted accordingly. If the forkpty is not available at all, we have to disable the shell substitution under solaris via conditional compilation.
  1655   Mon Feb 6 16:44:46 2006 Reply Steve Jonessteve.jones@freescale.comQuestionOther2.6.1Re: compiling elog 2.6.1 on solaris platform

Stefan Ritt wrote:

Angus Au wrote:
ld: fatal: library -lutil: not found


The util library was added recently because of the new shell substitution functionaly, which requires the forkpty() function call. If you know in which library the forkpty is available on solaris, the makefile could be adjusted accordingly. If the forkpty is not available at all, we have to disable the shell substitution under solaris via conditional compilation.



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?

-- Ah, just looked at the docs, I see what that buys us. Surely there is a similar function available that is cross platform?
  1656   Mon Feb 6 16:48:17 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionOther2.6.1Re: compiling elog 2.6.1 on solaris platform

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
  1664   Wed Feb 8 18:19:02 2006 Reply Steve Jonessteve.jones@freescale.comQuestionOther2.6.1Re: compiling elog 2.6.1 on solaris platform

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
  1666   Wed Feb 8 18:34:43 2006 Reply Steve Jonessteve.jones@freescale.comQuestionOther2.6.1Re: 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-2eba886