<?xml version="1.0" encoding="iso-8859-1"?>


<rss version="2.0">
   <channel>
    <title>Brent Blood&apos;s Blog</title>
    <link>http://www.b-rent.com/blog/</link>
    <description>Brent's last 10 things</description>
    <language>en-us</language>
    <copyright>Copyright 2004 Brent Blood</copyright>
    <managingEditor>brent@ownsu.net</managingEditor>
    <webMaster>brent@ownsu.net</webMaster>
    <pubDate>2008-06-23T19:55:59-08:00</pubDate>
    <lastBuildDate>2008-06-23T19:55:59-08:00</lastBuildDate>
    <generator>biggidy version 0.1</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>

    <item>
        <title>On utimes()</title>
        <link>http://www.b-rent.com/blog/posts/2441.html</link>
        <description><![CDATA[<p>I was writing a small piece of code yesterday that made a call to utimes(). The UNIX programmers manual for that system call includes the function prototype: it returns an int, and takes a char pointer as well as a pointer to a timeval structure as arguments. Not really much to it, right? Imagine my frustration when my program was always setting the mtime to Dec 30, 1969 regardless of what value I provided!</p>

<p>Only after reading the whole manpage a few times did I catch that the second argument wasn't just a pointer to a timeval structure - it was an array of two timeval structures. And since when passed as a function argument, an array degrades to a pointer to the first array element, the prototype wasn't so much wrong as it was ambiguous - which I guess is why they explained it in the manual. Accepting this did not lessen my frustration.</p>

<p>My mtime was being set to the UNIX epoch because utimes was using the atime that I passed, and then reading the next block of memory (which happened to be 0 - hence the date) and using that for the mtime. I'm lucky the next block of memory was mapped to my program and it didn't SIGSEGV! But I fixed my bug and the program now works.</p>

<p>Sometimes I hate UNIX.</p>

<p>So I did some reading just now. My copy of <i>Advanced Programming in the UNIX Environment</i> is an edition behind, but still worth having around. I knew that utimes() had replaced utime(), and so I hadn't looked at utime(). I did tonight, and it handles this situation by taking a pointer to a timbuf structure. This structure has two members of type time_t. So this is effectively the same idea as utimes(), only rather than advertising a call signature that took a pointer to a struct when it actually needed an array, this older, deprecated, function handled it in what would seem a more elegant way: by defining a new datatype that explicitly contains the two values it needs. I wonder why they deprecated it and bothered with utimes()... I suppose to handle granularity of less than 1 second.</p>

<p>Sometimes I hate UNIX.</p>]]></description>
        <pubDate>2008-06-23T19:55:59-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2441.html</guid>
    </item>

    <item>
        <title>On My New Sun Netra X1</title>
        <link>http://www.b-rent.com/blog/posts/2440.html</link>
        <description><![CDATA[<p>I don't troll eBay like I used to - and since <a href="/blog/posts/2400.html">the great purge</a>, I've had a strict policy of not collecting cruft. But when I saw an auction for a teeny-tiny 1U Sun server for $15, I figured I had to put in a bid and see what happened. I could have used "buy it now" for $20, but I told myself that I didn't need it, and if it was really meant-to-be, then I'd win the auction at $15. And that's what I did.</p>

<p>I thought I was fairly familiar with most of Sun's server line since I've been a long-time fan of their systems, but I was completely unaware that they ever made anything this tiny. It's only 13" deep, fits in 1U of rackspace (which is perfect for me since I only have a half-depth rack at home). I upgraded the memory to 1GB using a few sticks of PC133 ECC CL2 memory I had lying around as well as a bigger/faster/cooler disk. It's got a pair of fast ethernet ports, a single USB 1.1 port, and a pair of serial ports - and that's it. No expandability what-so-ever. But that's fine. Both serial ports are RJ11 and uses the same pinout as a Cisco console (how pleasantly surprising yet convenient) and the first port doubles as the system console and as the interface to the integrated lights out management.</p>

<p>The ILOM is pretty cool - people complain about it on the web saying it's crap, but it seems pretty tight to me. Even when the system is powered off, the service processor is available, and lets you power the system up remotely, run diagnostics, or reboot the host. I really like that.</p>

<p>Here's the real icing on the cake though. The auction claimed it had a 500MHz UltraSPARC IIe processor, but when it got here, it only comes up as 400. Not really a terrible mistake, but I wrote the seller and mentioned it to them and they refunded my entire purchase price, including shipping.</p>

<p>Now I just need to figure out what I'm going to do with it. For now, it's got a fresh install of OpenBSD.</p>]]></description>
        <pubDate>2008-06-14T10:36:06-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2440.html</guid>
    </item>

    <item>
        <title>On Fallen Logos</title>
        <link>http://www.b-rent.com/blog/posts/2439.html</link>
        <description><![CDATA[<p>So I'm sitting at my desk just now drinking a cup of coffee when out of nowhere the "NY" logo on my coffee cup just falls off. It had merely been glued on, and the emblem is solid pewter, so it isn't all that unbelievable. But still, it made me shudder. I'm not normally a superstitious man, but this thought struck me: what if Derek Jeter just died?</p>]]></description>
        <pubDate>2008-06-09T07:20:44-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2439.html</guid>
    </item>

    <item>
        <title>On "It Is What It Is"</title>
        <link>http://www.b-rent.com/blog/posts/2438.html</link>
        <description><![CDATA[<p>Everybody stop saying "it is what it is". Just stop it.</p>]]></description>
        <pubDate>2008-05-28T17:22:37-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2438.html</guid>
    </item>

    <item>
        <title>On Starting Lineups</title>
        <link>http://www.b-rent.com/blog/posts/2437.html</link>
        <description><![CDATA[<p>I haven't really watched all that much NBA basketball since, well, since Reggie Lewis died. But I usually watch a few playoff games, and this year the Celtics are supposed to win it all, so I've caught most of their games. These aren't <i>my</i> Celtics, but they're entertaining all the same.</p>

<p>Know what's not entertaining though? The starting lineup ceremony for the Detroit Pistons. What a waste of time. Is that really what today's basketball fans want?</p>]]></description>
        <pubDate>2008-05-26T16:40:02-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2437.html</guid>
    </item>

    <item>
        <title>On Being Bossed Around</title>
        <link>http://www.b-rent.com/blog/posts/2436.html</link>
        <description><![CDATA[<p>Linda likes to tell me what to do. I don't always do what she says, but that doesn't mean that she doesn't try. The following conversation took place yesterday when she told me to do something:</p>

<p>"Linda, you always tell me what to do."</p>

<p>"You always say that."</p>

<p>"Yeah, I usually say that after you tell me to do something."</p>

<p>She of course doesn't agree with any of this. That also doesn't mean that it doesn't happen. She also just threatened to beat me up.</p>]]></description>
        <pubDate>2008-05-18T18:12:49-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2436.html</guid>
    </item>

    <item>
        <title>On Band of Horses</title>
        <link>http://www.b-rent.com/blog/posts/2435.html</link>
        <description><![CDATA[<p>How is it that nobody told me about "Band of Horses" until now? I haven't listened to another band since last week.</p>]]></description>
        <pubDate>2008-04-02T11:37:09-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2435.html</guid>
    </item>

    <item>
        <title>On Being BWB</title>
        <link>http://www.b-rent.com/blog/posts/2434.html</link>
        <description><![CDATA[<p>It's not uncommon for people in my line of work to be known by their initials even to the point that they sign correspondence that way. I considered closing an email with "-bwb" today but I just couldn't do it. It's just not me.</p>]]></description>
        <pubDate>2008-02-07T21:08:42-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2434.html</guid>
    </item>

    <item>
        <title>On Subdomain</title>
        <link>http://www.b-rent.com/blog/posts/2433.html</link>
        <description><![CDATA[<p>So today at work I'm working on a fairly interesting problem. A customer is having a problem that we think is stemming from a shared library that we ship on one of our products. We cannot reproduce this problem, but the customer sees the issue several times a day, so we are rolling an instrumented binary that'll give us more information on what's happening so that we can address the issue.</p>

<p>This particular shared library is linked to by almost every custom daemon that we ship - and that's like, 20 or 30 fairly big and complex programs. Hence, we'd rather not replace the system-wide library since any changes might just have serious unintended consequences, and on a customer's production systems, that would be the very definition of "a bad thing". So I suggest that we force this one program to use our customer version by using some linker trickery and it's agreed that in this case it makes sense.</p>

<p>So I get to playing around with it all and I notice that when I try to view what this daemon is linked against, I don't get any output. ldd works for almost everything else I try it on, and when I copy the binary to my workstation it works, but not on my test system. I try it on a few others, and they all fail. WTF? I play around with ldd and $LD_TRACE_LOADED_OBJECTS and copy over binaries for readelf and other binutils and I'm just getting pissed off because it just doesn't make any sense. So I bring it up in a meeting and a little while later, a coworker tells me he was hacking around and figured it out: subdomain.</p>

<p>Subdomain is some sort of kernel level policy tool that we ship that polices access to files and other resources. And since this daemon didn't have access to, get this, write to my pseudoterminal, the dynamic linker when invoked couldn't either, hence no output. Run it from a system console, and it worked fine. Gah.</p>

<p>So I'm hacking around and I go to set $LD_LIBRARY_PATH so that I can fool the daemon into using my shared object and not the one in /usr/lib only it doesn't take it. So I bust out strace and see that it's trying to load it, but errno is getting set to -1 (Permission Denied). So I start checking out permissions and ownership and just really confuse myself. Even when sitting in / with 777 permissions, I can't get this library to link. And then it hit me: subdomain.</p>

<p>I didn't even fix the problem. I just got up from my desk and left for the day. I can't believe that the same problem tripped me up twice within the same afternoon.</p>

<p>Never again. Never again.</p>]]></description>
        <pubDate>2008-01-24T18:45:13-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2433.html</guid>
    </item>

    <item>
        <title>On Serf City</title>
        <link>http://www.b-rent.com/blog/posts/2432.html</link>
        <description><![CDATA[<p>I spent 3 hours yesterday playing my favorite old DOS game: Serf City. I used to play it back in high school but I haven't had an environment to run it in since then. I had tried a few times to get it running but always failed, until yesterday. My work-provided laptop runs it like a champ in dosbox, complete with midi emulation and SVGA graphics. It was great.</p>

<p>After that success, I decided that I'd rather play it at my desk with a real mouse so I decided to try my hand with compiling dosbox on Solaris/SPARC. This would be more of a trick, since the software wouldn't just be faking the game into thinking it was running in DOS, it would actually be doing that plus emulating an 80386 microprocessor. Well, it compiled fine, but dosbox apparently still has some kinks because when I pressed any keys on my keyboard, it was interpreted at some point as the wrong character. I dunno, maybe that was SDL's fault, but it sure wasn't working.</p>

<p>So back to the laptop I go.</p>]]></description>
        <pubDate>2008-01-06T07:57:45-08:00</pubDate>
        <guid isPermaLink="true">http://www.b-rent.com/blog/posts/2432.html</guid>
    </item>

   </channel>
</rss>
