* Copyright (c) 1992, 1991 Carnegie Mellon University
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
* Carnegie Mellon requests users of this software to return to
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
* from: Mach, Revision 2.2 92/04/04 11:36:34 rpd
/* #define BUFSIZE 4096 */
char buf
[BUFSIZE
], fsbuf
[SBSIZE
], iobuf
[MAXBSIZE
];
logno
= lblkno(fs
, poff
);
cnt2
= size
= blksize(fs
, &inode
, logno
);
bnum2
= fsbtodb(fs
, block_map(logno
)) + boff
;
if ( (!off
) && (size
<= count
))
bcopy(iodest
+off
,buffer
,size
);
int block
, off
, loc
, ino
= ROOTINO
;
bnum
= fsbtodb(fs
,itod(fs
,ino
)) + boff
;
bcopy(&((struct dinode
*)iodest
)[ino
% fs
->fs_inopb
],
if (!inode
.i_size
|| ((inode
.i_mode
&IFMT
) != IFDIR
))
for (rest
= path
; (ch
= *rest
) && ch
!= '/'; rest
++) ;
if (!(off
= blkoff(fs
, loc
))) {
cnt
= blksize(fs
, &inode
, block
);
bnum
= fsbtodb(fs
, block_map(block
)) + boff
;
dp
= (struct direct
*)(iodest
+ off
);
} while (!dp
->d_ino
|| strcmp(path
, dp
->d_name
));
return(inode
.i_db
[file_block
]);
if ((bnum
=fsbtodb(fs
, inode
.i_ib
[0])+boff
) != mapblock
) {
return (((int *)mapbuf
)[(file_block
- NDADDR
) % NINDIR(fs
)]);
/*******************************************************\
* If bracket given look for preceding device name *
\*******************************************************/
for (devp
= devs
; *devp
; devp
++)
if (name
[0] == (*devp
)[0] &&
printf("Unknown device\n");
/*******************************************************\
* Look inside brackets for unit number, and partition *
\*******************************************************/
if (*cp
>= '0' && *cp
<= '9')
if ((unit
= *cp
++ - '0') > 1)
if (!*cp
|| (*cp
== ',' && !*++cp
))
if (*cp
>= 'a' && *cp
<= 'p')
while (*cp
&& *cp
++!=')') ;
printf("Wangtek unsupported\n");
/***********************************************\
* Now we know the disk unit and part, *
* Load disk info, (open the device) *
\***********************************************/
/***********************************************\
* Load Filesystem info (mount the device) *
\***********************************************/
iodest
= (char *)(fs
= (struct fs
*)fsbuf
);
/***********************************************\
* Find the actual FILE on the mounted device *
\***********************************************/