Ragge's comments on the header issues...
Johnny
-------- Forwarded Message --------
Subject: Re: [PiDP-11] stupid question...
Date: Fri, 18 Apr 2025 08:52:11 +0200
From: Anders Magnusson <
ra...@tethuvudet.se>
To: Johnny Billquist <
b...@softjar.se>,
pid...@googlegroups.com
Morning,
the current stdio package in 2.11BSD is not entirely ansi-compliant, so
I have adapted the 4.4BSD stdio code to 2.11.
It has taken quite some time though, and since it affects everything in
the system I want to be careful.
-- Ragge
>> at which point it just doesthe standard K&R thing, and
>> assumesany
>> argument is an int, unless known to be something else.
>>
>> Johnny
>>
>> On 2025-04-16 22:58, Ville Laitinen wrote:
>> > Hi,
>> >
>> > is it expected a static argument value need to be cast to
>> proper format ?
>> >
>> > fseek for example:
>> > ...
>> > FILE *file =fopen("filtest.c", "r");
>> > ...
>> > rewind(file);
>> > fseek(file, 10, SEEK_SET);
>> > fseek(file, -3, SEEK_CUR);
>> > pos=ftell(file);
>> > printf("pos %lu\n",pos);
>> >
>> > ./a.out
>> > pos 4294770689
>> >
>> > whereas with valuescast to proper format:
>> > ...
>> > FILE *file =fopen("filtest.c", "r");
>> > ...
>> > rewind(file);
>> > fseek(file,(long)10, SEEK_SET);
>> > fseek(file, -3L, SEEK_CUR);
>> > pos=ftell(file);
>> > printf("pos %lu\n",pos);
>> >
>> > ./a.out
>> > pos 7
>> >
>> > with lseek however:
>> > ...
>> > int file = open("filtest.c", O_RDONLY, 0755);
>> > ...
>> > lseek(file,(off_t)0,L_SET);
>> > pos=lseek(file,10,L_SET);
>> > /*pos=lseek(file,pos-3, L_SET);*/
>> > printf("pos %lu\n",pos);
>> >
>> > ./a.out
>> > pos 10
>> >
>> >
>> >
>> >
>> > br,
>> > -V
>> >
>> > --
>> > You received this message because you are subscribed to the
>> Google
>> > Groups "[PiDP-11]" group.
>> > To unsubscribe fromthis group and stop receiving emails from