1
0
Files
2022-09-29 17:59:04 +03:00

47 lines
1.4 KiB
Plaintext

.if n .pH ddi.rm/d2/gen/size @(#)size 43.10 of 3/25/93
.\" Copyright 1992, 1991 UNIX System Laboratories, Inc.
.TH size64 D2
.IX "\f4size64\fP(D2)"
.SH NAME
\f4size64\fP \- return size of logical block device
.SH SYNOPSIS
.nf
.na
.ft 4
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ddi.h>
.sp 0.4
int \f2prefix\fPsize64(dev_t \f2dev\fP, daddr_t *\f2blocks\fP);
.ft 1
.ad
.fi
.SS Arguments
.RS 0
.IP "\f2dev\fP" 10n
The logical device number.
.IP "\f2blocks\fP" 10n
The size of the device in \f4NBPSCTR\fP-byte units (output argument).
.RE
.SH DESCRIPTION
The \f4size64\fP entry point returns in \f2blocks\fP the number of
\f4NBPSCTR\fP-byte units on a logical block device (partition),
if successful. If unsuccessful \-1 is returned in \f2blocks\fP.
\f4NBPSCTR\fP, defined in \f4param.h\fP,
is the number of bytes per logical disk sector.
.SS "Return Values"
On success, the \f4size64\fP routine should return 0;
on failure, the return value should be an error code.
.SH USAGE
This entry point is optional in all block device drivers,
required only when it is possible to have a device whose size
\f4NBPSCTR\fP-byte units will not fit into an \f4int\fP.
.P
\f4size64\fP(D2) is called only when the device is open.
.SS "Synchronization Constraints"
The \f4size64\fP routine has user context and can sleep.
However, it should be careful not to spend much time sleeping,
especially if the routine is called when the logical device is not open.
.SH SEE ALSO
size(D2)