----------------------------------------------------------------------------------
@MSGID: 1@dont-email.me> 5745bb4a
@REPLY: 1@reader2.panix.com> 9a3d6c72
@REPLYADDR David Brown <david.brown@hesbynett.no>
@REPLYTO 2:5075/128 David Brown
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@reader2.panix.com>
@TZUTC: 0200
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:60.0)
Gecko/20100101 Thunderbird/60.6.1
@TID: FIDOGATE-5.12-ge4e8b94
On 01/08/2023 23:21, Hul Tytus 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?
>
> Hul
>
It`s a standard C library function. You can see its definition in the C
standards (draft versions of all modern C standards are freely available
online). A good reference for C is the "cppreference" site, with the
exact page here being:
<
https://en.cppreference.com/w/c/numeric/math/div>
The "div" functions are almost never used these days - any decent
compiler will do as good or better when the code is expressed simply as:
sector = offset / SECTOR_SIZE;
offset = offset % SECTOR_SIZE;
But the "div" functions made sense with older and poorer compilers.
--- Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
* Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441