boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

002-write-libc.c (475B)


      1 /* posix/write.c -> boot2-syscall.c::_write -> P1pp sys_write.
      2  * Adds the public `write(int, const void *, size_t)` layer with errno
      3  * handling on top of 01-write-syscall. cc.scm rejects #include
      4  * (file inclusion is upstream of cc.scm via host -E pre-flatten); use
      5  * extern decls directly. */
      6 typedef unsigned long size_t;
      7 typedef long ssize_t;
      8 
      9 extern ssize_t write (int fd, void const *buffer, size_t size);
     10 
     11 int
     12 main (void)
     13 {
     14   write (1, "hello\n", 6);
     15   return 0;
     16 }