1 .\" Copyright (C) 2023 Alejandro Colomar <alx@kernel.org>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH roundup 3 (date) "Linux man-pages (unreleased)"
7 roundup \- round up in steps
13 .B #include <sys/param.h>
15 .BI roundup( x ", " step );
20 to the nearest multiple of
25 It is typically used for
26 rounding up a pointer to align it or
27 increasing a buffer to be allocated.
29 This API is not designed to be generic,
30 and doesn't work in some cases
31 that are not important for the typical use cases described above.
34 This macro returns the rounded value.
38 The arguments may be evaluated more than once.
41 should be nonnegative,
48 would overflow or wrap around,
49 the behavior is undefined.