Article delegate-en/4651 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A4649@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: FTP Delegate
18 Nov 2009 01:10:13 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi Frederic,

In message <_A4649@delegate-en.ML_> on 11/18/09(00:42:35)
you frederic montiton <pbijabdyi-p5lznxp3gjxr.ml@ml.delegate.org> wrote:
 |Unfortunatly I use a Sparc processor, "SunOS 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V245", so I can't try your binary.
 |
 |I've found in fpoll.h
 |
 |#if defined(sun) && defined(__x86_64__)
 |#define READYCC(fp)     ((int*)fp)[6]
 |
 |May be I can try without "&&defined(__x86_64__)" part ? 

Hmm... Thank you, I see.  I added the line in fpoll.h at 9.8.0 for
Solaris10/AMD64 two years ago.

  [CHANGES]
  9.8.0 071102 fix {yselect,fpoll}.h: coped with CFLAGS=-m64 on Solaris10/amd64

There are test files at that time left on my Solaris10 host:

  -rw-r--r--   1 yutaka        109 Nov  3  2007 DELEGATE_CONF64
  drwxr-xr-x  17 yutaka       1024 Nov  3  2007 delegate9.8.0-pre6
  -rw-r--r--   1 yutaka        326 Nov  3  2007 p.c

  % cat DELEGATE_CONF64
  ADMIN=
  CFLAGS=-O2 -m64
  LDOPTS=-m64
  NETLIB=-lnsl -lsocket -ldl -lpam -lpthread /usr/sfw/lib/amd64/libstdc++.a

  % cat p.c
  #include <stdio.h>
  int main(int ac,char *av[]){
        int c;
        int *f;
        int i;

        c = getc(stdin);
        f = (int*)stdin;
        printf("%2X %3d %8llX %8llX %8llX %8llX : %d\n",
                c,sizeof(FILE),f[0],f[1],f[2],f[3],
                *(int*)stdin);
        for(i = 0; i < sizeof(FILE)/sizeof(int); i++ )
                printf("[%2d] %16llX\n",i,f[i]);
        printf("\n");
        return 0;
  }

I'm reminded that I did like above on the WindowsCE version where the
FILE structure is opaque too.
I found the location of "_cnt" in the FILE structure for -m64 as follows.

  % g++ -m64 p.c
  % echo xxxx | a.out      #### 4 bytes into stdin
  78 128   411A25        0   411A24 FFFFFD7F00000000 : 4266533
  [ 0]           411A25
  [ 1]                0
  [ 2]           411A24
  [ 3]                0
  [ 4]           412E24
  [ 5]                0
  [ 6]                4    #### 4 bytes in the buffer
  [ 7]                0
  [ 8]                0
 
  % echo xxxxxxxx | a.out  #### 8 bytes into stdin
  78 128   411A25        0   411A24 FFFFFD7F00000000 : 4266533
  [ 0]           411A25
  [ 1]                0
  [ 2]           411A24
  [ 3]                0
  [ 4]           412E24
  [ 5]                0
  [ 6]                8    #### 8 bytes in the buffer
  [ 7]                0
  [ 8]                0

If you get the same result, you can use it on Solaris/SPARC too.
Then I'll change fpoll.h as follows:

  ! #if defined(sun) && defined(__x86_64__)
    #define READYCC(fp)     ((int*)fp)[6]
  --
  ! #if defined(sun) && defined(m64)
    #define READYCC(fp)     ((int*)fp)[6]

Of course it might have to be adjusted in future version of Solaris where
the offset of _cnt is changed and binary compatibiliy is lost :)
By the way, during the test this time, I found that the byte count recorded
in the Xferlog output is in 32bits ;)


 |-DNONC99 flag was not from my compilation configuration, it had been added by mkmake.c if I'm not wrong.

I see.  It might be automatically set at the very start of make for mkmake.
It is expected as follows:

        mkmake:
        av[4] 'if(UNIX,OS2EMX) -O2' ==> '-O2'
        av[5] 'if(WITHCPLUS,UNIX,OS2EMX) -x c++ -DQS' ==> '-x c++ -DQS'
        [cc -c -O2 -x c++ -DQS] NONC99 = 0

Yutaka
--
  9 9   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V