From Newsgroup: comp.arch.embedded
On 2023-08-01, Hul Tytus <
ht@panix.com> wrote:
Lewin Edwards in his dosfs file system uses the ldiv() functions shown below:
sector = ldiv(offset, SECTOR_SIZE).quot and
offset = ldiv(offset, SECTOR_SIZE).rem
Anybody know how this is declared or, maybe, defined?
$ man ldiv
------------------------------------------------------------------------------ div(3) Library Functions Manual div(3)
NAME
div, ldiv, lldiv, imaxdiv - compute quotient and remainder of an inte‐
ger division
LIBRARY
Standard C library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
div_t div(int numerator, int denominator);
ldiv_t ldiv(long numerator, long denominator);
lldiv_t lldiv(long long numerator, long long denominator);
#include <inttypes.h>
imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator);
[...]
--- Synchronet 3.20a-Linux NewsLink 1.114