xref: /original-bsd/lib/libc/gen/getbsize.3 (revision c3e32dec)
1.\" Copyright (c) 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getbsize.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt GETBSIZE 3
10.Os BSD 4.4
11.Sh NAME
12.Nm getbsize
13.Nd get user block size
14.Sh SYNOPSIS
15.Fd #include <stdlib.h>
16.Ft char *
17.Fn getbsize "int *headerlenp" "long *blocksizep"
18.Sh DESCRIPTION
19The
20.Nm getbsize
21function determines the user's preferred block size based on the value of the
22.Dq BLOCKSIZE
23environment variable; see
24.Xr environ 7
25for details on its use and format.
26.Pp
27The
28.Nm getbsize
29function returns a pointer to a null-terminated string describing
30the block size, something like
31.Dq 1K-blocks .
32The memory referenced by
33.Fa headerlenp
34is filled in with the length of the string (not including the
35terminating null).
36The memory referenced by
37.Fa blocksizep
38is filled in with block size, in bytes.
39.Pp
40If the user's block size is unreasonable, a warning message is
41written to standard error and the returned information reflects
42a block size of 512 bytes.
43.Sh SEE ALSO
44.Xr df 1 ,
45.Xr du 1 ,
46.Xr ls 1 ,
47.Xr systat 1 ,
48.Xr environ 7
49.Sh HISTORY
50The
51.Nm getbsize
52function call appeared in
53.Bx 4.4 .
54