Hi Mansur,

> Happy New year to all!

A happy New Year to you, and to all readers! :)

> but I get runtime errors:
> [/root/.pil/history:1] File lock: Invalid argument

This must be the fcntl() call in lockFile() (in "src/io.c"). It gets
passed the constant arguments F_SETLKW and F_RDLCK. What might be goes
wrong here?

> # ./pil app/main.l -main -go
> DB write: Invalid argument
> ...
> -rw-r--r--  1 root  wheel  2885162388670120960 Jan  1 11:57 1     <------- 
> Look at file size:

It seems that the runtime system can't handle 64-bit file offsets.

When a PicoLisp database is created, the first two blocks are written.
In case of the demo application, the first DB file has a block size (see
"app/er.l") of 512 bytes:

   (3 +Role +User +Sal)                         # 512 Prevalent objects

Thus, two blocks have a size of 1024 bytes, which is 0x400 in hex. If we
look at the above file size

   : (hex 2885162388670120960)
   -> "280A27E800000400"

we see that the upper 32 bits of the size contain garbage. This
indicates that either 'off_t' isn't 64-bits wide, or the library can't
handle 64-bit file offsets.

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to