libc dependency

Nemanja Boric via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 20 04:00:00 PDT 2017


On Monday, 19 June 2017 at 21:45:56 UTC, Moritz Maxeiner wrote:
> On Monday, 19 June 2017 at 21:35:56 UTC, Steven Schveighoffer 
> wrote:
>> IIRC, Tango did not depend on libc at all. It only used system 
>> calls. So it certainly is possible.
>
> How did they invoke those system calls? They are usually access 
> via libc on POSIX systems, so you don't have to implement 
> accessing e.g. vdso on Linux yourself.

Tango just didn't use C abstractions (`FILE*`, say), but rather 
it would call functions such `read(2)`, `write(2)`, `seek(2)`, 
etc. and implement buffering/seeking/etc manually. So, the 
library just declared `extern (C) read (...);`/`extern (C) 
write`.. and expected for the right library (which doesn't have 
to be libc, just the one that exposes these syscall wrappers) 
linked.


More information about the Digitalmars-d-learn mailing list