Re[2]: LFS support on AIX 4.3.3
Andrew Tridgell [EMAIL PROTECTED] wrote: Speaking of this, does anyone know a portable way to get printf to handle off_t values when they may be larger that a long? Is there none? The best way I know of is what I used in other places in rsync, which is this: off_t foo = ; printf("seek to %.0f\n", (double)foo); I know using a double is ugly, but it seems to be the only portable solution. Well, there IS this silliness (this won't compile, its just pseudo-code, as its been a while since I've had to do this): union hacko_union { off_t foo; long foolongs[2]; }; void printbigstuff(off_t biggie) { hacko_union theUnion; theUnion.foo = biggie; if (theUnion.foolongs[0]) { printf("%d%012d",theUnion.foolongs[0],theUnion.foolongs[1]); } else { printf("%d",theUnion.foolongs[1]); } } the most non-portable thing here, I think, is figuring out how many elements to put into your foolongs (then of course you've got to do more 'cases' for leading zero stuff). Oh - wait! I forgot - when I did this I limited the range of foolongs[1] to a power of 10. Shoot! Never mind! Ok, so the only other option would be to write an 'arbitrary length' printf routine that you pass longer-than-long things to and it prints them... (Gag, implementing printf manually again!) If it seems like a good idea (for pretty small values of good, I think!) I'd be happy to come up with something (that actually compiles ;-) if there's no huge hurry for it (The above stuff is such a hack I kinda hate to admit I came up with it! ;-) rc Rusty Carruth Email: [EMAIL PROTECTED] or [EMAIL PROTECTED] Voice: (480) 345-3621 SnailMail: Schlumberger ATE FAX: (480) 345-8793 7855 S. River Parkway, Suite 116 Ham: N7IKQ @ 146.82+,pl 162.2 Tempe, AZ 85284-1825 ICBM: 33 20' 44"N 111 53' 47"W
Re: LFS support on AIX 4.3.3
On 20 Mar 2001, Rusty Carruth [EMAIL PROTECTED] wrote: Well, there IS this silliness (this won't compile, its just pseudo-code, as its been a while since I've had to do this): union hacko_union { off_t foo; long foolongs[2]; }; Well, we do already have our own public domain snprintf in the distribution, so I guess we could add support for %j to that, and then use it if the system libraries don't support it. Perhaps later. -- Martin
Re: LFS support on AIX 4.3.3
Speaking of this, does anyone know a portable way to get printf to handle off_t values when they may be larger that a long? Is there none? The best way I know of is what I used in other places in rsync, which is this: off_t foo = ; printf("seek to %.0f\n", (double)foo); I know using a double is ugly, but it seems to be the only portable solution.
Re: LFS support on AIX 4.3.3
On 17 Mar 2001, Christopher Yeoh [EMAIL PROTECTED] wrote: Hmmm. The following printf("seek to %jd\n", (intmax_t) foo); might do what you want. Its not in SUSv2 but is in the Austin drafts so I'm not sure how widely implemented it is. That's neat. Thankyou. Sadly gcc 2.95.3 does not seem to understand %jd with -Wformat, so we get lots of compiler warnings. When it does, I think I will put this in, with an autoconf test that it is understood. -- Martin Pool Linux is the gateway drug for freedom. -- Don Marti
Re: LFS support on AIX 4.3.3
On Fri, Mar 16, 2001 at 04:39:18PM +1100, Martin Pool wrote: On 15 Mar 2001, "Willeat, Todd" [EMAIL PROTECTED] wrote: http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/prg_lr_files.htm explains how to enable large file support on AIX. The fillowing line was added to the config.h file: #define _LARGE_FILES 1 I committed this to rsync.h (v1.98), so it should be in 2.4.7. It's unconditionally defined. If somebody on AIX could build from anoncvs and confirm that it works that would be great. (Mail me if you would like help with CVS.) ICK! Please undo your change. Defining _LARGE_FILES as is done in rsync.h means everyone will be impacted (Solaris, HP-UX, IRIX, Linux, FreeBSD, Tru64 UNIX, ...). Discussion has already occurred on this list about LFS support: http://lists.samba.org/pipermail/rsync/2000-May/002182.html http://lists.samba.org/pipermail/rsync/2000-May/002199.html If the current configure test is broken for AIX, the autoconf test should be fixed. Also, Andrew is probably going to move away from the explicit use of 64-bit data types (like off64_t). Paul Eggert has written an autoconf macro, AC_SYS_LARGEFILE, which is now a *standard* part of autoconf in CVS, that detects what to add to CFLAGS and LDFLAGS to get LFS support on your OS. I think this is the direction we should head. -- albert chin ([EMAIL PROTECTED])
RE: LFS support on AIX 4.3.3
I agree that it would be better to fix the autoconf rather than risk breaking things on other OSes. I have recompiled a few more times with the -D_LARGE_FILES option and I think everything is working correctly now. The dry run gave no errors and so far the transfer is working fine. My compiler did produce an informational message about increasing MAXMEM to a value greater than 2048, but if my current transfer finishes OK, I'm not going to mess with it... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 3:24 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: LFS support on AIX 4.3.3 On Fri, Mar 16, 2001 at 04:39:18PM +1100, Martin Pool wrote: On 15 Mar 2001, "Willeat, Todd" [EMAIL PROTECTED] wrote: http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/prg_lr_ files.htm explains how to enable large file support on AIX. The fillowing line was added to the config.h file: #define _LARGE_FILES 1 I committed this to rsync.h (v1.98), so it should be in 2.4.7. It's unconditionally defined. If somebody on AIX could build from anoncvs and confirm that it works that would be great. (Mail me if you would like help with CVS.) ICK! Please undo your change. Defining _LARGE_FILES as is done in rsync.h means everyone will be impacted (Solaris, HP-UX, IRIX, Linux, FreeBSD, Tru64 UNIX, ...). Discussion has already occurred on this list about LFS support: http://lists.samba.org/pipermail/rsync/2000-May/002182.html http://lists.samba.org/pipermail/rsync/2000-May/002199.html If the current configure test is broken for AIX, the autoconf test should be fixed. Also, Andrew is probably going to move away from the explicit use of 64-bit data types (like off64_t). Paul Eggert has written an autoconf macro, AC_SYS_LARGEFILE, which is now a *standard* part of autoconf in CVS, that detects what to add to CFLAGS and LDFLAGS to get LFS support on your OS. I think this is the direction we should head. -- albert chin ([EMAIL PROTECTED])
Re: LFS support on AIX 4.3.3
On 16 Mar 2001, [EMAIL PROTECTED] wrote: ICK! Please undo your change. Defining _LARGE_FILES as is done in rsync.h means everyone will be impacted (Solaris, HP-UX, IRIX, Linux, FreeBSD, Tru64 UNIX, ...). Discussion has already occurred on this list about LFS support: OK, I'll take it out. Thankyou for catching this. If the current configure test is broken for AIX, the autoconf test should be fixed. Also, Andrew is probably going to move away from the explicit use of 64-bit data types (like off64_t). Paul Eggert has written an autoconf macro, AC_SYS_LARGEFILE, which is now a *standard* part of autoconf in CVS, that detects what to add to CFLAGS and LDFLAGS to get LFS support on your OS. I think this is the direction we should head. That sounds like a more clean solution. So, that will just automatically make off_t be as long as possible? -- Martin Pool, Human Resource Linuxcare. Inc. +61 2 6262 8990 [EMAIL PROTECTED], http://linuxcare.com.au/ Linuxcare. Putting Open Source to work.
Re: LFS support on AIX 4.3.3
Speaking of this, does anyone know a portable way to get printf to handle off_t values when they may be larger that a long? Is there none? I normally write off_t foo = ; printf("seek to %ld\n", (long) foo); accepting that for long values on some platforms it will just be wrong. Is there a better solution that's not gcc or glibc-specific? From what I've seen of the standards, there is no standard format longer than %ld, but off_t can be longer than long. I guess perhaps I could use autoconf to work out appropriate format strings and typecasts: #define OFF_T_PRINT_FORMAT "%lld" #define OFF_T_PRINT_CAST(long long) printf("seek to " OFF_T_PRINT_FORMAT, OFF_T_PRINT_CAST foo); I don't care so much about this in rsync, but librsync trace and error messages do this all the time, and it's bothered me that they might give the wrong values. -- Martin Pool, Human Resource Linuxcare. Inc. +61 2 6262 8990 [EMAIL PROTECTED], http://linuxcare.com.au/ Linuxcare. Putting Open Source to work.
Re: LFS support on AIX 4.3.3
On Sat, Mar 17, 2001 at 11:22:31AM +1100, Martin Pool wrote: On 16 Mar 2001, [EMAIL PROTECTED] wrote: ICK! Please undo your change. Defining _LARGE_FILES as is done in rsync.h means everyone will be impacted (Solaris, HP-UX, IRIX, Linux, FreeBSD, Tru64 UNIX, ...). Discussion has already occurred on this list about LFS support: OK, I'll take it out. Thankyou for catching this. Great! If the current configure test is broken for AIX, the autoconf test should be fixed. Also, Andrew is probably going to move away from the explicit use of 64-bit data types (like off64_t). Paul Eggert has written an autoconf macro, AC_SYS_LARGEFILE, which is now a *standard* part of autoconf in CVS, that detects what to add to CFLAGS and LDFLAGS to get LFS support on your OS. I think this is the direction we should head. That sounds like a more clean solution. So, that will just automatically make off_t be as long as possible? As long as possible to support LFS, which might not be "as long as possible". -- albert chin ([EMAIL PROTECTED])
Re: LFS support on AIX 4.3.3
Martin Pool writes: I normally write off_t foo = ; printf("seek to %ld\n", (long) foo); accepting that for long values on some platforms it will just be wrong. Is there a better solution that's not gcc or glibc-specific? From what I've seen of the standards, there is no standard format longer than %ld, but off_t can be longer than long. Hmmm. The following printf("seek to %jd\n", (intmax_t) foo); might do what you want. Its not in SUSv2 but is in the Austin drafts so I'm not sure how widely implemented it is. Chris. -- [EMAIL PROTECTED] Support Open Source Ice-Cream
LFS support on AIX 4.3.3
http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/prg_lrg _files.htm explains how to enable large file support on AIX. The fillowing line was added to the config.h file: #define _LARGE_FILES 1 Todd Willeat UNIX Administrator ...OLE_Obj... 40 Corporate Center 425 South Woods Mill Road Chesterfield, Missouri 63017-3492 Phone: (314) 214-2329 Fax: (314) 214-8202 E-Mail: [EMAIL PROTECTED] Web: http://www.mercyhealthplans.com/
Re: LFS support on AIX 4.3.3
On 15 Mar 2001, "Willeat, Todd" [EMAIL PROTECTED] wrote: http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/prg_lr_files.htm explains how to enable large file support on AIX. The fillowing line was added to the config.h file: #define _LARGE_FILES 1 I committed this to rsync.h (v1.98), so it should be in 2.4.7. It's unconditionally defined. If somebody on AIX could build from anoncvs and confirm that it works that would be great. (Mail me if you would like help with CVS.) Thanks, -- Martin Pool
LFS support on AIX 4.3.3
I've installed rsync 2.4.6 on 2 DEC Alphas and 1 IBM RS/6000. I need to transfer some files that are 2.5GB. Everything works find between the DECs, but not with the IBM. On the IBM, I have a problem with files over 2GB. I have successfully concatenated several files into 1 file approx 2.5GB, so there should be not filesystem or ulimit problems. I used IBM C for AIX, V5 to compile it. Can anyone tell me how to compile rsync to handle files over 2GB on the IBM? Todd Willeat UNIX Administrator ...OLE_Obj... 40 Corporate Center 425 South Woods Mill Road Chesterfield, Missouri 63017-3492 Phone: (314) 214-2329 Fax: (314) 214-8202 E-Mail: [EMAIL PROTECTED] Web: http://www.mercyhealthplans.com/