Re: [xmail] XMail 1.27 released

2010-02-26 Thread Yasuhiko Kamata
Hello, Davide,

Thanks for good news!

But I've just found a problem on a bit older Linux system.

On 1.27, XMail seems to use a eventfd-based event system for faster
shutdown. But two flags (EFD_NONBLOCK, EFD_CLOEXEC) cannot be used
(not defined) on Linux kernel earlier than 2.6.27 as described in man
page (eventfd(3)).

Since Makefile.lnx only checks the existence of sys/eventfd.h,
a compilation of XMail-1.27 fails on Linux  2.6.27 distributions
(this failure is caused by glibc header actually).

I think Makefile.lnx should test not only the presence of it,
but also whether two flags is defined or not.

So I've just created a very simple patch (just grepping instead of
checking file) as follows.

--- xmail-1.27_orig/Makefile.lnx2010-02-26 12:33:44.0 +0900
+++ xmail-1.27/Makefile.lnx 2010-02-26 21:42:01.0 +0900
@@ -44,7 +44,9 @@
 MAINSRC = MainLinux.cpp
 SYSSRCS = SysDepLinux.cpp SysDepUnix.cpp
 
-ifeq ($(wildcard /usr/include/sys/eventfd.h), )
+EVENTFD_DEFINE = $(shell grep -ri EFD_NONBLOCK /usr/include/sys/eventfd.h  
/dev/null 21  echo 1)
+ifeq ($(EVENTFD_DEFINE), )
+# ifeq ($(wildcard /usr/include/sys/eventfd.h), )
 SYSSRCS := $(SYSSRCS) SysOsEventfd_pipe.cpp
 else
 SYSSRCS := $(SYSSRCS) SysOsEventfd_eventfd.cpp

It works fine on openSUSE-11.0 (kernel = 2.6.25.20).

Best regards,

-- 
Yasuhiko Kamata
E-mail: belphe...@belbel.or.jp
___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread fred
Hello Davide,

Thanks for this new release.

I have issues building this on FreeBSD-4.11 32bits, here is what happens:

g++   -D_FILE_OFFSET_BITS=64 -I. -D__UNIX__ -D__BSD__ -D__FREEBSD__
-D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAS_SYSMACHINE -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -O2 -o bin/POP3Utils.o -c
POP3Utils.cpp
POP3Utils.cpp: In function `int UPopCheckMailboxSize(UserInfo *, SYS_OFF_T *
= 0)':
POP3Utils.cpp:156: implicit declaration of function `int atoll(...)'
gmake: *** [bin/POP3Utils.o] Error 1


This refers to this line in POP3Utils.cpp:

SYS_OFF_T llMaxMBSize = Sys_atoi64(pszMaxMBSize) * 1024;





-Original Message-
From: xmail-boun...@xmailserver.org [mailto:xmail-boun...@xmailserver.org]
On Behalf Of Davide Libenzi
Sent: 25 février 2010 23:00
To: XMail mailing list; XMail Announce
Subject: [xmail] XMail 1.27 released

XMail 1.27 is out:

http://www.xmailserver.org/

You need the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
package from Microsoft, to run XMail Windows binaries.
Quick linky is here:

http://tinyurl.com/89msaj



- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread Davide Libenzi
On Fri, 26 Feb 2010, Yasuhiko Kamata wrote:

 Hello, Davide,
 
 Thanks for good news!
 
 But I've just found a problem on a bit older Linux system.
 
 On 1.27, XMail seems to use a eventfd-based event system for faster
 shutdown. But two flags (EFD_NONBLOCK, EFD_CLOEXEC) cannot be used
 (not defined) on Linux kernel earlier than 2.6.27 as described in man
 page (eventfd(3)).
 
 Since Makefile.lnx only checks the existence of sys/eventfd.h,
 a compilation of XMail-1.27 fails on Linux  2.6.27 distributions
 (this failure is caused by glibc header actually).
 
 I think Makefile.lnx should test not only the presence of it,
 but also whether two flags is defined or not.
 
 So I've just created a very simple patch (just grepping instead of
 checking file) as follows.

Will do that, thanks.




 --- xmail-1.27_orig/Makefile.lnx  2010-02-26 12:33:44.0 +0900
 +++ xmail-1.27/Makefile.lnx   2010-02-26 21:42:01.0 +0900
 @@ -44,7 +44,9 @@
  MAINSRC = MainLinux.cpp
  SYSSRCS = SysDepLinux.cpp SysDepUnix.cpp
  
 -ifeq ($(wildcard /usr/include/sys/eventfd.h), )
 +EVENTFD_DEFINE = $(shell grep -ri EFD_NONBLOCK /usr/include/sys/eventfd.h  
 /dev/null 21  echo 1)
 +ifeq ($(EVENTFD_DEFINE), )
 +# ifeq ($(wildcard /usr/include/sys/eventfd.h), )
  SYSSRCS := $(SYSSRCS) SysOsEventfd_pipe.cpp
  else
  SYSSRCS := $(SYSSRCS) SysOsEventfd_eventfd.cpp
 
 It works fine on openSUSE-11.0 (kernel = 2.6.25.20).
 
 Best regards,
 
 -- 
 Yasuhiko Kamata
 E-mail: belphe...@belbel.or.jp
 ___
 xmail mailing list
 xmail@xmailserver.org
 http://xmailserver.org/mailman/listinfo/xmail
 


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread Davide Libenzi
On Fri, 26 Feb 2010, fred wrote:

 Hello Davide,
 
 Thanks for this new release.
 
 I have issues building this on FreeBSD-4.11 32bits, here is what happens:
 
 g++   -D_FILE_OFFSET_BITS=64 -I. -D__UNIX__ -D__BSD__ -D__FREEBSD__
 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAS_SYSMACHINE -D_GNU_SOURCE
 -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -O2 -o bin/POP3Utils.o -c
 POP3Utils.cpp
 POP3Utils.cpp: In function `int UPopCheckMailboxSize(UserInfo *, SYS_OFF_T *
 = 0)':
 POP3Utils.cpp:156: implicit declaration of function `int atoll(...)'
 gmake: *** [bin/POP3Utils.o] Error 1
 
 
 This refers to this line in POP3Utils.cpp:
 
 SYS_OFF_T llMaxMBSize = Sys_atoi64(pszMaxMBSize) * 1024;

No atoll() on FreeBSD?!?
In every one of them, or only in older ones?


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread Davide Libenzi
On Fri, 26 Feb 2010, fred wrote:

 Hello Davide,
 
 Thanks for this new release.
 
 I have issues building this on FreeBSD-4.11 32bits, here is what happens:
 
 g++   -D_FILE_OFFSET_BITS=64 -I. -D__UNIX__ -D__BSD__ -D__FREEBSD__
 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAS_SYSMACHINE -D_GNU_SOURCE
 -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -O2 -o bin/POP3Utils.o -c
 POP3Utils.cpp
 POP3Utils.cpp: In function `int UPopCheckMailboxSize(UserInfo *, SYS_OFF_T *
 = 0)':
 POP3Utils.cpp:156: implicit declaration of function `int atoll(...)'
 gmake: *** [bin/POP3Utils.o] Error 1
 
 
 This refers to this line in POP3Utils.cpp:
 
 SYS_OFF_T llMaxMBSize = Sys_atoi64(pszMaxMBSize) * 1024;

Can you check if at least strtoll() is there?


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread Davide Libenzi
On Fri, 26 Feb 2010, Yasuhiko Kamata wrote:

 Hello, Davide,
 
 Thanks for good news!
 
 But I've just found a problem on a bit older Linux system.
 
 On 1.27, XMail seems to use a eventfd-based event system for faster
 shutdown. But two flags (EFD_NONBLOCK, EFD_CLOEXEC) cannot be used
 (not defined) on Linux kernel earlier than 2.6.27 as described in man
 page (eventfd(3)).
 
 Since Makefile.lnx only checks the existence of sys/eventfd.h,
 a compilation of XMail-1.27 fails on Linux  2.6.27 distributions
 (this failure is caused by glibc header actually).
 
 I think Makefile.lnx should test not only the presence of it,
 but also whether two flags is defined or not.
 
 So I've just created a very simple patch (just grepping instead of
 checking file) as follows.
 
 --- xmail-1.27_orig/Makefile.lnx  2010-02-26 12:33:44.0 +0900
 +++ xmail-1.27/Makefile.lnx   2010-02-26 21:42:01.0 +0900
 @@ -44,7 +44,9 @@
  MAINSRC = MainLinux.cpp
  SYSSRCS = SysDepLinux.cpp SysDepUnix.cpp
  
 -ifeq ($(wildcard /usr/include/sys/eventfd.h), )
 +EVENTFD_DEFINE = $(shell grep -ri EFD_NONBLOCK /usr/include/sys/eventfd.h  
 /dev/null 21  echo 1)

Done, but this better be:

ifeq ($(shell grep -q EFD_NONBLOCK /usr/include/sys/eventfd.h  /dev/null 21 
 echo 1), )


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread fred
Hello,

Yes, it looks like strtoll() is supported:

# ./test str 1234
strtoll() returned 42672981

I have compiled a quick example that is using strtoll(), the output is what
I have pasted above:

#include stdlib.h
#include limits.h
#include stdio.h
#include errno.h

int
main(int argc, char *argv[])
{
int base;
char *endptr, *str;
long val;

   if (argc  2) {
fprintf(stderr, Usage: %s str [base]\n, argv[0]);
exit(EXIT_FAILURE);
}

   str = argv[1];
base = (argc  2) ? atoi(argv[2]) : 10;

   errno = 0;/* To distinguish success/failure after call */
val = strtoll(str, endptr, base);

   /* Check for various possible errors */

   if ((errno == ERANGE  (val == LONG_MAX || val == LONG_MIN))
|| (errno != 0  val == 0)) {
perror(strtol);
exit(EXIT_FAILURE);
}

   if (endptr == str) {
fprintf(stderr, No digits were found\n);
exit(EXIT_FAILURE);
}

   /* If we got here, strtol() successfully parsed a number */

   printf(strtol() returned %ld\n, val);

   if (*endptr != '\0')/* Not necessarily an error... */
printf(Further characters after number: %s\n, endptr);

   exit(EXIT_SUCCESS);
}


-Original Message-
From: xmail-boun...@xmailserver.org [mailto:xmail-boun...@xmailserver.org]
On Behalf Of Davide Libenzi
Sent: 26 février 2010 11:10
To: XMail Users Mailing List
Subject: Re: [xmail] XMail 1.27 released

On Fri, 26 Feb 2010, fred wrote:

 Hello Davide,

 Thanks for this new release.

 I have issues building this on FreeBSD-4.11 32bits, here is what happens:

 g++   -D_FILE_OFFSET_BITS=64 -I. -D__UNIX__ -D__BSD__ -D__FREEBSD__
 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAS_SYSMACHINE -D_GNU_SOURCE
 -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -O2 -o bin/POP3Utils.o -c
 POP3Utils.cpp
 POP3Utils.cpp: In function `int UPopCheckMailboxSize(UserInfo *, SYS_OFF_T
*
 = 0)':
 POP3Utils.cpp:156: implicit declaration of function `int atoll(...)'
 gmake: *** [bin/POP3Utils.o] Error 1


 This refers to this line in POP3Utils.cpp:

 SYS_OFF_T llMaxMBSize = Sys_atoi64(pszMaxMBSize) * 1024;

Can you check if at least strtoll() is there?


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


Re: [xmail] XMail 1.27 released

2010-02-26 Thread Davide Libenzi
On Fri, 26 Feb 2010, fred wrote:

 Hello,
 
 Yes, it looks like strtoll() is supported:

Thanks! I made all Unixes use strtoll() now.


- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail


[xmail] XMail 1.27 released

2010-02-25 Thread Davide Libenzi
XMail 1.27 is out:

http://www.xmailserver.org/

You need the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) 
package from Microsoft, to run XMail Windows binaries.
Quick linky is here:

http://tinyurl.com/89msaj



- Davide


___
xmail mailing list
xmail@xmailserver.org
http://xmailserver.org/mailman/listinfo/xmail