Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"If you are afraid of loneliness, don't marry." -- Chekhov


devel / comp.arch.embedded / Re: addon functions

SubjectAuthor
* addon functionsHul Tytus
+- Re: addon functionsHans-Bernhard Bröker
+* Re: addon functionsGrant Edwards
|`- Re: addon functionsHul Tytus
`- Re: addon functionsDavid Brown

1
addon functions

<uabt18$qtu$1@reader2.panix.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1622&group=comp.arch.embedded#1622

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.2001:470:30::a654:101!not-for-mail
From: ht...@panix.com (Hul Tytus)
Newsgroups: comp.arch.embedded
Subject: addon functions
Date: Tue, 1 Aug 2023 21:21:44 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <uabt18$qtu$1@reader2.panix.com>
Injection-Date: Tue, 1 Aug 2023 21:21:44 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="2001:470:30::a654:101";
logging-data="27582"; mail-complaints-to="abuse@panix.com"
 by: Hul Tytus - Tue, 1 Aug 2023 21:21 UTC

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

Re: addon functions

<kitcm3Fjvv7U1@mid.dfncis.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1623&group=comp.arch.embedded#1623

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From: HBBroe...@t-online.de (Hans-Bernhard Bröker)
Newsgroups: comp.arch.embedded
Subject: Re: addon functions
Date: Tue, 1 Aug 2023 23:44:35 +0200
Lines: 10
Message-ID: <kitcm3Fjvv7U1@mid.dfncis.de>
References: <uabt18$qtu$1@reader2.panix.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.dfncis.de 5d+kkTVKtYDsNgIZOh7LVgmPoxKU5AQn2NSsgZ+yLstKO91N0QkuEQRi+l
Cancel-Lock: sha1:tL3pi5ccQu0QNE+BG2ptlNCAOlU= sha256:NR7r41+sQe5R2Lb4xeodmfLVwkNI04+F/2fB42Dgts4=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: de-DE
In-Reply-To: <uabt18$qtu$1@reader2.panix.com>
 by: Hans-Bernhard Bröke - Tue, 1 Aug 2023 21:44 UTC

Am 01.08.2023 um 23:21 schrieb Hul Tytus:
> 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?

Seriously? Does every C compiler you use come without a manual?

How else could you possibly find it hard to discover the declaration and
semantics of a 33+ years old C standard library function like that?

Re: addon functions

<uac0ri$6n0$1@reader2.panix.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1624&group=comp.arch.embedded#1624

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.localhost!not-for-mail
From: inva...@invalid.invalid (Grant Edwards)
Newsgroups: comp.arch.embedded
Subject: Re: addon functions
Date: Tue, 1 Aug 2023 22:26:58 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <uac0ri$6n0$1@reader2.panix.com>
References: <uabt18$qtu$1@reader2.panix.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 1 Aug 2023 22:26:58 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="localhost:::1";
logging-data="6880"; mail-complaints-to="abuse@panix.com"
User-Agent: slrn/1.0.3 (Linux)
 by: Grant Edwards - Tue, 1 Aug 2023 22:26 UTC

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);

[...]

Re: addon functions

<uae0ph$5oj9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1625&group=comp.arch.embedded#1625

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: addon functions
Date: Wed, 2 Aug 2023 18:38:08 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uae0ph$5oj9$1@dont-email.me>
References: <uabt18$qtu$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 16:38:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="46e2fd4c97e01cfd809944807e1c85c2";
logging-data="189033"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4pKuqzryKNVk2lMQAk9tqA+ZOZLWAW2M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:qyGvV9FODfPK3zRiDEAxpE9peYk=
Content-Language: en-GB
In-Reply-To: <uabt18$qtu$1@reader2.panix.com>
 by: David Brown - Wed, 2 Aug 2023 16:38 UTC

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.

Re: addon functions

<uaglvp$id9$1@reader2.panix.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1626&group=comp.arch.embedded#1626

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.2001:470:30::a654:101!not-for-mail
From: ht...@panix.com (Hul Tytus)
Newsgroups: comp.arch.embedded
Subject: Re: addon functions
Date: Thu, 3 Aug 2023 16:52:09 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <uaglvp$id9$1@reader2.panix.com>
References: <uabt18$qtu$1@reader2.panix.com> <uac0ri$6n0$1@reader2.panix.com>
Injection-Date: Thu, 3 Aug 2023 16:52:09 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="2001:470:30::a654:101";
logging-data="18857"; mail-complaints-to="abuse@panix.com"
 by: Hul Tytus - Thu, 3 Aug 2023 16:52 UTC

Thanks Grant. I'd never seen those before and assumed they were Lewin's creation.

Hul

Grant Edwards <invalid@invalid.invalid> wrote:
> 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);

> [...]

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor