When I use ar -M to open a large archive, it fails with the following message:
ar: warning: 'OPEN' failed: Invalid argument
ktrace shows the following message:
CALL mmap(0,0x191464cec,0x1<PROT_READ>,0x1<MAP_SHARED>,0x4,0)
RET mmap 34376515584/0x801000000
CALL write(0x3,0x801000000,0x191464cec)
RET write -1 errno 22 Invalid argument
0x191464cec is the size of the archive (6.3 GiB). It may be too large for the write system call on FreeBSD.
Indeed. From write(2):
What version of FreeBSD are you using?
FreeBSD 10.1-RELEASE
Thanks for reporting - see FreeBSD PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196666
You may be able to work around this with a sysctl setting:
but I believe a code change ought to be made so that this works "out of the box," perhaps by calling write() in a loop with a limited amount of data sent at a time
Last edit: Ed Maste 2015-01-13