logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: 325116f679777620a37ec55869a88fed0a155259
parent e8dcb21f7e661d27e22bb6179a9977731bfa9396
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  9 Feb 2023 15:26:04 +0100

notes/unix-defects: New page

Diffstat:

Anotes/unix-defects.xhtml43+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+), 0 deletions(-)

diff --git a/notes/unix-defects.xhtml b/notes/unix-defects.xhtml @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> +<!--#include file="/templates/head.shtml" --> + <title>Unix defects — lanodan’s cyber-home</title> + </head> + <body> +<!--#include file="/templates/en/nav.shtml" --> + <main> + <h1>Unix defects</h1> + <p>This tries to list all the defects that are present in Unix, an OS from the early 70's. I consider "Unix" what current Unix clones (BSDs, illumos, Linux, …) have implemented.</p> + + <section> + <h2 id="internet">Internet</h2> + <p>Where Unix isn't internet-ready</p> + + <section id="getaddrinfo"> + <h3><code>getaddrinfo(3)</code>, <code>gethostbyname(3)</code>, …</h3> + <ul> + <li>Cannot handle <a href="https://en.wikipedia.org/wiki/Happy_Eyeballs">Happy Eyeballs</a> (one of the ways to support IPv6)</li> + <li>Doesn't handles <a href="https://en.wikipedia.org/wiki/SRV_record"><code>SRV</code> records</a>, similarly to how email is using <a href="https://en.wikipedia.org/wiki/MX_record"><code>MX</code> records</a> (not handled either but at least it's a special case).</li> + </ul> + <p>Compare this to <a href="http://man.9front.org/2/dial">Plan9 <code>dial(2)</code></a> which also has a nice <code>NetConnInfo</code> structure</p> + </section> + + </section> <!-- internet --> + + <section> + <h2 id="libc">libc and related Unix C shenanigans</h2> + + <section> + <h3><code>NULL</code>-Terminated strings</h3> + <dd> + <dt>Slow</dt><dd>Time taken to obtain the length increases with each <em>byte</em> aka <code class="math">O(n)</code> while length prefix is constant-time <code class="math">O(1)</code>.</dd> + <dt>Unsafe</dt><dd>How do you handle NULL being present in a string? Or NULL being absent?</dd> + </dd> + </section> + + </section> <!-- libc --> + </main> +<!--#include file="/templates/en/footer.shtml" --> + </body> +</html>