Skip site navigation (1)Skip section navigation (2)
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>

next in thread | raw e-mail | index | archive | help

--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 <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;
}

--G4iJoqBmSsgzjUCe--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021224133110.A14309>