From owner-freebsd-current@FreeBSD.ORG Fri Jan 28 06:29:10 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C36516A4CE for ; Fri, 28 Jan 2005 06:29:10 +0000 (GMT) Received: from axe-inc.co.jp (axegw.axe-inc.co.jp [61.199.217.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5447543D2D for ; Fri, 28 Jan 2005 06:29:07 +0000 (GMT) (envelope-from takawata@axe-inc.co.jp) Received: from localhost (localhost [127.0.0.1]) by axe-inc.co.jp (8.9.3+3.2W/3.7W) with SMTP id PAA20868 for ; Fri, 28 Jan 2005 15:29:04 +0900 (JST) Message-Id: <200501280629.PAA20868@axe-inc.co.jp> X-Authentication-Warning: axegw.axe-inc.co.jp: localhost [127.0.0.1] didn't use HELO protocol To: freebsd-current@freebsd.org From: takawata@jp.freebsd.org Date: Fri, 28 Jan 2005 15:29:03 +0900 Sender: takawata@axe-inc.co.jp Subject: Cannot cp(1) file from smbfs.(MMAP problem) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2005 06:29:10 -0000 Hi, I have problem when try to copy file by cp(1). When /mnt is smbfs, % cp /mnt/foo.txt /tmp will produce cp: /mnt/foo.txt: Invalid argument And tracing syscall shows that the error is produced by mmap(2). Is it known problem? FreeBSD tmp.init-main.com 6.0-CURRENT FreeBSD 6.0-CURRENT #59: Wed Jan 26 02:29:16 JST 2005 takawata@sana.init-main.com:/usr/obj/usr/src/sys/LIEUTENANT i386 =========- > cat /mnt/foo.txt fugafuga > cp /mnt/foo.txt . cp: /mnt/foo.txt: Invalid argument > cat foo.txt > ls -l foo.txt -rwxr-xr-x 1 takawata wheel 0 1 28 15:24 foo.txt > gcc -o mm mm.c > ./mm foo.txt 3 0x28158000 > ./mm /mnt/foo.txt 3 0xffffffff MMAP: Invalid argument mm: MMAP > cat mm.c #include #include #include #include main(int argc, char * argv[]) { int fd; void *ptr; if(argc <= 1){ exit(-1); } if((fd = open(argv[1], O_RDONLY))== -1){ errx(-1, "OPEN"); } printf("%d\n", fd); ptr = mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, fd, 0); printf("%p\n", ptr); if(ptr == MAP_FAILED){ perror("MMAP"); errx(-1, "MMAP"); } } ======