From owner-freebsd-current Tue Dec 24 10:31:19 2002 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 7001737B401 for ; Tue, 24 Dec 2002 10:31:17 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id C114F43EC2 for ; Tue, 24 Dec 2002 10:31:16 -0800 (PST) (envelope-from rodrigc@attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost [127.0.0.1]) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6) with ESMTP id gBOIVBa7014377; Tue, 24 Dec 2002 13:31:11 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id gBOIVBxM014374; Tue, 24 Dec 2002 13:31:11 -0500 (EST) Date: Tue, 24 Dec 2002 13:31:10 -0500 From: Craig Rodrigues To: freebsd-current@freebsd.org Cc: phk@critter.freebsd.dk Subject: Cannot open "/dev/ad0" on -CURRENT Message-ID: <20021224133110.A14309@attbi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I debugged some more, trying to figure out why I could not add a new partition to my disk using /usr/sbin/sysinstall on -CURRENT. I tracked the problem down to these lines in libdisk's write_i386_disk.c: 98 strcpy(device, _PATH_DEV); 99 strcat(device, d1->name); 100 101 fd = open(device, O_RDWR); 102 if (fd < 0) 103 return 1; According to the debugger, device == "/dev/ad0" I wrote the attached program to open "/dev/ad0". It consistently fails with: fd: -1 Error: : Operation not permitted If I change the program to open one of my SCSI disks, "/dev/da0", it does not fail: fd: 3 Any ideas what the problem could be? Thanks. -- Craig Rodrigues http://www.gis.net/~craigr rodrigc@attbi.com --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="a.c" #include #include #include #include int main(int argc, char *argv[]) { int fd; fd = open("/dev/da0", O_RDWR); printf("fd: %d\n", fd); if(fd < 0 ) { perror("Error: "); } else { close(fd); } return 0; } --G4iJoqBmSsgzjUCe-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message