Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 220 of 796  Not logged in ELOG logo
    icon2.gif   Re: compiling elog on AMD64, posted by Stefan Ritt on Thu Nov 18 09:40:25 2004 
> 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.
    icon2.gif   Re: compiling elog on AMD64, posted by Heiko Scheit on Sun Nov 21 00:46:28 2004 
> > 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.
 
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Willem Koster on Fri Feb 3 13:10:14 2006 
[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.
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 08:27:40 2006 

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.
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Mon Feb 6 16:44:46 2006 

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?
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Stefan Ritt on Mon Feb 6 16:48:17 2006 

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
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:19:02 2006 

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
    icon2.gif   Re: compiling elog 2.6.1 on solaris platform, posted by Steve Jones on Wed Feb 8 18:34:43 2006 

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