Date: Tue, 24 Dec 2002 13:31:10 -0500 From: Craig Rodrigues <rodrigc@attbi.com> To: freebsd-current@freebsd.org Cc: phk@critter.freebsd.dk Subject: Cannot open "/dev/ad0" on -CURRENT Message-ID: <20021224133110.A14309@attbi.com>
index | next in thread | raw e-mail
[-- Attachment #1 --]
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
[-- Attachment #2 --]
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
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;
}
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021224133110.A14309>
