Lines Matching defs:device

58 extern char	*devattr(char *device, char *attribute);
61 extern int getvol(char *device, char *label, int options, char *prompt);
68 /* device types */
82 #define G_FILE 28 /* file, not a device */
83 #define G_NO_DEV 29 /* device does not require special treatment */
84 #define G_DEV_MAX 30 /* last valid device type */
102 int ds_next(char *device, char *instdir);
103 int ds_ginit(char *device);
107 static int ds_realfd = -1; /* file descriptor for real device */
118 static int ds_getnextvol(char *device);
119 static int ds_skip(char *device, int nskip);
196 ds_readbuf(char *device)
202 if ((ds_fd = open(device, O_RDONLY)) >= 0 &&
214 if (ds_ginit(device) < 0) {
216 logerr(pkg_gt(MSG_OPEN), device, errno);
301 * Read the source device. Acquire the header data and check it for validity.
304 ds_init(char *device, char **pkg, char *norewind)
316 /* always start with rewind device */
317 if ((ds_fd = open(device, O_RDONLY)) < 0) {
319 logerr(pkg_gt(MSG_OPEN), device, errno);
330 /* initialize the device */
331 if (ds_ginit(device) < 0) {
334 logerr(pkg_gt(MSG_OPEN), device, errno);
338 /* read a logical block from the source device */
354 /* only ten tries iff the device rewinds */
367 /* then close the device */
373 logerr(pkg_gt(MSG_OPEN), device, errno);
378 /* initialize the device */
379 if (ds_ginit(device) < 0) {
382 logerr(pkg_gt(MSG_OPEN), device, errno);
412 /* read a logical block from the source device */
425 * remember rewind device for ds_close to rewind at
429 ds_device = device;
533 ds_findpkg(char *device, char *pkg)
541 if (ds_init(device, pkglist, NULL))
576 if (ds_volpart > 0 && ds_getnextvol(device))
579 if (ds_skip(device, ods_volpart))
582 if (ds_skip(device, nskip - ds_totread))
597 ds_getpkg(char *device, int n, char *dstdir)
629 return (ds_next(device, dstdir));
633 ds_getnextvol(char *device)
643 if (n = getvol(device, NULL, NULL, prompt))
645 if ((ds_fd = open(device, O_RDONLY)) < 0)
647 if (ds_ginit(device) < 0) {
660 ds_skip(char *device, int nskip)
676 if (n = ds_getnextvol(device))
688 ds_skiptoend(char *device)
691 (void) ds_skip(device, ds_nparts - ds_read);
695 ds_next(char *device, char *instdir)
704 if (n = ds_getnextvol(device))
725 if (n = ds_getnextvol(device))
744 * device - Description of device being dumped into,
752 BIO_ds_dump(PKG_ERR *err, char *device, BIO *bio)
758 * note this will read to the end of the device, so it won't
764 pkgerr_add(err, PKGERR_WRITE, ERR_WRITE, device,
806 * ds_ginit: Determine the device being accessed, set the buffer size,
807 * and perform any device specific initialization. For the 3B2,
808 * a device with major number of 17 (0x11) is an internal hard disk,
820 ds_ginit(char *device)
837 if ((pbufsize = devattr(device, "bufsize")) != NULL) {
897 if ((ds_fd = open(device, nflag, 0666)) != -1) {
903 open(device, nflag, 0666)) == -1) {
908 device, errno);
1027 /* rewind device */