site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On 28 May 2009, at 10:22, Robert Homann wrote: Hi all! Therefore, I think the implementation of write() is buggy; or at least, its unexpected behavior in 64 bit mode should be documented on the man page. What do you think? In /usr/include/mach-o/loader.h: =========== << snip >> << snip >> Best regards, Robert Homann -- Windows is not the answer. Windows is the question. The answer is "No". _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/adc%40jeremyp.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I think the behaviour is probably correct in that the OS X kernel is a *32 bit* mach-o object, at least it is on my 10.5.7 Core 2 Duo Macbook Pro. monica:/ jeremyp$ otool -h /mach_kernel /mach_kernel: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 0xfeedface 7 3 0x00 2 12 2808 0x00000001 ^^^^^^^^^^ note the magic number. /* Constant for the magic field of the mach_header (32-bit architectures) */ #define MH_MAGIC 0xfeedface /* the mach magic number */ #define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */ /* * The 64-bit mach header appears at the very beginning of object files for * 64-bit architectures. */ /* Constant for the magic field of the mach_header_64 (64-bit architectures) */ #define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ #define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ =========== write(2) is a system call. The implementation is inside the kernel, not in any user space library linked with your application. Internally, it is going to be subject to 32 bit limits and personally I think that is entirely reasonable. Whilst I admit the kernel could be changed to cope with larger buffers, I think it is a bit harsh to criticise it because the largest block it can write to a file in one go is a mere 2Gb, especially considering some other 32 bit kernels can't run 64 bit code at all. This email sent to adc@jeremyp.net This email sent to site_archiver@lists.apple.com